#include <bits/stdc++.h>
using namespace std;
char s[200007];
char t[200007];
int main() {
  scanf("%s", s);
  int len = strlen(s);
  int cnt = 1;
  int k = 0, tmp = 1;
  bool mak = 0;
  t[k++] = s[0];
  for (int i = 0; i < len - 1; i++) {
    if (s[i] == s[i + 1]) {
      if (tmp < 2 && cnt < 2) {
        t[k++] = s[i];
      } else if (tmp >= 2)
        mak = 1;
      cnt++;
    } else {
      if (mak) {
        tmp = 1;
        mak = 0;
      } else
        tmp = cnt;
      t[k++] = s[i + 1];
      cnt = 1;
    }
  }
  printf("%s\n", t);
  return 0;
}
