#include <bits/stdc++.h>
using namespace std;
int muzu[10005][2];
int main(void) {
  int N;
  char Pole[10005];
  int i;
  for (i = 0;; i++) {
    scanf("%c", &Pole[i]);
    if (Pole[i] == '\n') {
      N = i;
      break;
    }
    muzu[i][0] = 0;
    muzu[i][1] = 0;
  }
  muzu[N + 1][0] = 0;
  muzu[N + 1][1] = 0;
  vector<int> cisla;
  muzu[N][0] = 1;
  muzu[N][1] = 1;
  muzu[N - 2][1] = 1;
  for (i = N - 2; i > 4; i--) {
    if (muzu[i + 2][0] == 1 ||
        (muzu[i + 3][1] == 1 &&
         ((Pole[i - 1] != Pole[i + 2]) || (Pole[i - 2] != Pole[i + 1]) ||
          (Pole[i - 3] != Pole[i]))))
      muzu[i][1] = 1;
    if (muzu[i + 3][1] == 1 ||
        (muzu[i + 2][0] == 1 &&
         ((Pole[i - 1] != Pole[i + 1]) || (Pole[i - 2] != Pole[i]))))
      muzu[i][0] = 1;
  }
  for (i = 0; i <= N; i++) {
    if (muzu[i][0] == 1 && i >= 7) {
      cisla.push_back(256 * 256 * Pole[i - 2] + 256 * Pole[i - 1]);
    }
    if (muzu[i][1] == 1 && i >= 8) {
      cisla.push_back(256 * 256 * Pole[i - 3] + 256 * Pole[i - 2] +
                      Pole[i - 1]);
    }
  }
  int res = 0;
  sort(cisla.begin(), cisla.end());
  for (i = 0; i < cisla.size(); i++) {
    if (i == 0)
      res++;
    else if (cisla[i] != cisla[i - 1])
      res++;
  }
  printf("%i\n", res);
  int x;
  if (res == 0) return 0;
  for (i = 0; i < cisla.size(); i++) {
    if (i == 0 || cisla[i] != cisla[i - 1]) {
      x = cisla[i];
      printf("%c", x / (256 * 256));
      x %= (256 * 256);
      printf("%c", x / 256);
      x %= 256;
      if (x != 0) {
        printf("%c", x);
      }
      printf("\n");
    }
  }
  return 0;
}
