#include <iostream>
#include <string>
using namespace std;

int main() {
	string s1, s2;
	getline(cin, s1);
	if(s1.length()<4){
		cout << "Невозможно выполнить операцию." << endl;
	} else {
		s2=s1.substr(0, s1.length()-1);
		s2+=s1[0];
		s2+=s1[1];
		s2+=s1[s1.length()-1];
	}
	cout << s2 << endl;
	return 0;
}