#include<bits/stdc++.h>
using namespace std;
string kq="";
int dn(string s,int k )
{
    if (k==s.length()) return 0;

    kq=kq+s[s.length()-k-1];

    dn(s,k+1);
}
int main()
{
    ifstream fi("dqnd.inp");
    ofstream fo("dqnd.out");
    string s;
    fi>>s;
    dn(s,0);
    fo<<kq<<endl<<s.length();
}
