#include <bits/stdc++.h>
using namespace std;
const int N = 40000;
string S;
bool dp2[N], dp3[N];
vector<string> res, ans;
int n;
int main() {
  cin >> S;
  int n = S.size();
  S[n] = ' ';
  S[n + 1] = ' ';
  S[n + 2] = ' ';
  S[n + 3] = ' ';
  dp2[n] = 1;
  dp3[n] = 1;
  string P;
  for (int i = n - 1; i >= 5; i--) {
    dp2[i] = dp3[i + 2];
    if (dp2[i + 2] && (S[i] != S[i + 2] || S[i + 1] != S[i + 3])) dp2[i] = 1;
    P = "";
    P = P + S[i];
    P = P + S[i + 1];
    if (dp2[i]) res.push_back(P);
    dp3[i] = dp2[i + 3];
    if (dp3[i + 3] &&
        (S[i] != S[i + 3] || S[i + 1] != S[i + 4] || S[i + 2] != S[i + 5]))
      dp3[i] = 1;
    P = P + S[i + 2];
    if (dp3[i]) res.push_back(P);
  }
  sort(res.begin(), res.end());
  if (res.empty()) {
    cout << 0;
    return 0;
  }
  ans.push_back(res[0]);
  for (int i = 1; i < res.size(); i++) {
    if (res[i] != res[i - 1]) ans.push_back(res[i]);
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << endl;
  }
}
