#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s, t;
  cin >> s;
  t.push_back(s[0]);
  long long pre = 1, c = 1;
  for (long long i = 1; i < s.size(); i++) {
    if (s[i] == s[i - 1]) {
      c++;
      if (c == 2 && pre == 1) {
        t.push_back(s[i]);
      } else {
        c--;
      }
    } else {
      pre = c;
      c = 1;
      t.push_back(s[i]);
    }
  }
  cout << t;
  return 0;
}
