#include <bits/stdc++.h>
using namespace std;
struct $ {
  $() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
  }
} $;
const int Maxn = 20005;
int dp[Maxn][5];
int main() {
  int n, k;
  string s;
  cin >> s;
  n = s.length();
  if (n < 7) {
    cout << 0 << endl;
    return 0;
  }
  s += "###";
  if (n - 2 >= 5) dp[n - 2][2] = 1;
  if (n - 3 >= 5) dp[n - 3][3] = 1;
  for (int i = n - 4; i >= 5; i--) {
    if (s.substr(i, 2) != s.substr(i + 2, 2)) {
      dp[i][2] = (dp[i + 2][2] | dp[i + 2][3]);
    } else {
      dp[i][2] = dp[i + 2][3];
    }
    if (s.substr(i, 3) != s.substr(i + 3, 3)) {
      dp[i][3] = (dp[i + 3][2] | dp[i + 3][3]);
    } else {
      dp[i][3] = dp[i + 3][2];
    }
  }
  set<string> S;
  for (int i = 5; i < n; i++) {
    if (dp[i][2]) S.insert(s.substr(i, 2));
    if (dp[i][3]) S.insert(s.substr(i, 3));
  }
  k = S.size();
  cout << k << endl;
  for (auto str : S) {
    cout << str << endl;
  }
  return 0;
}
