import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int num = in.nextInt();
int[] result = new int[4];
result[0] = num % 10;
result[1] = num / 10 % 10;
result[2] = num / 100 % 10;
result[3] = num / 1000;
for(int i = 0; i < 4; i++){
System.out.print(result[i]);
}
}
}