#include <bits/stdc++.h>
using namespace std;
const double eps = 0.000000000000001;
string convertstring(long long n) {
  stringstream ss;
  ss << n;
  return ss.str();
}
int len, dp[10005][4];
string s;
int solve(int ind, int last) {
  if (ind == len) return dp[ind][last] = 1;
  int &ans = dp[ind][last];
  if (ans != -1) return ans;
  ans = 0;
  if (last == 0) {
    if (ind + 2 <= len) ans |= solve(ind + 2, 2);
    if (ind + 3 <= len) ans |= solve(ind + 3, 3);
  } else if (last == 3 && ind + 2 <= len) {
    ans |= solve(ind + 2, 2);
    if (ind + 3 <= len) {
      int i;
      for (i = ind - 3; i < ind; ++i)
        if (s[i] != s[i + 3]) break;
      if (i != ind) ans |= solve(ind + 3, 3);
    }
  } else if (last == 2 && ind + 2 <= len) {
    if (ind + 3 <= len) ans |= solve(ind + 3, 3);
    int i;
    for (i = ind - 2; i < ind; ++i)
      if (s[i] != s[i + 2]) break;
    if (i != ind) ans |= solve(ind + 2, 2);
  }
  return ans;
}
vector<string> v;
int main() {
  memset(dp, -1, sizeof(dp));
  ;
  cin >> s;
  len = s.size();
  int i;
  for (i = 5; i < len; ++i) {
    solve(i, 0);
    if (dp[i][2] == 1) v.push_back(s.substr(i - 2, 2));
    if (dp[i][3] == 1) v.push_back(s.substr(i - 3, 3));
  }
  if (dp[i][2] == 1) v.push_back(s.substr(i - 2, 2));
  if (dp[i][3] == 1) v.push_back(s.substr(i - 3, 3));
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  cout << v.size() << endl;
  for (i = 0; i < v.size(); ++i) cout << v[i] << endl;
  return 0;
}
