#include <bits/stdc++.h>
using namespace std;
int main() {
  std::string s;
  cin >> s;
  int i, flag = 1;
  for (i = 0; i < s.length(); i++) {
    int count = 1;
    while (i < s.length() && s[i] == s[i + 1]) {
      count++;
      i++;
    }
    if (count == 1) {
      flag = 1;
      continue;
    }
    if (count > 1) {
      if (flag) {
        s.erase(i - count + 1, count - 2);
        flag = 0;
        i = i - count + 2;
      } else {
        s.erase(i - count + 1, count - 1);
        i = i - count + 1;
        flag = 1;
      }
    }
  }
  cout << s;
  return 0;
}
