#include <iostream>
#include <algorithm>

using namespace std;

int main(){
	string s;
	cin >> s;
	
	int L = s.length();
	int halfL = (L - 1) / 2;
	bool yes[halfL];
	
	for (int i = 0; i < halfL; i++){
		yes[i] = (s[i] == s[L - 1 - i]);
	}
	
	int sol;
	
	char midC = s[halfL];
	int Ccount = 0;
	
	for (int i = 0; i < L; i++){
		if (s[i] == midC) Ccount++;
	}
	bool sred = (Ccount % 2 == 1);
	
	int a = -1, b = -1;
	string search = "a";
	for(int i = 0; i < halfL; i++){
		if ((search == "a") and (yes[i] == 0)){
			a = i;
			b = i;
			search = "b";
		}else if ((search == "b") and (yes[i] == 0)){
			b = i;
		}
	}
	string s1 = s.substr(0, halfL);
	string s2 = s.substr(halfL + 1, L - 1);
	
	sort(s1.begin(), s1.end());
	sort(s2.begin(), s2.end());
	
	cout << s1 << " " << s2 << endl;
	
	bool sim = (s1 == s2);
	
	if (a == -1){
		sol = 1;
	}else if (sim){
		sol = b - a + 1;
		cout << "sl1" << endl;
	}else{
		sol = L - 2 * a - 1;
		cout << "sl2" << endl;
	}
	cout << sol;
}