#include <bits/stdc++.h>
using namespace std;
set<string> e;
set<string>::iterator it;
string s;
bool dp[100005];
int main() {
  cin >> s;
  int len = s.size();
  memset(dp, false, sizeof(dp));
  dp[len] = true;
  if (len < 7) {
    printf("0\n");
    return 0;
  }
  for (int i = len - 1; i >= 5; --i) {
    for (int l = 2; l <= 3; ++l) {
      string t = s.substr(i, l);
      if (l == 2) {
        if (((s[i + 1] != s[i + 3] || s[i] != s[i + 2]) || dp[i + 5]) &&
            dp[i + l]) {
          e.insert(t);
          dp[i] = true;
        }
      }
      if (l == 3) {
        if (((s[i + 1] != s[i + 3] || s[i] != s[i + 2]) || dp[i + 5]) &&
            dp[i + l]) {
          e.insert(t);
          dp[i] = true;
        }
      }
    }
  }
  cout << e.size() << endl;
  for (it = e.begin(); it != e.end(); ++it) cout << (*it) << endl;
  return 0;
}
