#include <bits/stdc++.h>
using namespace std;
long long N;
char s[200005];
set<string> ans;
long long hashi[200005];
bool vis[200005][2];
bool memo[200005][2];
long long pot[200005];
long long val(long long l, long long r) {
  long long tmp = hashi[r] - (hashi[l - 1] * pot[r - l + 1]);
  tmp %= 1000000007;
  tmp += 1000000007;
  tmp %= 1000000007;
  return tmp;
}
bool dp(long long l, long long f) {
  if (l == N + 1) return true;
  if (l > N) return false;
  if (vis[l][f]) return memo[l][f];
  vis[l][f] = true;
  if (!f) {
    bool ok = false;
    if (l + 2 == N + 1)
      ok = true;
    else if (l + 4 <= N && dp(l + 2, 1))
      ok = true;
    else if (l + 3 <= N && val(l, l + 1) != val(l + 2, l + 3) && dp(l + 2, 0))
      ok = true;
    if (ok) {
      string x = "";
      x += s[l];
      x += s[l + 1];
      ans.insert(x);
      memo[l][f] = true;
    }
  } else {
    bool ok = false;
    if (l + 3 == N + 1)
      ok = true;
    else if (l + 4 <= N && dp(l + 3, 0))
      ok = true;
    else if (l + 5 <= N && val(l, l + 2) != val(l + 3, l + 5) && dp(l + 3, 1))
      ok = true;
    if (ok) {
      string x = "";
      x += s[l];
      x += s[l + 1];
      x += s[l + 2];
      ans.insert(x);
      memo[l][f] = true;
    }
  }
  return memo[l][f];
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> s;
  N = strlen(s);
  for (long long i = N; i >= 1; i--) s[i] = s[i - 1];
  pot[0] = 1;
  for (long long i = 1; i <= N; i++) pot[i] = (pot[i - 1] * 33) % 1000000007;
  for (long long i = 1; i <= N; i++)
    hashi[i] = ((33 * hashi[i - 1]) + (s[i] - 'a' + 1)) % 1000000007;
  for (long long i = 5; i <= N; i++) {
    if (val(1, i) == (val(i + 1, 2 * i))) continue;
    if (N - i < 2) continue;
    dp(i + 1, 0);
    dp(i + 1, 1);
  }
  cout << ans.size() << "\n";
  for (auto v : ans) cout << v << "\n";
  return 0;
}
