#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
char s[N];
int num[N];
int main() {
  scanf("%s", s);
  int len = strlen(s), p = 0;
  for (int i = 0; i < len; i++) {
    num[i] = 1;
    if (s[i] != s[i + 1])
      s[p++] = s[i];
    else
      num[p]++;
  }
  for (int i = 0; i < p; i++)
    if (num[i] > 2) num[i] = 2;
  for (int i = 0, j = 1; j < p; i++, j++) {
    if (num[i] == 2 && num[j] == 2) {
      num[j] = 1;
    }
  }
  for (int i = 0; i < p; i++) {
    while (num[i]--) cout << s[i];
  }
}
