#include <bits/stdc++.h>
using namespace std;
long long a[10010], b[10010], c[10010];
long long n, m, k, t, r, aux, rta;
string s, s2;
int dp[10010][4];
vector<string> v;
bool dist(int i, int j, int sz) {
  if (j + sz > n) return true;
  for (int q = 0; q < (sz); q++) {
    if (s[i + q] != s[j + q]) return true;
  }
  return false;
}
int main() {
  while (cin >> s) {
    n = ((int)s.size());
    dp[n][2] = 1;
    dp[n][3] = 1;
    dp[n + 1][2] = 0;
    dp[n + 1][3] = 0;
    dp[n + 2][2] = 0;
    dp[n + 2][3] = 0;
    for (int i = n - 1; i >= 0; i--) {
      if (dp[i + 2][3] == 1)
        dp[i][2] = 1;
      else if ((dp[i + 2][2] == 1) && dist(i, i + 2, 2))
        dp[i][2] = 1;
      else
        dp[i][2] = 0;
      if (dp[i + 3][2] == 1)
        dp[i][3] = 1;
      else if ((dp[i + 3][3] == 1) && dist(i, i + 3, 3))
        dp[i][3] = 1;
      else
        dp[i][3] = 0;
    }
    for (int i = 5; i < (n); i++) {
      if (dp[i][2]) {
        s2.resize(2);
        s2[0] = s[i];
        s2[1] = s[i + 1];
        v.push_back(s2);
      }
      if (dp[i][3]) {
        s2.resize(3);
        s2[0] = s[i];
        s2[1] = s[i + 1];
        s2[2] = s[i + 2];
        v.push_back(s2);
      }
    }
    sort(v.begin(), v.end());
    unique(v.begin(), v.end());
    for (int i = 1; i < (((int)v.size())); i++) {
      if (v[i - 1].compare(v[i]) >= 0) {
        v.resize(i);
        break;
      }
    }
    cout << ((int)v.size()) << endl;
    for (int i = 0; i < (((int)v.size())); i++) cout << v[i] << endl;
  }
  return 0;
}
