#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int maxn = 1e4 + 5;
string s;
bool dp[maxn][2], two[200][200], three[200][200][200];
int cnt = 0;
void mark(int i, int j) {
  if (j - i + 1 == 2) {
    cnt += two[s[i]][s[i + 1]] ^ 1;
    two[s[i]][s[i + 1]] = true;
  }
  if (j - i + 1 == 3) {
    cnt += three[s[i]][s[i + 1]][s[i + 2]] ^ 1;
    three[s[i]][s[i + 1]][s[i + 2]] = true;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  int n = s.size();
  s += "####";
  dp[n][0] = dp[n][1] = true;
  for (int i = n - 2; i >= 5; i--) {
    dp[i][0] =
        (dp[i + 2][0] && s.substr(i, 2) != s.substr(i + 2, 2)) || dp[i + 2][1];
    dp[i][1] =
        (dp[i + 3][1] && s.substr(i, 3) != s.substr(i + 3, 3)) || dp[i + 3][0];
    if (dp[i][0]) mark(i, i + 1);
    if (dp[i][1]) mark(i, i + 2);
  }
  printf("%d\n", cnt);
  for (char i = 'a'; i <= 'z'; i++) {
    for (char j = 'a'; j <= 'z'; j++) {
      if (two[i][j]) printf("%c%c\n", i, j);
      for (int k = 'a'; k <= 'z'; k++) {
        if (three[i][j][k]) printf("%c%c%c\n", i, j, k);
      }
    }
  }
  return 0;
}
