#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int n, m, k, ans, mod = 1e9 + 7;
string s;
bool vt[2][10101];
bool cnt[30][30][30];
vector<string> vs;
inline void calc(int e, int v) {
  if (vt[v - 2][e]) return;
  vt[v - 2][e] = 1;
  if (e < 6) return;
  if (v == 3 || s[e - 1] != s[e + 1] || s[e] != s[e + 2]) {
    cnt[s[e - 1] - 'a' + 1][s[e] - 'a' + 1][0] = 1;
    calc(e - 2, 2);
  }
  if (e < 7) return;
  if (v == 2 || s[e - 2] != s[e + 1] || s[e - 1] != s[e + 2] ||
      s[e] != s[e + 3]) {
    cnt[s[e - 2] - 'a' + 1][s[e - 1] - 'a' + 1][s[e] - 'a' + 1] = 1;
    calc(e - 3, 3);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int i, j, temp = 0;
  cin >> s;
  n = s.size();
  s += '#';
  s += '#';
  s += '#';
  calc(n - 1, 2);
  for (i = 1; i < 27; i++)
    for (j = 1; j < 27; j++)
      for (k = 0; k < 27; k++)
        if (cnt[i][j][k]) {
          string ss;
          ss += i + 'a' - 1;
          ss += j + 'a' - 1;
          if (k) ss += k + 'a' - 1;
          vs.push_back(ss);
        }
  cout << vs.size() << '\n';
  for (i = 0; i < vs.size(); i++) cout << vs[i] << '\n';
}
