#include <bits/stdc++.h>
using namespace std;
int dp[10010][5];
int n;
string s;
int solve(int pos, int lastJump) {
  if (dp[pos][lastJump] != -1) return dp[pos][lastJump];
  if (pos >= n) return 0;
  if (pos == (n - 1)) {
    dp[pos][lastJump] = 1;
    return 1;
  }
  if (pos > 3) {
    int x = 0;
    if (lastJump == 0) {
      x = x | solve(pos + 1, 0);
      x = x | solve(pos + 2, 2);
      x = x | solve(pos + 3, 3);
    } else {
      if ((pos + 2) < n) {
        if (lastJump == 3 || s[pos - 1] != s[pos + 1] || s[pos] != s[pos + 2])
          x = x | solve(pos + 2, 2);
      }
      if ((pos + 3) < n) {
        if (lastJump == 2 || s[pos - 2] != s[pos + 1] ||
            s[pos - 1] != s[pos + 2] || s[pos] != s[pos + 3])
          x = x | solve(pos + 3, 3);
      }
    }
    if (x == 1) {
      dp[pos][lastJump] = 1;
      return 1;
    } else {
      dp[pos][lastJump] = 0;
      return 0;
    }
  }
  int x = solve(pos + 1, lastJump);
  dp[pos][lastJump] = x;
  return x;
}
int main() {
  cin >> s;
  memset(dp, -1, sizeof(dp));
  n = s.length();
  int poss = solve(0, 0);
  if (poss == 0) {
    cout << 0 << endl;
    return 0;
  }
  vector<string> ans;
  for (int i = (n - 1); i >= 5; i--) {
    if (dp[i][2] == 1) {
      string temp;
      temp.push_back(s[i - 1]);
      temp.push_back(s[i]);
      ans.push_back(temp);
    }
    if (dp[i][3] == 1) {
      string temp;
      temp.push_back(s[i - 2]);
      temp.push_back(s[i - 1]);
      temp.push_back(s[i]);
      ans.push_back(temp);
    }
  }
  sort(ans.begin(), ans.end());
  set<string> final;
  for (int i = 0; i < ans.size(); i++) {
    final.insert(ans[i]);
  }
  cout << final.size() << endl;
  for (set<string>::iterator it = final.begin(); it != final.end(); ++it) {
    cout << *it << endl;
  }
  return 0;
}
