#include <bits/stdc++.h>
using namespace std;
const int maxn = 3 * 1000 * 1000 + 10;
const long long mod = 1000 * 1000 * 1000 + 7;
const long long inf = 1LL * 1000 * 1000 * 1000 * 1000 * 1000 * 1000 + 10;
long long pw(long long a, long long b) {
  return (b == 0 ? 1LL
                 : ((pw(a * a % mod, b / 2) * (b & 1 == 1 ? a : 1LL)) % mod));
}
long long comb(long long n, long long k) {
  long long _max = max(k, n - k), _min = min(k, n - k), f = 1, s = 1;
  for (int i = 0; i < n - _max; i++) {
    f *= n - i;
    f %= mod;
  }
  for (int i = 1; i <= _min; i++) {
    s *= i;
    s %= mod;
  }
  return ((f * pw(s, mod - 2)) % mod);
}
bool dp[maxn][2];
set<string> ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s, a, b;
  cin >> s;
  a = "aa";
  b = "bbb";
  dp[s.size()][0] = true;
  dp[s.size()][1] = true;
  dp[s.size() - 2][0] = true;
  dp[s.size() - 3][1] = true;
  a[0] = s[s.size() - 2];
  a[1] = s[s.size() - 1];
  b[0] = s[s.size() - 3];
  b[1] = s[s.size() - 2];
  b[2] = s[s.size() - 1];
  if (s.size() >= 7) ans.insert(a);
  if (s.size() >= 8) ans.insert(b);
  for (int i = s.size() - 4; i > 4; i--) {
    a[0] = s[i];
    a[1] = s[i + 1];
    b[0] = s[i];
    b[1] = s[i + 1];
    b[2] = s[i + 2];
    if (dp[i + 2][1] or
        (dp[i + 2][0] and !(s[i] == s[i + 2] and s[i + 1] == s[i + 3]))) {
      ans.insert(a);
      dp[i][0] = true;
    }
    if (dp[i + 3][0] or
        (dp[i + 3][1] and !(s[i] == s[i + 3] and s[i + 1] == s[i + 4] and
                            s[i + 2] == s[i + 5]))) {
      ans.insert(b);
      dp[i][1] = true;
    }
  }
  cout << ans.size() << endl;
  for (auto it = ans.begin(); it != ans.end(); it++) cout << *it << '\n';
  return 0;
}
