#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const int inf = 1e9;
string s;
int n;
bool dp[maxn][3];
string substr(int l, int r) {
  string ans;
  for (int i = l; i < r; i++) {
    ans += s[i];
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> s;
  n = s.length();
  s += "AAAAAA";
  dp[n][0] = dp[n][1] = dp[n][2] = true;
  for (int i = n - 1; i >= 0; i--) {
    bool res1, res2;
    if (substr(i, i + 2) == substr(i + 2, i + 4)) {
      res1 = dp[i + 2][1];
    } else {
      res1 = dp[i + 2][2];
    }
    if (substr(i, i + 3) == substr(i + 3, i + 6)) {
      res2 = dp[i + 3][0];
    } else {
      res2 = dp[i + 3][2];
    }
    dp[i][0] = res1;
    dp[i][1] = res2;
    dp[i][2] = res1 | res2;
  }
  vector<string> ans;
  for (int i = 5; i < n; i++) {
    if (substr(i, i + 2) == substr(i + 2, i + 4) && dp[i + 2][1] ||
        dp[i + 2][2]) {
      ans.push_back(substr(i, i + 2));
    }
    if (s.substr(i, i + 3) == substr(i + 3, i + 6) && dp[i + 3][0] ||
        dp[i + 3][2]) {
      ans.push_back(substr(i, i + 3));
    }
  }
  sort(ans.begin(), ans.end());
  ans.resize(unique(ans.begin(), ans.end()) - ans.begin());
  cout << ans.size() << '\n';
  for (auto t : ans) {
    cout << t << '\n';
  }
}
