#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
int main() {
  fast();
  string s;
  cin >> s;
  long long i, n;
  n = s.length();
  long long c = 1;
  char p = s[0];
  for (i = 1; i < n; i++) {
    if (s[i] != p) {
      c = 1;
      p = s[i];
    } else {
      c++;
      if (c > 2) {
        s[i] = ' ';
        c = 2;
      }
    }
  }
  string rev = "";
  for (i = 0; i < n; i++) {
    if (s[i] != ' ') {
      rev += s[i];
    }
  }
  n = rev.length();
  string fin = "";
  long long prev_c = 0;
  c = 1;
  for (i = 1; i < n; i++) {
    if (rev[i] != rev[i - 1]) {
      prev_c = c;
      c = 1;
    } else {
      c++;
      if (c == 2 && prev_c == 2) {
        c = 1;
        rev[i] = ' ';
      }
    }
  }
  for (i = 0; i < n; i++) {
    if (rev[i] != ' ') fin += rev[i];
  }
  cout << fin << endl;
  return 0;
}
