// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#define dibs reserve
#define OVER9000 1234567890
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-8
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) ((x < 0)?-(x):x)
#define uint unsigned int
#define dbl long double
using namespace std;
// mylittledoge
int main() {
cin.sync_with_stdio(0);
cin.tie(0);
string s;
cin >> s;
int N =s.length();
set<int> S;
for(int i =0; i < N; i++) if(s[i] != s[N-1-i] && i < N-1-i) S.insert(i);
if(S.empty()) {cout << "1\n" << s << "\n"; return 0;}
if(S.size() > 2) {cout << "0\n"; return 0;}
set<string> S2;
ALL_THE(S,it) S.insert(N-1-(*it));
if(N%2 != 0) S.insert(N/2);
ALL_THE(S,it) ALL_THE(S,jt) {
string s2 =s;
swap(s2[*it],s2[*jt]);
bool b =true;
for(int i =0; i < N; i++) if(s2[i] != s2[N-1-i]) b =false;
if(!b) continue;
S2.insert(s2);}
cout << S2.size() << "\n";
ALL_THE(S2,it) cout << (*it) << "\n";
return 0;}
// look at my code
// my code is amazing
Ly8gaW9zdHJlYW0gaXMgdG9vIG1haW5zdHJlYW0KI2luY2x1ZGUgPGNzdGRpbz4KLy8gYml0Y2ggcGxlYXNlCiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGNzdGRsaWI+CiNpbmNsdWRlIDx2ZWN0b3I+CiNpbmNsdWRlIDxzZXQ+CiNpbmNsdWRlIDxtYXA+CiNpbmNsdWRlIDxxdWV1ZT4KI2luY2x1ZGUgPHN0YWNrPgojaW5jbHVkZSA8bGlzdD4KI2luY2x1ZGUgPGNtYXRoPgojaW5jbHVkZSA8aW9tYW5pcD4KI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