// Arup Guha
// 10/7/2017
// Solution to Junior Knights Free Response Question #2 (from Loop Practice)
// Reverses the digits in an input number

import java.util.*;

public class revdigits {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		System.out.println("Enter n.");
		int n = stdin.nextInt();

		// Peel off each digit, one by one, printing from the back to the front.
		while (n > 0) {
			System.out.print((n%10));
			n = n/10;
		}
		System.out.println();
	}
}