#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  long long t = 0, pos = INT_MAX;
  cin >> s;
  for (long long i = 0; i < s.size() - 1; i++) {
    if (s[i] == s[i + 1])
      t++;
    else
      t = 0;
    if (t > 1) {
      s.erase(i, 1);
      i--;
    }
  }
  for (long long i = 0; i < s.size() - 1; i++) {
    if (s[i] == s[i + 1]) {
      if (i - pos == 2) {
        s.erase(i, 1);
        pos = 0;
      } else
        pos = i;
    }
  }
  cout << s;
}
