#include <bits/stdc++.h>
using namespace std;
set<string> frogs;
string s, tmp;
int dp[100001][2];
int main() {
  cin >> s;
  int len = s.length();
  for (int i = len - 1; i >= 5; i--) {
    if (i + 2 == len) dp[i][0] = 1;
    if (i + 3 == len) dp[i][1] = 1;
    if (i + 2 < len) {
      if (dp[i + 2][1]) dp[i][0] = 1;
      if (dp[i + 2][0] && (s[i + 1] != s[i + 3] || s[i] != s[i + 2]))
        dp[i][0] = 1;
    }
    if (i + 3 < len) {
      if (dp[i + 3][0]) dp[i][1] = 1;
      if (dp[i + 3][1] &&
          (s[i + 1] != s[i + 4] || s[i + 2] != s[i + 5] || s[i] != s[i + 3]))
        dp[i][1] = 1;
    }
  }
  for (int i = len - 1; i >= 5; i--) {
    if (dp[i][0]) frogs.insert(s.substr(i, 2));
    if (dp[i][1]) frogs.insert(s.substr(i, 3));
  }
  cout << frogs.size() << endl;
  for (set<string>::iterator it = frogs.begin(); it != frogs.end(); it++)
    cout << (*it) << endl;
  return 0;
}
