#include #include using namespace std; int main() { int n,m, tmp = 0; cin >> n; m = n; m *= 10; while (m /= 10) { tmp += m % 10; tmp *= 10; } tmp /= 10; cout << max(n, tmp) << endl; return 0; }