#include <bits/stdc++.h>
using namespace std;
int main() {
  string line, res;
  cin >> line;
  int k = 0;
  for (int i = 0; i < line.length(); ++i) {
    if (i != 0 && i != 1 &&
        (line[i] == res[k - 1] &&
         (line[i] == res[k - 2] || res[k - 3] == res[k - 2]))) {
    } else {
      res += line[i];
      ++k;
    }
  }
  cout << res;
  return 0;
}
