#include <bits/stdc++.h>
using namespace std;
int main() {
  char prev = ' ';
  int n = 0, d = 0;
  string in, out = "";
  cin >> in;
  for (int i = 0; i < in.length(); ++i) {
    if (prev == in[i]) {
      n++;
      if (n == 1 && d == 0) {
        out += in[i];
        d = 1;
      } else if (n == 1)
        d = 0;
    } else {
      if (n == 0) d = 0;
      n = 0;
      prev = in[i];
      out += in[i];
    }
  }
  cout << out;
  return 0;
}
