#include <bits/stdc++.h>
using namespace std;
long long n, v[50000];
char sir[50000];
string aux1, aux2;
map<string, int> mp;
bool comp(string a, string b) {
  if (a.size() != b.size()) {
    return 1;
  }
  for (int i = 0; i < a.size(); ++i) {
    if (a[i] != b[i]) {
      return 1;
    }
  }
  return 0;
}
int main() {
  cin >> sir + 1;
  n = strlen(sir + 1);
  v[n + 1] = 1;
  for (int i = n - 1; i > 5; --i) {
    aux1.clear();
    aux1.push_back(sir[i]);
    aux1.push_back(sir[i + 1]);
    if (i <= n - 3) {
      aux2.clear();
      aux2.push_back(sir[i + 2]);
      aux2.push_back(sir[i + 3]);
      if (comp(aux1, aux2) && v[i + 4] == 1 && v[i + 2] == 1) {
        mp[aux1] = 1;
        v[i] = 1;
      } else {
        if (i <= n - 4) {
          aux2.clear();
          aux2.push_back(sir[i + 2]);
          aux2.push_back(sir[i + 3]);
          aux2.push_back(sir[i + 4]);
          if (comp(aux1, aux2) && v[i + 5] == 1 && v[i + 2] == 1) {
            mp[aux1] = 1;
            v[i] = 1;
          }
        }
      }
    } else {
      if (v[i + 2] == 1) mp[aux1] = 1, v[i] = 1;
    }
    if (i <= n - 2) {
      aux1.clear();
      aux1.push_back(sir[i]);
      aux1.push_back(sir[i + 1]);
      aux1.push_back(sir[i + 2]);
      if (i <= n - 5) {
        aux2.clear();
        aux2.push_back(sir[i + 3]);
        aux2.push_back(sir[i + 4]);
        aux2.push_back(sir[i + 5]);
        if (comp(aux1, aux2) && v[i + 6] == 1 && v[i + 3] == 1) {
          mp[aux1] = 1;
          v[i] = 1;
        }
      }
      if (i <= n - 4) {
        aux2.clear();
        aux2.push_back(sir[i + 3]);
        aux2.push_back(sir[i + 4]);
        if (comp(aux1, aux2) && v[i + 5] == 1 && v[i + 3] == 1) {
          mp[aux1] = 1;
          v[i] = 1;
        }
      }
      if (i == n - 2) {
        if (v[i + 3] == 1) mp[aux1] = 1, v[i] = 1;
      }
    }
  }
  cout << mp.size() << '\n';
  for (map<string, int>::iterator it = mp.begin(); it != mp.end(); ++it) {
    cout << it->first << '\n';
  }
  return 0;
}
