#include<iostream> using namespace std; int main(){ int a,s,d,f; scanf("%1d%1d%1d%1d",&a,&s,&d,&f); cout<<(s*1000+a*100+f*10+d)*1; }