#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;
  set<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 (ans.find(s1) == ans.end()) {
          ans.insert(s1);
        }
        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];
      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 (ans.find(s1) == ans.end()) {
          ans.insert(s1);
        }
        dp[i][3] = 1;
      }
    }
  }
  cout << ans.size() << "\n";
  for (auto to : ans) {
    cout << to << "\n";
  }
}
