#include <bits/stdc++.h>
using namespace std;
const int maxn = 10055;
char a[maxn];
int dp[maxn][2];
set<string> id;
int main() {
  while (scanf("%s", a) != EOF) {
    id.clear();
    int n = strlen(a);
    for (int i = 0; i < n / 2; i++) {
      swap(a[i], a[n - i - 1]);
    }
    memset(dp, 0, sizeof(dp));
    dp[1][0] = 1;
    dp[2][1] = 1;
    for (int i = 3; i < n - 5; i++) {
      dp[i][0] |= dp[i - 2][1];
      if (a[i] != a[i - 2] || a[i - 1] != a[i - 3]) dp[i][0] |= dp[i - 2][0];
      if (i > 3) {
        dp[i][1] |= dp[i - 3][0];
        if (i > 4 &&
            (a[i] != a[i - 3] || a[i - 1] != a[i - 4] || a[i - 2] != a[i - 5]))
          dp[i][1] |= dp[i - 3][1];
      }
    }
    char s[4];
    for (int i = 0; i < n - 5; i++) {
      if (dp[i][0]) {
        s[0] = a[i], s[1] = a[i - 1], s[2] = '\0';
        string cc(s);
        if (!id.count(cc)) id.insert(cc);
      }
      if (dp[i][1]) {
        s[0] = a[i], s[1] = a[i - 1], s[2] = a[i - 2], s[3] = '\0';
        string cc(s);
        if (!id.count(cc)) id.insert(cc);
      }
    }
    printf("%d\n", id.size());
    for (set<string>::iterator it = id.begin(); it != id.end(); it++) {
      cout << *it << endl;
    }
  }
  return 0;
}
