#include <bits/stdc++.h>
using namespace std;
int e;
string s;
vector<char> a;
int main() {
  cin >> s;
  e = s.length();
  bool w;
  w = false;
  for (int i = 0; i < e; i++) {
    if (i == 0) {
      a.push_back(s[i]);
      continue;
    }
    if (s[i] == a[a.size() - 1]) {
      if (!w) {
        w = true;
        a.push_back(s[i]);
      }
    } else {
      if (w && (a.back() != a[a.size() - 2])) {
        w = false;
      }
      a.push_back(s[i]);
    }
  }
  for (int i = 0; i < a.size(); i++) cout << a[i];
}
