/**
* 由命令行输入一个4位整数,求将该数反转以后的数,如原数为1234,反转后为4321
*/
package lianxiti;
import java.util.Scanner;
public class Di17 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int shuru = sc.nextInt();
String hebing ="";
String fanzhuan = String.valueOf(shuru);
for(int i=fanzhuan.length()-1; i>=0; i--) {
//System.out.print(fanzhuan.charAt(i));
hebing = hebing + fanzhuan.charAt(i);//将数字拆开,重新组合形成一个字符串
}
int newShu = Integer.parseInt(hebing);//将新数转回int类型
System.out.print(newShu);
}
}