#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int dp[10001][4];
set<string> answer;
bool can(int from, int len) {
  if (dp[from][len] != -1) return dp[from][len];
  if (from > n - 2) return false;
  if (from == n - 2) return len == 2;
  if (from == n - 3) return len == 3;
  bool ret = false;
  if (len == 2) {
    bool can3 = can(from + 2, 3);
    bool can2 = can(from + 2, 2);
    if (can3 ||
        (can2 && (s[from] != s[from + 2] || s[from + 1] != s[from + 3]))) {
      ret = true;
    }
  } else if (len == 3) {
    bool can3 = can(from + 3, 3);
    bool can2 = can(from + 3, 2);
    if (can2 ||
        (can3 && (s[from] != s[from + 3] || s[from + 1] != s[from + 4] ||
                  s[from + 2] != s[from + 5]))) {
      ret = true;
    }
  }
  return dp[from][len] = ret;
}
void solution() {
  cin >> s;
  n = s.size();
  memset(dp, -1, sizeof(dp));
  for (int i = 5; i < n; i++) {
    if (can(i, 2)) {
      answer.insert(s.substr(i, 2));
    }
    if (can(i, 3)) {
      answer.insert(s.substr(i, 3));
    }
  }
  cout << answer.size() << endl;
  for (const auto& s : answer) {
    cout << s << endl;
  }
}
int main() {
  solution();
  return 0;
}
