#include <iostream>
using namespace std;
int main() {
int n, m, p10 = 1, c1, c2, nn;
cin >> n;
while (m >= 10) {
p10 *= 10;
m /= 10;
}
m = n;
c2 = m % 100 / 10;
c1 = (m / (p10 / 10)) % 10;
nn = m / p10 * p10;
p10 /= 10;
nn = nn + c2 * p10;
nn = nn + m % p10;
nn = nn / 100 * 100 + c1 * 10 + m % 10;
cout << nn;
return 0;
}