#include <bits/stdc++.h>
using namespace std;
set<string> solve(const string& s) {
  int n = s.length();
  set<string> res;
  vector<bool> f2(n, false), f3(n, false);
  f2[n - 2] = true;
  f3[n - 3] = true;
  if (n - 2 >= 5) {
    res.insert(s.substr(n - 2, 2));
  }
  if (n - 3 >= 5) {
    res.insert(s.substr(n - 3, 3));
  }
  for (int i = n - 4; i >= 5; --i) {
    f2[i] = f3[i + 2] or (f2[i + 2] and s.substr(i, 2) != s.substr(i + 2, 2));
    f3[i] = f2[i + 3] or (f3[i + 3] and s.substr(i, 3) != s.substr(i + 3, 3));
    if (f2[i]) {
      res.insert(s.substr(i, 2));
    }
    if (f3[i]) {
      res.insert(s.substr(i, 3));
    }
  }
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  while (true) {
    string s;
    cin >> s;
    if (!cin) {
      break;
    }
    auto res = solve(s);
    cout << res.size() << "\n";
    for (auto x : res) {
      cout << x << "\n";
    }
  }
  return 0;
}
