// reverse.cola  AKA VM Crusher
//
// Reverse an input string recursively swapping.
// Give it a bigger file to make the GC grind and the
// call stack grow. :)
//
// Copyright (C) 2002 Melvin Smith

using System;

public class Reverse {

    // Recursively reverse string halves until halves are length 1
    public string Reverse(string s1, string s2, int d) {
        int len = strlen(s1);
//        puts("recurse depth ");
//        puti(d);
//        puts("\n");
        if(len > 1)
            s1 = Reverse(substr(s1, 0, len/2), substr(s1, len/2, len-len/2), d + 1);
        len = strlen(s2);
        if(len > 1)
            s2 = Reverse(substr(s2, 0, len/2), substr(s2, len/2, len-len/2), d + 1);

        return s2 + s1; 
    }

    public static void Main() {
        string str, bstr;
        while(1) {
            bstr = gets();
            if(bstr == "")
                break;
            str = str + bstr;
        }
        
        // Reverse it with recursion
        puts("\n");
        // Reverse the 2 halves
        str = Reverse(str, "", 0);
        puts(str);
    }
}



