#include<fstream>
#include<string>
using namespace std;
int main()
{
	string s;
	ifstream fi("DQND.inp");
	ofstream fo("DQND.out");
	getline(fi,s);
	fi.close();
	int y=s.length()-1;
	for(int i=y;i>=0;i--)
	{
		fo<<s[i];
	}
	fo<<endl;
	fo<<s.length();
	fo.close();
	return 0;
}
