#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <class T>
inline bool Min(T &a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
inline bool Max(T &a, T b) {
  return a < b ? (a = b, true) : false;
}
inline int ni() {
  int a;
  scanf("%d", &a);
  return a;
}
inline ll nl() {
  ll a;
  scanf("%lld", &a);
  return a;
}
inline double nd() {
  double a;
  scanf("%lf", &a);
  return a;
}
inline void pi(int a) { printf("%d ", a); }
inline void pl(ll a) { printf("%lld ", a); }
inline void pd(double a) { printf("%.12lf ", a); }
const int N = 1e4 + 10;
int can[N][5];
bool comp(string &s, int i, int j, int len) {
  if (i + len > s.size() or j + len > s.size()) return false;
  for (int p = 0; p < len; i++, j++, p++)
    if (s[i] != s[j]) return false;
  return true;
}
void solve() {
  string s;
  cin >> s;
  vector<string> a;
  for (int i = 0; i < (int)(N); ++i)
    for (int j = 0; j < (int)(5); ++j) can[i][j] = false;
  can[s.size()][2] = can[s.size()][3] = true;
  for (int i = int(s.size()) - 1; i >= 5; i--) {
    for (int j = 2; j <= 3; j++) {
      if (i + j > s.size()) continue;
      if (i + j < s.size() and i + j + 2 > s.size()) continue;
      if (comp(s, i, i + j, j)) {
        if (can[i + j][(j == 2 ? 3 : 2)]) {
          a.push_back(s.substr(i, j));
          can[i][j] = true;
        }
      } else {
        if (can[i + j][2] or can[i + j][3]) {
          can[i][j] = true;
          a.push_back(s.substr(i, j));
        }
      }
    }
  }
  sort((a).begin(), (a).end());
  a.resize(unique((a).begin(), (a).end()) - a.begin());
  printf("%d\n", int(a.size()));
  for (int i = 0; i < (int)(a.size()); ++i) puts(a[i].c_str());
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  srand((int)clock());
  solve();
  return 0;
}
