#include <bits/stdc++.h>
using namespace std;
long long powmod(long long a, long long b, long long MOD) {
  long long res = 1;
  a %= MOD;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % MOD;
    a = a * a % MOD;
  }
  return res;
}
const int maxs = 1e4 + 10;
const int maxn = 1e4 + 10;
const int maxnode = 1e4 + 10;
const int sigma_size = 26;
struct Trie {
  int ch[maxnode][sigma_size];
  char str[maxs];
  int tsz;
  int val[maxnode], sz, sum;
  void clear() {
    sz = 1;
    memset(ch[0], 0, sizeof(ch[0]));
  }
  int idx(char c) { return c - 'a'; }
  void insert(char* s, int len) {
    int u = 0;
    for (int i = 0; i < len; ++i) {
      int c = idx(s[i]);
      if (!ch[u][c]) {
        memset(ch[sz], 0, sizeof(ch[sz]));
        val[sz] = 0;
        ch[u][c] = sz++;
      }
      u = ch[u][c];
    }
    if (val[u] != 1) ++sum;
    val[u] = 1;
  }
  void dfs(int u) {
    if (val[u] == 1) {
      str[tsz] = 0;
      printf("%s\n", str);
    }
    for (int i = 0; i < sigma_size; ++i) {
      if (ch[u][i]) {
        str[tsz++] = 'a' + i;
        dfs(ch[u][i]);
        --tsz;
      }
    }
  }
  void print() {
    printf("%d\n", sum);
    dfs(0);
  }
} trie;
set<string> S[maxn];
int dp[maxn], n;
char s[maxn];
bool check(int i, int t) {
  if (t == 2) {
    return s[i] != s[i + 2] || s[i + 1] != s[i + 3];
  }
  if (t == 3)
    return s[i] != s[i + 3] || s[i + 1] != s[i + 4] || s[i + 2] != s[i + 5];
  return false;
}
int main() {
  trie.clear();
  scanf("%s", s);
  n = strlen(s);
  dp[n] = 1;
  for (int i = n - 1; i >= 5; --i) {
    if (i + 2 <= n && dp[i + 2] && (dp[i + 5] || check(i, 2))) {
      dp[i] = 1;
      trie.insert(s + i, 2);
    }
    if (i + 3 <= n && dp[i + 3] && (dp[i + 5] || check(i, 3))) {
      dp[i] = 1;
      trie.insert(s + i, 3);
    }
  }
  trie.print();
  return 0;
}
