#include <bits/stdc++.h>
using namespace std;
template <typename Tp>
inline void read(Tp &x) {
  static char c;
  static bool neg;
  x = 0, c = getchar(), neg = false;
  for (; !isdigit(c); c = getchar()) {
    if (c == '-') {
      neg = true;
    }
  }
  for (; isdigit(c); c = getchar()) {
    x = x * 10 + c - '0';
  }
  if (neg) {
    x = -x;
  }
}
const int N = 1e4 + 5;
string str, temp;
int n;
bool vis[N];
vector<string> vec;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  cin >> str;
  if (str.length() == 5UL) {
    puts("0");
    return 0;
  }
  str = str.substr(5);
  n = (int)str.length();
  vis[n] = true;
  for (int i = n - 1; i >= 0; --i) {
    for (int len = 2; len <= 3; ++len) {
      if (i + len <= n) {
        temp = str.substr(i, len);
        if (((int)str.find(temp, i + len) != i + len || vis[i + 5]) &&
            vis[i + len]) {
          vec.emplace_back(temp);
          vis[i] = true;
        }
      }
    }
  }
  sort(vec.begin(), vec.end());
  vec.erase(unique(vec.begin(), vec.end()), vec.end());
  cout << vec.size() << "\n";
  for (const auto &s : vec) {
    cout << s << "\n";
  }
}
