70tps
3个wa
#include<bits/stdc++.h>
using namespace std;
long long n,m;
bool ch(long long x){
if(x<10){
return true;
}
long long y=0,z=x;
while(x>0){
y=y*10+x%10;
x/=10;
}
if(z==y){
return true;
}
else return false;
}
int main() {
cin>>n;
for(long long i=n+1;;i=i+1){
if(ch(i)==true){
cout<<i<<endl;
return 0;
}
}
return 0;
}