#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e4 + 9;
int n;
string S;
set<string> ans;
int dp[MAXN][4];
int calc(int pos, int step) {
  if (pos == n - 1) return 0;
  if (pos == n) return 1;
  if (pos > n) return 0;
  int& ref = dp[pos][step];
  if (ref != -1) return ref;
  bool any = (pos + 2 * step) > n;
  for (int i = 0; i < step; ++i)
    if (S[pos + i] != S[pos + step + i]) any = true;
  int contrary = step == 2 ? 3 : 2;
  int same = any ? calc(pos + step, step) : 0;
  int cont = calc(pos + step, contrary);
  int valid = max(same, cont);
  if (valid == 1) {
    string addme = "";
    for (int j = 0; j < step; ++j) addme += S[pos + j];
    ans.insert(addme);
  }
  return ref = valid;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  memset(dp, -1, sizeof(dp));
  cin >> S;
  n = S.size();
  for (int i = 5; i < n; ++i) {
    calc(i, 2), calc(i, 3);
  }
  cout << ans.size() << endl;
  for (auto x : ans) cout << x << endl;
}
