#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  string s, x;
  cin >> s;
  char l = s[0];
  int cnt = 1;
  x += l;
  for (int i = 1; i < s.size(); i++) {
    if (s[i] == l) {
      cnt++;
      if (cnt == 2) x += l;
    } else {
      l = s[i];
      cnt = 1;
      x += l;
    }
  }
  bool check[x.size()];
  for (int i = 0; i < x.size(); i++) check[i] = 1;
  x += "    ";
  for (int i = 0; i < x.size() - 3; i++) {
    if (x[i] == x[i + 1] && x[i + 2] == x[i + 3]) {
      check[i + 2] = 0;
      i += 2;
    }
  }
  for (int i = 0; i < x.size() - 4; i++) {
    if (check[i] == 1) cout << x[i];
  }
  cout << endl;
  return 0;
}
