#include <bits/stdc++.h>
int N, f[10001], g[10001], h[10001];
char a[10002];
int main() {
  scanf("%s", a + 1);
  while (a[N + 1]) N++;
  f[N] = 1;
  for (int i = N; i >= 7; i--) {
    if (f[i]) {
      g[i - 2] = 1;
      h[i - 3] = 1;
    }
    if (g[i]) {
      if (a[i - 1] != a[i + 1] || a[i] != a[i + 2]) g[i - 2] = 1;
      h[i - 3] = 1;
    }
    if (h[i]) {
      g[i - 2] = 1;
      if (a[i - 2] != a[i + 1] || a[i - 1] != a[i + 2] || a[i] != a[i + 3])
        h[i - 3] = 1;
    }
  }
  std::set<std::string> S;
  for (int i = 7; i <= N; i++)
    if (f[i] || g[i] && (a[i - 1] != a[i + 1] || a[i] != a[i + 2]) || h[i])
      S.insert(std::string(a + i - 1, a + i + 1));
  for (int i = 8; i <= N; i++)
    if (f[i] || g[i] ||
        h[i] &&
            (a[i - 2] != a[i + 1] || a[i - 1] != a[i + 2] || a[i] != a[i + 3]))
      S.insert(std::string(a + i - 2, a + i + 1));
  printf("%d\n", int(S.size()));
  for (auto &i : S) std::cout << i << std::endl;
  return 0;
}
