#include <bits/stdc++.h>
using namespace std;
string s;
string s2[10005];
map<string, int> a;
int len, m, p[10004][2];
bool cmp(string a, string b) { return a <= b; }
void search(int k, string s3) {
  if (k <= 5 || (p[k][1] == 1 && p[k][0] == 1)) return;
  if (s.substr(k - 1, 2) != s3) {
    string ss3 = s.substr(k - 1, 2);
    if (a[ss3] == 0) {
      a[ss3]++;
      s2[++m] = ss3;
    }
    p[k][0] = 1;
    search(k - 2, ss3);
  }
  if (k - 2 > 4) {
    if (s.substr(k - 2, 3) != s3) {
      s3 = s.substr(k - 2, 3);
      if (a[s3] == 0) {
        a[s3]++;
        s2[++m] = s3;
      }
      p[k][1] = 1;
      search(k - 3, s3);
    }
  }
}
int main() {
  int i;
  cin >> s;
  len = s.length();
  if (len <= 5)
    printf("0\n");
  else {
    search(len - 1, "");
    sort(s2 + 1, s2 + 1 + m, cmp);
    printf("%d\n", m);
    for (i = 1; i <= m; i++) printf("%s\n", s2[i].c_str());
  }
  return 0;
}
