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: Accepted)

import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
	public static void main(String[] args) {
		// ??????????????°
		String[] strArry = null;
		String a;
		String sin = "";

		Scanner sc = new Scanner(System.in);		//?????????????????§??\???


		while(sc.hasNext()){
			a = sc.next();		//??\?????????????????????a?????\??????
			int nagasa = a.length();
			if(nagasa > 20){
				break;
			}

			Pattern p = Pattern.compile("[0-9a-zA-Z]+");		//????§???±??°????????£?¨?
			Matcher m = p.matcher(a);

			boolean matchResult = m.matches();
			if(matchResult == false){
				break;
			}

			strArry = a.split("");		//a?????\??£?????????????????????strArray?????\??????

			for(int b = strArry.length-1; 0 <= b ; b--){
				String c =strArry[b];
				sin = sin + c ;
			}
		break;
		}
		System.out.println(sin);
	}
}