#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  int n = s.size();
  auto get = [&](int i, int j) {
    string st = "";
    for (int t = i; t < min(n, i + j); t++) st += s[t];
    return st;
  };
  vector<vector<bool>> can(n + 1, vector<bool>(4));
  can[n][2] = can[n][3] = true;
  for (int i = n - 1; i >= 5; i--) {
    for (int j = 2; j < 4; j++)
      if (i + j <= n && (can[i + j][2] || can[i + j][3])) {
        string a = get(i, j), b = get(i + j, j);
        for (int k = 2; k < 4; k++) {
          if (a == b && j == k) continue;
          can[i][j] = can[i][j] | can[i + j][k];
        }
      }
  }
  set<string> ans;
  for (int i = 5; i < n; i++)
    for (int j = 2; j < 4; j++)
      if (can[i][j]) ans.insert(get(i, j));
  cout << ans.size() << '\n';
  for (auto &i : ans) cout << i << '\n';
  return 0;
}
