Problem:
Score : 100 points

Problem Statement

You are given a string S of length 2 or 3 consisting of lowercase English letters. If the length of the string is 2, print it as is; if the length is 3, print the string after reversing it.

Constraints

The length of S is 2 or 3.

S consists of lowercase English letters.

Input

Input is given from Standard Input in the following format:

S

Output

If the length of S is 2, print S as is; if the length is 3, print S after reversing it.

Sample Input 1

abc

Sample Output 1

cba

As the length of S is 3, we print it after reversing it.

Sample Input 2

ac

Sample Output 2

ac

As the length of S is 2, we print it as is.

Solution in C# (Mono 4.6.2.0) (judge verdict: Accepted)

using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
using Debug = System.Diagnostics.Debug;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;

class Ph
{
    static void Main()
    {
        string s = Console.ReadLine();
        Console.WriteLine(s.Length == 2 ? s : string.Join("", s.Reverse()));
        return;
        var nmd = Console.ReadLine().Split().Select(int.Parse).ToList();
        var a = Console.ReadLine().Split().Select(int.Parse).ToList();
        int[] swap = Enumerable.Range(0, nmd[0]).ToArray();
        for (int i = a.Count - 1; i >= 0; i--)
        {
            var tmp = swap[a[i] - 1];
            swap[a[i] - 1] = swap[a[i]];
            swap[a[i]] = tmp;
        }

        int[] res = Enumerable.Range(1, nmd[0]).ToArray();
        while (nmd[2] > 0)
        {
            if ((nmd[2] & 1) == 1) res = Operate(res, swap);
            swap = Operate(swap, swap);
            nmd[2] >>= 1;
        }
        Console.WriteLine(string.Join("\n", res));
    }

    static int[] Operate(int[] a, int [] op)
    {
        var res = a.ToArray();
        for (int i = 0; i < op.Length; i++)
        {
            res[i] = a[op[i]];
        }
        return res;
    }
}