#include <bits/stdc++.h>
using namespace std;
char ar[1000000];
int main() {
  char ch;
  string str;
  cin >> str;
  int cnt = 0, j, prev = 0;
  ar[0] = str[0];
  cnt = 1;
  j = 1;
  for (int i = 1; i < str.length(); i++) {
    if (str[i] != str[i - 1]) {
      cnt = 1;
      ar[j++] = str[i];
    } else if (cnt < 2) {
      cnt++;
      ar[j++] = str[i];
    }
  }
  cnt = 0;
  for (int i = 0; i < j; i++) {
    if (prev < 2) {
      cout << ar[i];
      cnt++;
    } else if (prev == 2 && cnt < 1) {
      cout << ar[i];
      cnt++;
    }
    if (i != j && ar[i + 1] != ar[i]) {
      prev = cnt;
      cnt = 0;
    }
  }
  cout << endl;
  return 0;
}
