#include <bits/stdc++.h>
int a, i, sz, b, x[10005][2];
char s[10005];
int u[20005];
int main() {
  scanf("%s", s);
  a = strlen(s);
  x[a][0] = 1;
  x[a][1] = 1;
  for (i = a - 2; i >= 5; i--) {
    if (x[i + 2][1] == 1 ||
        (x[i + 2][0] == 1 && (!(s[i] == s[i + 2] && s[i + 1] == s[i + 3])))) {
      x[i][0] = 1;
      u[sz++] = (s[i] - 'a' + 1) * 27 * 27 + (s[i + 1] - 'a' + 1) * 27;
    }
    if (x[i + 3][0] == 1 ||
        (x[i + 3][1] == 1 && (!(s[i] == s[i + 3] && s[i + 1] == s[i + 4] &&
                                s[i + 2] == s[i + 5])))) {
      x[i][1] = 1;
      u[sz++] = (s[i] - 'a' + 1) * 27 * 27 + (s[i + 1] - 'a' + 1) * 27 +
                s[i + 2] - 'a' + 1;
    }
  }
  std::sort(u, u + sz);
  int s = 0;
  for (i = 0; i < sz; i++) {
    if (i == 0 || u[i] != u[i - 1]) s++;
  }
  printf("%d\n", s);
  for (i = 0; i < sz; i++) {
    if (i == 0 || u[i] != u[i - 1]) {
      if (u[i] % 27)
        printf("%c%c%c", u[i] / 27 / 27 + 96, u[i] % (27 * 27) / 27 + 96,
               u[i] % 27 + 96);
      else
        printf("%c%c", u[i] / 27 / 27 + 96, u[i] % (27 * 27) / 27 + 96);
      puts("");
    }
  }
}
