#include <bits/stdc++.h>
using namespace std;
int main() {
  char str[200005];
  gets(str);
  vector<char> v;
  if (strlen(str) > 1) {
    v.push_back(str[0]);
    v.push_back(str[1]);
  } else {
    cout << str;
    return 0;
  }
  int l = strlen(str);
  int len;
  for (int i = 2; i < l; i++) {
    len = v.size();
    if (str[i] == v[len - 1] && str[i] == v[len - 2]) continue;
    if (v[len - 3] == v[len - 2] && str[i] == v[len - 1])
      continue;
    else
      v.push_back(str[i]);
  }
  len = v.size();
  for (int i = 0; i < len; i++) printf("%c", v[i]);
  return 0;
}
