#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b) {
  if (b == 0) {
    return 1;
  } else if (b % 2 == 0) {
    long long x = power(a, b / 2);
    return (x * x) % 1000000007;
  } else {
    return (a * power(a, b - 1)) % 1000000007;
  }
}
int main() {
  string str;
  cin >> str;
  int n = str.length();
  char ret[n + 1];
  int pos = 0;
  string new_str;
  int ind = 0;
  while (ind < n) {
    int init = ind, count = 0;
    while (ind < n && str[ind] == str[init]) {
      count++;
      ind++;
    }
    ret[pos++] = str[init];
    if (count > 1) {
      ret[pos++] = str[init];
    }
  }
  ret[pos] = '\0';
  str = (string)ret;
  string ans;
  ind = 0;
  pos = 0;
  int lev = 0;
  n = str.length();
  while (ind < n) {
    if (ind < n - 1 && str[ind + 1] == str[ind]) {
      if (lev == 0) {
        ret[pos++] = str[ind];
        ret[pos++] = str[ind];
      } else {
        ret[pos++] = str[ind];
      }
      ind = ind + 2;
      lev = (lev + 1) % 2;
    } else {
      ret[pos++] = str[ind];
      lev = 0;
      ind++;
    }
  }
  ret[pos] = '\0';
  ans = (string)ret;
  cout << ans << "\n";
  return 0;
}
