#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 x;
	fi>>x;
	DN(x,0);
	fo<<kq<<endl;
	fo<<x.length();
}
