#include <bits/stdc++.h>
using namespace std;
template <class T>
bool setmax(T &_a, T _b) {
  if (_b > _a) {
    _a = _b;
    return true;
  }
  return false;
}
template <class T>
bool setmin(T &_a, T _b) {
  if (_b < _a) {
    _a = _b;
    return true;
  }
  return false;
}
template <class T>
T gcd(T _a, T _b) {
  return _b == 0 ? _a : gcd(_b, _a % _b);
}
char s[10010];
int n;
string os[10010][4];
bool ok[10010][4];
int main() {
  scanf("%s", s + 1);
  n = int(strlen(s + 1));
  for (int i = int(1); i <= int(n); ++i)
    for (int c = int(2); c <= int(3); ++c) {
      os[i][2] = string() + s[i] + s[i + 1];
      os[i][3] = os[i][2] + s[i + 2];
    }
  memset(ok, false, sizeof(ok));
  if (n - 1 >= 6) ok[n - 1][2] = true;
  if (n - 2 >= 6) ok[n - 2][3] = true;
  for (int i = int(n - 1); i >= int(1); --i)
    for (int c = int(2); c <= int(3); ++c)
      if (ok[i][c]) {
        if (i - 2 >= 6 && os[i - 2][2] != os[i][c]) ok[i - 2][2] = true;
        if (i - 3 >= 6 && os[i - 3][3] != os[i][c]) ok[i - 3][3] = true;
      }
  set<string> p;
  for (int i = int(1); i <= int(n); ++i)
    for (int c = int(2); c <= int(3); ++c)
      if (ok[i][c]) p.insert(os[i][c]);
  printf("%d\n", int(p.size()));
  for (const auto &str : p) printf("%s\n", str.c_str());
  return 0;
}
