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 C# (judge verdict: Accepted)

using System;
using System.Collections.Generic;
using System.Linq;

class Program {

    static int Main(string[] args) {
        string v = Console.ReadLine();

        for (int i = v.Length - 1; i >= 0; i--) {
            Console.Write(v.Substring(i, 1));
        }
        Console.WriteLine("");
        return 0;
        
        //List<decimal[]> list = new List<decimal[]>();

        //while (true) {
        //    string v = Console.ReadLine();
        //    if (string.IsNullOrEmpty(v) == true) { break; }

        //    decimal a = decimal.Parse(v.Split(' ')[0]);
        //    decimal b = decimal.Parse(v.Split(' ')[1]);

        //    list.Add(new decimal[] { a, b });
        //}

        //for (int i = 0; i < list.Count; i++) {
        //    List<decimal> aList = GetYakusu(list[i][0]);
        //    List<decimal> bList = GetYakusu(list[i][1]);

        //    decimal max = GetMaxYakusu(aList, bList);
        //    decimal min = GetMinBaisu(aList, bList);

        //    Console.WriteLine("{0} {1}", max, min);
        //}

        //return 0;
    }

    static decimal GetMinBaisu(List<decimal> a, List<decimal> b) {
        decimal v = 1;
        for (int i = 0; i < a.Count; i++) {
            v *= a[i];
        }
        for (int i = 0; i < b.Count; i++) {
            v *= b[i];
        }
        return v;
    }

    static decimal GetMaxYakusu(List<decimal> a, List<decimal> b) {
        decimal v = 1;

        for (int i = 0; i < a.Count; i++) {
            if (b.Contains(a[i]) == true) {
                v *= a[i];
                b.Remove(a[i]);
            }
        }

        return v;
    }

    static List<decimal> GetYakusu(decimal v) {
        List<decimal> list = new List<decimal>();

        decimal c = 2;
        while (true) {
            if (v < 2) { break; }

            if (v % c == 0) {
                list.Add(c);
                v = v / c;
            }
            else {
                c++;
            }
        }

        return list;
    }

    static int InputN() {
        string v = Console.ReadLine();
        return int.Parse(v);
    }

    static int[] InputInt() {
        string v = Console.ReadLine();
        string[] vs = v.Split(' ');

        return new int[] { int.Parse(vs[0]), int.Parse(vs[1]) };
    }

    static void Check(int n, List<int[]> list) {
        SortedDictionary<int, int> v = new SortedDictionary<int, int>();

        int maxValue = 0;
        for (int i = 0; i < list.Count; i++) {
            int id = list[i][0];
            if (v.ContainsKey(id) == false) {
                v.Add(id, 0);
            }

            v[id] += list[i][1];

            if (maxValue < v[id]) {
                maxValue = v[id];
                Console.WriteLine("{0} {1}", id, maxValue);
            }
            else {
                maxValue = v.Values.Max();
                var q = v.Where((x) => x.Value == maxValue);
                foreach (var item in q) {
                    Console.WriteLine("{0} {1}", item.Key, maxValue);
                    break;
                }
            }
        }
    }
}