#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const int MOD = 1e9 + 7;
const int N = 5e4 + 10;
set<string> se;
int n, h[N][2];
string s;
void prepare() {
  cin >> s;
  n = s.length();
  s = s + "@@@";
}
void BFS() {
  h[n][0] = h[n][1] = 1;
  for (auto i = (n); i >= (1); i--) {
    if (i < n) {
      for (auto j = (0); j <= (1); j++)
        if (h[i][j]) se.insert(s.substr(i, j + 2));
    }
    for (auto use = (0); use <= (1); use++)
      if (i - use - 2 > 4) {
        if (h[i][use ^ 1]) h[i - use - 2][use] = 1;
        if (h[i][use] && s.substr(i - use - 2, use + 2) != s.substr(i, use + 2))
          h[i - use - 2][use] = 1;
      }
  }
  cout << se.size() << '\n';
  for (auto i : se) cout << i << '\n';
}
int main() {
  prepare();
  BFS();
}
