#include <bits/stdc++.h>
using namespace std;
int max_ch(int a, int b) { return a < b ? b : a; }
int my_search(std::string str, int cnt, bool ch) {}
int main() {
  string str;
  cin >> str;
  int n = str.length();
  bool ch = true;
  int cnt = 0;
  while (ch) {
    ch = false;
    for (int i = 0; i < n; ++i) {
      if (str[i] == ' ') {
        continue;
      }
      int check = i + 1;
      while (str[check] == ' ' && check < n) {
        ++check;
      }
      if (check >= n) {
        continue;
      }
      if (str[check] == str[i]) {
        i = check;
        ++check;
        while (check < n && str[check] == ' ') {
          ++check;
        }
        if (check >= n) {
          continue;
        }
        if (str[i] != str[check]) {
          str[i] = ' ';
          str[check] = ' ';
          i = check + 1;
          ch = true;
          cnt += 2;
        } else {
          i = check - 1;
        }
      } else {
        i = check - 1;
      }
    }
  }
  cout << str << endl;
  cout << cnt << endl;
  do {
    ch = false;
    for (int i = 0; i < n; ++i) {
      if (str[i] == ' ') {
        continue;
      };
      int check = i + 1;
      while (check < n && str[check] == ' ') {
        ++check;
      }
      if (check >= n) {
        continue;
      }
      if (str[check] != str[i] && str[check] != ' ') {
        str[i] = ' ';
        str[check] = ' ';
        cnt += 2;
        ch = true;
        i = check + 1;
      } else {
        i = check - 1;
      }
      cout << str << endl;
      cout << cnt << endl;
    }
  } while (ch);
  cout << str << endl;
  cout << cnt << endl;
}
