#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 10;
vector<string> ans;
vector<int> dp2[N + 2];
auto dp = dp2 + 1;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  for (int i = 0; i <= N; ++i) dp2[i] = vector<int>(4, 0);
  for (int i = 5; i < s.length(); ++i) {
    for (int j = 2; j <= 3; ++j) {
      if (i + j > s.length()) break;
      string t = s.substr(i, j);
      for (int z = i - 1; z < s.length(); ++z) dp[z][3] = 0, dp[z][2] = 0;
      dp[i][j] = 1;
      if (i + j == s.length()) {
        ans.push_back(t);
        continue;
      }
      for (int z = i + j; z < s.length(); ++z) {
        if (z + 1 < s.length()) {
          dp[z][2] = dp[z - 3][3];
          if (s[z] != s[z - 2] || s[z + 1] != s[z - 1])
            dp[z][2] |= dp[z - 2][2];
          if (z + 2 < s.length()) {
            dp[z][3] = dp[z - 2][2];
            if (z >= 3)
              if (s[z + 2] != s[z - 1] || s[z] != s[z - 3] ||
                  s[z + 1] != s[z - 2])
                dp[z][3] |= dp[z - 3][3];
          }
        }
      }
      if (dp[s.length() - 3][3] || dp[s.length() - 2][2]) ans.push_back(t);
    }
  }
  sort(ans.begin(), ans.end());
  ans.resize(unique(ans.begin(), ans.end()) - ans.begin());
  cout << ans.size() << "\n";
  for (auto x : ans) cout << x << "\n";
  return 0;
}
