#include <bits/stdc++.h>
using namespace std;
string s;
set<string> v;
bool vis[10000][26][26][27];
void DFS(int i, string prev) {
  if (i > 3 && !vis[i][prev[0] - 'a'][prev[1] - 'a']
                   [prev.size() == 3 ? prev[2] - 'a' + 1 : 0]) {
    for (int j = i - 2; j <= i - 1; j++) {
      string curr;
      for (int k = j; k <= i; k++) curr.push_back(s[k]);
      if (curr != prev && j > 4) {
        v.insert(curr);
        DFS(j - 1, curr);
      }
    }
    vis[i][prev[0] - 'a'][prev[1] - 'a']
       [prev.size() == 3 ? prev[2] - 'a' + 1 : 0] = true;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  cin >> s;
  DFS(s.size() - 1, "");
  cout << v.size() << "\n";
  for (string suf : v) cout << suf << "\n";
}
