#include<bits/stdc++.h>
using namespace std;
int main(){
	int x,g,s,b,h;
    cin>>x;
    b=x/100;
	s=x/10%10;
	g=x%10;
	h=g*100+s*10+b;
	cout<<h;
} 
/**************************************************************
	Problem: 1028
	User: sucongyi
	Language: C++
	Result: Accepted
	Time:8 ms
	Memory:2072 kb
****************************************************************/