#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6, MOD = 1e9 + 7;
long long h[N], power[N], dp[N][4];
long long flash(long long l, long long r) {
  return (h[r] - (h[l - 1] * power[r - l + 1]) % MOD + MOD) % MOD;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  if (s.size() == 5) {
    cout << 0;
    return 0;
  }
  long long p = 227;
  power[0] = 1;
  for (long long i = 1; i <= s.size(); i++) {
    h[i] = (h[i - 1] * p) % MOD + s[i - 1];
    power[i] = (power[i - 1] * p) % MOD;
  }
  set<long long> kek, kek1;
  vector<string> ans;
  for (long long i = s.size() - 1; i >= 5; i--) {
    string s1;
    s1 = s[i - 1];
    s1 += s[i];
    long long lol = flash(i, i + 1);
    if ((dp[i + 2][2] || dp[i + 3][3]) && i - 1 >= 5 ||
        i == s.size() - 1 && i - 1 >= 5) {
      if (!dp[i + 2][2] || dp[i + 3][3] || s[i + 2] != s[i] ||
          s[i + 1] != s[i - 1]) {
        if (kek.find(lol) == kek.end()) {
          ans.push_back(s1);
          kek.insert(lol);
        }
        dp[i][2] = 1;
      }
    }
    if ((dp[i + 2][2] || dp[i + 3][3]) && i - 2 >= 5 && i + 2 <= s.size() - 1 ||
        i == s.size() - 1 && i - 2 >= 5) {
      s1 = s[i - 2];
      s1 += s[i - 1];
      s1 += s[i];
      if (s1 == "bzz") {
        cout << dp[i + 2][2] << ' ' << i;
        return 0;
      }
      lol = flash(i - 1, i + 1);
      if (dp[i + 2][2] || !dp[i + 3][3] || s[i + 3] != s[i] ||
          s[i + 2] != s[i - 1] || s[i + 1] != s[i - 2]) {
        if (kek1.find(lol) == kek1.end()) {
          ans.push_back(s1);
          kek1.insert(lol);
        }
        dp[i][3] = 1;
      }
    }
  }
  sort(ans.begin(), ans.end());
  cout << ans.size() << "\n";
  for (auto to : ans) {
    cout << to << "\n";
  }
}
