#include <bits/stdc++.h>
using namespace std;
bool dp[10005][3];
int main() {
  string s;
  cin >> s;
  int l = s.length();
  if (l <= 6) {
    cout << 0 << endl;
    return 0;
  }
  dp[l - 2][0] = 1, dp[l - 2][1] = 0;
  dp[l - 3][1] = 1, dp[l - 3][0] = 0;
  for (int i = l - 4; i >= 5; i--) {
    if (s[i] == s[i + 2] && s[i + 1] == s[i + 3])
      dp[i][0] = dp[i + 2][1];
    else
      dp[i][0] = dp[i + 2][0] | dp[i + 2][1];
    if (s[i] == s[i + 3] && s[i + 1] == s[i + 4] && s[i + 2] == s[i + 5])
      dp[i][1] = dp[i + 3][0];
    else
      dp[i][1] = dp[i + 3][1] | dp[i + 3][0];
  }
  set<string> v;
  for (int i = 5; i <= l - 2; i++) {
    if (dp[i][0]) v.insert(s.substr(i, 2));
    if (dp[i][1]) v.insert(s.substr(i, 3));
  }
  cout << v.size() << endl;
  for (set<string>::iterator it = v.begin(); it != v.end(); it++)
    cout << *it << endl;
}
