#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s, tmp1, tmp2;
  cin >> s;
  long long ans = 0;
  long long i = 0, j = 0;
  tmp1.push_back(s[0]);
  while (s[i] != '\0') {
    while (s[i] != '\0') {
      j = i + 1;
      if (s[j] != ' ') {
        tmp2.push_back(s[j]);
      }
      if (tmp1 != tmp2) {
        ans += 1;
        cout << tmp1 << " " << tmp2 << endl;
        i += tmp2.size();
        tmp1 = tmp2;
        tmp2.clear();
        break;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
