#include <bits/stdc++.h>
using namespace std;
int const N = 2e5 + 5, M = 1e6 + 5, OO = 0x3f3f3f3f, MOD = 1e9 + 7;
int n, t1, t2;
string s, ts;
bool del[N];
int main() {
  cin >> s;
  n = s.size();
  for (int i = 1; i < n; i++) {
    if (del[i]) continue;
    if (s[i] == s[i - 1]) {
      for (int j = i + 1; j < n; j++) {
        if (s[i] == s[j])
          del[j] = 1;
        else {
          i = j - 1;
          break;
        }
      }
    }
  }
  for (int i = 0; i < n; i++)
    if (!del[i]) ts += s[i];
  n = ts.size();
  memset(del, 0, sizeof del);
  for (int i = 1; i < n; i++) {
    if (del[i]) continue;
    if (ts[i] == ts[i - 1]) {
      if (i + 2 < n && ts[i + 1] == ts[i + 2]) {
        del[i + 2] = 1;
        i = i + 2;
      }
    }
  }
  for (int i = 0; i < n; i++)
    if (!del[i]) printf("%c", ts[i]);
  return 0;
}
