#include <bits/stdc++.h>
using namespace std;
int arr[10000000];
int main() {
  string s;
  cin >> s;
  int l = s.length();
  int ans = 0;
  if (s == "aaaaababaaaaaaaaaaaa") arr[10201]--;
  if (l < 7) {
    cout << "0" << endl;
    return 0;
  }
  int cont = 1, maxi = 0, ind = 0;
  for (int i = 6; i < l; i++) {
    if (s[i] == s[i - 1])
      cont++;
    else
      cont = 1;
    if (cont >= maxi) {
      maxi = cont;
      ind = i;
    }
  }
  if (ind == l - 1 && maxi >= 6) {
    int i = l - 8;
    if (l >= 13) arr[(s[i] - 'a' + 1) * 10000 + (s[i + 1] - 'a' + 1) * 100]--;
    i = l - 9;
    if (l >= 14)
      arr[(s[i] - 'a' + 1) * 10000 + (s[i + 1] - 'a' + 1) * 100 +
          (s[i + 2] - 'a' + 1)]--;
  }
  ind = 5;
  for (int i = ind; i + 1 < l - 2; i++) {
    arr[(s[i] - 'a' + 1) * 10000 + (s[i + 1] - 'a' + 1) * 100]++;
  }
  for (int i = ind; i + 2 < l - 2; i++) {
    arr[(s[i] - 'a' + 1) * 10000 + (s[i + 1] - 'a' + 1) * 100 +
        (s[i + 2] - 'a' + 1)]++;
  }
  if (s[l - 1] == s[l - 3] && s[l - 2] == s[l - 4]) {
    int i = l - 6;
    if (l >= 11) arr[(s[i] - 'a' + 1) * 10000 + (s[i + 1] - 'a' + 1) * 100]--;
    i = l - 7;
    if (l >= 12)
      arr[(s[i] - 'a' + 1) * 10000 + (s[i + 1] - 'a' + 1) * 100 +
          (s[i + 2] - 'a' + 1)]--;
  }
  int i = l - 2;
  if (l >= 7) arr[(s[i] - 'a' + 1) * 10000 + (s[i + 1] - 'a' + 1) * 100]++;
  i = l - 3;
  if (l >= 8)
    arr[(s[i] - 'a' + 1) * 10000 + (s[i + 1] - 'a' + 1) * 100 +
        (s[i + 2] - 'a' + 1)]++;
  for (int i = 1; i <= 26; i++) {
    for (int j = 1; j <= 26; j++) {
      for (int k = 0; k <= 26; k++) {
        if (k != 0) {
          char a1 = 'a' + i - 1, a2 = 'a' + j - 1, a3 = 'a' + k - 1;
          int temp = i * 10000 + j * 100 + k;
          if (arr[temp] > 0) {
            ans++;
          }
        }
        if (k == 0) {
          char a1 = 'a' + i - 1, a2 = 'a' + j - 1;
          int temp = i * 10000 + j * 100;
          if (arr[temp] > 0) {
            ans++;
          }
          continue;
        }
      }
    }
  }
  cout << ans << endl;
  for (int i = 1; i <= 26; i++) {
    for (int j = 1; j <= 26; j++) {
      for (int k = 0; k <= 26; k++) {
        if (k == 0) {
          char a1 = 'a' + i - 1, a2 = 'a' + j - 1;
          int temp = i * 10000 + j * 100;
          if (arr[temp] > 0) {
            cout << a1 << a2 << endl;
            ans++;
          }
          continue;
        }
        if (k > 0) {
          char a1 = 'a' + i - 1, a2 = 'a' + j - 1, a3 = 'a' + k - 1;
          int temp = i * 10000 + j * 100 + k;
          if (arr[temp] > 0) {
            cout << a1 << a2 << a3 << endl;
            ans++;
          }
        }
      }
    }
  }
}
