#include <bits/stdc++.h>
using namespace std;
enum State { NORMAL, DOUBLE, DOUBLE_PLUS };
string fix_typos(const string &s) {
  State state = NORMAL;
  string ret;
  char last_c = 0;
  for (int i = 0; i < s.size(); ++i) {
    switch (state) {
      case NORMAL:
        ret += s[i];
        if (last_c == s[i]) {
          state = DOUBLE;
        } else {
          last_c = s[i];
        }
        break;
      case DOUBLE:
        if (last_c == s[i]) {
          break;
        }
        ret += s[i];
        state = DOUBLE_PLUS;
        last_c = s[i];
        break;
      case DOUBLE_PLUS:
        if (last_c == s[i]) {
          break;
        }
        ret += s[i];
        state = NORMAL;
        last_c = s[i];
        break;
      default:
        break;
    }
  }
  return ret;
}
int main() {
  string s;
  cin >> s;
  cout << fix_typos(s) << endl;
  return 0;
}
