#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  string ptr;
  if (str.size() <= 2) {
    cout << str;
    return 0;
  }
  ptr = ptr + str[0];
  ptr = ptr + str[1];
  long long int i = 2;
  while ((ptr.size() == 2) && (i != (str.size() - 1))) {
    if ((str[i] != ptr[0]) || (str[i] != ptr[1])) ptr += str[i];
    i++;
  }
  for (; i < str.size(); i++) {
    long long int t = ptr.size() - 1;
    if (str[i] != ptr[t])
      ptr += str[i];
    else {
      if ((ptr[t] != ptr[t - 1]) && (ptr[t - 1] != ptr[t - 2])) ptr += str[i];
    }
  }
  cout << ptr;
  return 0;
}
