#include <iostream> #include <algorithm> using namespace std; int main() { cin.sync_with_stdio(0); cin.tie(0); int N; while (cin >> N) { int negative = 1; if (N < 0) { negative = -1; N *= -1; } string str = to_string(N); reverse(str.begin(), str.end()); int ans; if (str.length() == 1) ans = int(str[0] - '0'); else ans = stoi(str); ans *= negative; cout << ans << "\n"; } }