Problem:
Reverse Sequence

Write a program which reverses a given string str.

Input

str (the size of str ≤ 20) is given in a line.

Output

Print the reversed str in a line.

Sample Input

w32nimda

Output for the Sample Input

admin23w

Solution in JAVA (judge verdict: Wrong Answer)

import java.io.*;

public class Main{
	public static void main(String[] args){
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		try{
		String s;
		while((s = reader.readLine()) != null){
			int n = s.length();
			char[] t = new char[n];
			for(int i = 0;i<n;i++){
				int m = n-1;
				t[m-i] = s.charAt(i);
			}
			for(int j = 0;j<n;j++){
				System.out.print(t[j]);
				System.out.println("");
			}
		}
		}catch(IOException e){
			System.exit(0);
		}
	}
}