#include <bits/stdc++.h>
using namespace std;
bool f1(pair<long long, long long> x, pair<long long, long long> y) {
  return x.first > y.first;
}
bool f2(pair<long long, long long> x, pair<long long, long long> y) {
  return x.second > y.second;
}
bool f3(long long x, long long y) { return x > y; }
bool fa(vector<long long> x, vector<long long> y) { return x[0] < y[0]; }
long long fac(long long a) {
  if (a == 1 || a == 0) {
    return 1;
  } else {
    return (a * fac(a - 1));
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string a;
  cin >> a;
  vector<long long> b;
  if (a.size() == 1) {
    cout << a;
    exit(0);
  }
  a = a + '0';
  for (long long i = 0; i < a.size() - 1; i++) {
    if (a[i] == a[i + 1] && a[i] == a[i + 2]) {
      a[i] = '0';
    }
  }
  for (long long i = 0; i < a.size(); i++) {
    if (a[i] != '0') b.push_back(a[i]);
  }
  vector<long long> c;
  long long check = 0;
  for (long long i = 0; i < b.size() - 1; i++) {
    if (b[i] == b[i + 1]) {
      c.push_back(i);
      check++;
    }
  }
  if (check > 0) {
    for (long long i = 0; i < c.size() - 1; i++) {
      if (c[i] == c[i + 1] - 2) {
        b[c[i + 1]] = 0;
        i++;
      }
    }
  }
  for (long long i = 0; i < b.size(); i++) {
    if (b[i] != 0) {
      char g = b[i];
      cout << g;
    }
  }
  return 0;
}
