#include <bits/stdc++.h>
using namespace std;
string s;
int a[10005], f[10005][4], q[28000], h2[10005], h3[10005], n;
int main() {
  ios::sync_with_stdio(0);
  cin >> s;
  n = s.size();
  for (int i = 1; i <= n; i++) a[i] = s[i - 1] - 'a' + 1;
  for (int i = 6; i <= n; i++)
    h2[i] = a[i] * 900 + a[i + 1] * 30, h3[i] = h2[i] + a[i + 2];
  if (n < 7) {
    printf("0\n");
    return 0;
  }
  f[n + 1][2] = f[n + 1][3] = 1, f[n - 1][2] = 1;
  q[h2[n - 1]] = 1;
  for (int i = n - 2; i > 5; i--) {
    if (f[i + 2][3] || (f[i + 2][2] && h2[i] != h2[i + 2]))
      f[i][2] = 1, q[h2[i]] = 1;
    if (f[i + 3][2] || (f[i + 3][3] && h3[i] != h3[i + 3]))
      f[i][3] = 1, q[h3[i]] = 1;
  }
  int ans = 0;
  for (int i = 1; i <= 27500; i++) ans += q[i];
  printf("%d\n", ans);
  for (int i = 1; i <= 27500; i++) {
    if (!q[i]) continue;
    if (i % 30)
      printf("%c%c%c\n", (i / 900) + 96, ((i % 900) / 30) + 96, (i % 30) + 96);
    else
      printf("%c%c\n", (i / 900) + 96, ((i % 900) / 30) + 96);
  }
  return 0;
}
