#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  s += "0";
  int c = 1;
  char sc = s[0];
  bool xd = false;
  string res = "";
  for (int i = 1; i < s.size(); i++) {
    if (sc != s[i]) {
      if (c == 1) {
        res += sc;
        xd = false;
      } else if (c >= 2 && xd) {
        xd = false;
        res += sc;
      } else {
        xd = true;
        res += sc;
        res += sc;
      }
      c = 1;
      sc = s[i];
    } else
      c++;
  }
  cout << res << endl;
  return 0;
}
