#include <bits/stdc++.h>
using namespace std;
struct Node {
  string a;
} a[10000 * 10];
int cmp(Node a, Node b) { return a.a < b.a; }
int dp[10000 + 5];
string s;
map<string, int> m;
int main() {
  cin >> s;
  int len = s.length();
  memset(dp, 0, sizeof(dp));
  dp[len] = 1;
  dp[len - 1] = 0;
  dp[len + 1] = 0;
  m.clear();
  int cnt = 0;
  for (int i = len - 2; i >= 5; i--) {
    if (dp[i + 2] != 0) {
      string b = s.substr(i, 2);
      if (dp[i + 2] != 2 || b != s.substr(i + 2, 2)) {
        if (!m.count(b)) {
          m[b] = 1;
          a[cnt++].a = b;
        }
        dp[i] += 2;
      }
    }
    if (dp[i + 3] != 0) {
      string b = s.substr(i, 3);
      if (dp[i + 3] != 3 || b != s.substr(i + 3, 3)) {
        if (!m.count(b)) {
          m[b] = 1;
          a[cnt++].a = b;
        }
        dp[i] += 3;
      }
    }
  }
  sort(a, a + cnt, cmp);
  printf("%d\n", cnt);
  for (int i = 0; i < cnt; i++) cout << a[i].a << endl;
  return 0;
}
