#include <bits/stdc++.h>
using namespace std;
set<string> poss;
string s;
int dp[10001][4];
int vis[10001][4];
int solve(int idx, int len) {
  if (dp[idx][len] != -1) return dp[idx][len];
  int &ret = dp[idx][len];
  if (idx >= 4)
    ret = 1;
  else
    return 0;
  if (len != 3) ret |= solve(idx - 3, 3);
  if (len != 2) ret |= solve(idx - 2, 2);
  if (len == 2) {
    int v = solve(idx - 2, 2);
    int m = 0;
    for (int i = 0; i < 2; i++)
      if (s[idx - 1 + i] != s[idx + 1 + i]) m = 1;
    v &= m;
    ret |= v;
  }
  if (len == 3) {
    int v = solve(idx - 3, 3);
    int m = 0;
    for (int i = 0; i < 3; i++)
      if (s[idx - 2 + i] != s[idx + 1 + i]) m = 1;
    v &= m;
    ret |= v;
  }
  return ret;
}
string F(int i, int j) {
  string ret = "";
  while (j--) {
    ret += s[i];
    i += 1;
  }
  return ret;
}
void trace(int idx, int len) {
  if (vis[idx][len]) return;
  if (idx <= 4) return;
  vis[idx][len] = 1;
  int lenTwo = 0, lenThree = 0;
  if (len != 3) lenThree |= solve(idx - 3, 3);
  if (len != 2) lenTwo |= solve(idx - 2, 2);
  if (len == 2 && !lenTwo) {
    int v = solve(idx - 2, 2);
    int m = 0;
    for (int i = 0; i < 2; i++)
      if (s[idx - 1 + i] != s[idx + 1 + i]) m = 1;
    v &= m;
    lenTwo |= v;
  }
  if (len == 3 && !lenThree) {
    int v = solve(idx - 3, 3);
    int m = 0;
    for (int i = 0; i < 3; i++)
      if (s[idx - 2 + i] != s[idx + 1 + i]) m = 1;
    v &= m;
    lenThree |= v;
  }
  if (lenTwo) {
    poss.insert(F(idx - 1, 2));
    trace(idx - 2, 2);
  }
  if (lenThree) {
    poss.insert(F(idx - 2, 3));
    trace(idx - 3, 3);
  }
}
int main() {
  cin >> s;
  memset(dp, -1, sizeof(dp));
  solve((int)s.size() - 1, 0);
  trace((int)s.size() - 1, 0);
  cout << (int)poss.size() << endl;
  for (auto str : poss) cout << str << endl;
  return 0;
}
