#include <bits/stdc++.h>
using namespace std;
int len;
string s;
bool f2[10010], f3[10010];
vector<string> res;
bool diff(int x1, int y1, int x2, int y2) {
  for (int i = x1, j = x2; i <= y1, j <= y2; i++, j++)
    if (s[i] != s[j]) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  memset(f2, false, sizeof(f2));
  memset(f3, false, sizeof(f3));
  cin >> s;
  len = s.size();
  f2[len] = f3[len] = true;
  for (int i = len - 1; i > 4; i--) {
    if (len - i >= 2)
      f2[i] = f3[i + 2] || f2[i + 2] && diff(i, i + 1, i + 2, i + 3);
    if (len - i >= 3)
      f3[i] = f2[i + 3] || f3[i + 3] && diff(i, i + 2, i + 3, i + 5);
    if (f2[i]) res.push_back(s.substr(i, 2));
    if (f3[i]) res.push_back(s.substr(i, 3));
  }
  if (res.size() == 0)
    cout << 0;
  else {
    sort(res.begin(), res.end());
    int j = 0;
    for (int i = 1; i < (int)res.size(); i++) {
      if (res[i] != res[j]) {
        j++;
        res[j] = res[i];
      }
    }
    res.resize(j + 1);
    cout << res.size() << '\n';
    for (auto s : res) cout << s << '\n';
  }
}
