#include <bits/stdc++.h>
using namespace std;
char s[200005];
char ans[200005];
int main() {
  int i, j;
  scanf("%s", s);
  int x = strlen(s);
  int rep = 1, typo2 = 0;
  ans[0] = s[0];
  for (i = 1, j = 1; i < x; i++) {
    if (s[i] == s[i - 1]) {
      rep++;
      if (rep == 2) {
        if (!typo2) {
          typo2 = 1;
          ans[j++] = s[i];
        }
      } else if (rep == 1) {
        ans[j++] = s[i];
      }
    } else {
      ans[j++] = s[i];
      rep = 1;
      if (typo2) {
        if (ans[j - 2] != ans[j - 3]) typo2 = 0;
      }
    }
  }
  ans[j] = '\0';
  printf("%s\n", ans);
  return 0;
}
