#include <bits/stdc++.h>
using namespace std;
set<string> st;
bool dp[10008][4];
int main() {
  string s;
  cin >> s;
  int sz = s.size();
  s += "##";
  dp[sz][2] = dp[sz][3] = true;
  for (int i = sz - 2; i > 4; --i) {
    for (int j = 2; j <= 3; ++j) {
      if ((dp[i + j][j] && s.substr(i, j) != s.substr(i + j, j)) ||
          dp[i + j][5 - j])
        dp[i][j] |= true;
      if (dp[i][j]) st.insert(s.substr(i, j));
    }
  }
  cout << st.size() << "\n";
  for (auto it : st) cout << it << "\n";
}
