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++14 (GCC 5.4.1) (judge verdict: Runtime Error)

#include <iostream>
#include <map>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;
using ll = long long;
using ld = long double;

int main() {
    int N;

    cin >> N;

    int x = 0;
    int k = 0;
    for (int i = 1; i < N; ++i) {
        x += i;
        if(x==N){
            k = i;
            break;
        }
        if(x > N){
            cout << "No" << endl;
            return 0;
        }
    }

    cout << k + 1 << endl;

    vector<vector<int>> R;
    for (int i = 0; i < k+1; ++i) {
        vector<int> v;
        R.push_back(v);
    }
    R[0].push_back(1);
    R[1].push_back(1);

    if(k > 1) {
        x = 1;
        for (int i = 2; i < k+1; ++i) {
            x += i;
            for (int j = i; j <= x; ++j) {
                R[j - i].push_back(j);
                R[i].push_back(j);

            }
        }
    }

    for (int i = 0; i < k+1; ++i) {
        cout << k;
        for (int j = 0; j < k; ++j) {
            cout << " " << R[i][j];
        }
        cout << endl;
    }


    return 0;
}