#include <bits/stdc++.h>
using namespace std;
set<string> ans;
int main() {
  int dp[10005][4];
  memset(dp, 0, sizeof(dp));
  string buf, ret;
  cin >> buf;
  int len = buf.length();
  dp[len - 3][3] = 1;
  dp[len - 2][2] = 1;
  for (int i = len - 4; i >= 5; i--) {
    if ((dp[i + 2][2] && !(buf[i] == buf[i + 2] && buf[i + 1] == buf[i + 3])) ||
        dp[i + 2][3])
      dp[i][2] = 1;
    if ((dp[i + 3][3] && !(buf[i] == buf[i + 3] && buf[i + 1] == buf[i + 4] &&
                           buf[i + 2] == buf[i + 5]) ||
         dp[i + 3][2]))
      dp[i][3] = 1;
  }
  for (int i = 5; i < len - 1; i++) {
    if (dp[i][2]) {
      ret = buf.substr(i, 2);
      ans.insert(ret);
    }
    if (dp[i][3]) {
      ret = buf.substr(i, 3);
      ans.insert(ret);
    }
  }
  printf("%d\n", ans.size());
  set<string>::iterator it;
  for (it = ans.begin(); it != ans.end(); ++it) cout << *it << endl;
  return 0;
}
