#include <bits/stdc++.h>
using namespace std;
long long rdtsc() {
  long long tmp;
  asm("rdtsc" : "=A"(tmp));
  return tmp;
}
inline int myrand() { return abs((rand() << 15) ^ rand()); }
inline int rnd(int x) { return myrand() % x; }
void precalc() {}
const int maxn = 1e4 + 10;
int n;
char s[maxn];
bool read() {
  if (scanf("%s", s) < 1) {
    return false;
  }
  n = strlen(s);
  return true;
}
set<string> ans;
int dp[maxn][2];
void solve() {
  ans.clear();
  memset(dp, 0, sizeof(dp));
  if (n >= 7) {
    dp[n - 2][0] = 1;
  }
  if (n >= 8) {
    dp[n - 3][1] = 1;
  }
  for (int i = n - 2; i >= 5; --i) {
    for (int it = 0; it < 2; ++it) {
      int len = it + 2;
      if (!dp[i][it]) {
        continue;
      }
      string cur = string(s + i, len);
      ans.insert(cur);
      for (int nit = 0; nit < 2; ++nit) {
        int nlen = nit + 2;
        if (i - nlen < 5) {
          break;
        }
        string t = string(s + (i - nlen), nlen);
        if (t != cur) {
          dp[i - nlen][nit] = 1;
        }
      }
    }
  }
  printf("%d\n", ((int)(ans).size()));
  for (auto t : ans) {
    printf("%s\n", t.c_str());
  }
}
int main() {
  srand(rdtsc());
  precalc();
  while (true) {
    if (!read()) {
      break;
    }
    solve();
  }
  return 0;
}
