#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  if (s.size() == 1) {
    cout << 0 << endl;
    return 0;
  }
  vector<string> svec(1, s);
  int cnt = 0;
  while (svec.size() == 1 ||
         svec.at(svec.size() - 1) != svec.at(svec.size() - 2)) {
    string t;
    for (int i = 0; i < svec.at(svec.size() - 1).size() - 1; i++) {
      if (svec.at(svec.size() - 1).at(i) !=
          svec.at(svec.size() - 1).at(i + 1)) {
        cnt += 2;
        if (i == svec.at(svec.size() - 1).size() - 3)
          t.push_back(svec.at(svec.size() - 1).at(i + 2));
        i++;
        continue;
      }
      t.push_back(svec.at(svec.size() - 1).at(i));
      if (i == svec.at(svec.size() - 1).size() - 2)
        t.push_back(svec.at(svec.size() - 1).at(i + 1));
    }
    if (t.size() == 0) break;
    svec.push_back(t);
  }
  cout << cnt << endl;
  cout << svec.at(1) << endl;
}
