#include <bits/stdc++.h>
using namespace std;
set<string> set_;
string s;
int visit[5][5][10005];
void dfs(int p, int l, string sum, string mem) {
  if (l > 3 || p == 4) return;
  string now = s[p] + sum;
  if (l == 1) {
    dfs(p - 1, l + 1, now, mem);
    return;
  }
  if (visit[sum.length()][mem.length()][p]) return;
  visit[sum.length()][mem.length()][p] = 1;
  if (l == 2) dfs(p - 1, l + 1, now, mem);
  if (now != mem) {
    set_.insert(now);
    dfs(p - 1, 1, "", now);
  }
}
int main() {
  cin >> s;
  int len = s.length();
  memset(visit, 0, sizeof(visit));
  dfs(len - 1, 1, "", "");
  cout << set_.size() << endl;
  for (auto &x : set_) cout << x << endl;
}
