#include <bits/stdc++.h>
const long long INF = 1e18;
using namespace std;
void SOE(long long n) {
  bool isPrime[n + 1];
  memset(isPrime, true, sizeof(isPrime));
  for (long long p = 2; p <= n; p++) {
    if (isPrime[p]) {
      for (long long i = p * p; i <= n; i += p) isPrime[i] = false;
    }
  }
}
long long POWER(long long base, long long expo) {
  long long num = 1;
  long long i = expo;
  while (i) {
    num = num * base;
    i--;
  }
  return num;
}
int main() {
  long long t = 1;
  while (t--) {
    string s;
    cin >> s;
    vector<long long> v;
    vector<char> ans;
    long long cnt = 1;
    for (long long i = 1; i < s.length(); i++) {
      if (s[i] == s[i - 1])
        cnt++;
      else {
        ans.push_back(s[i - 1]);
        v.push_back(cnt);
        cnt = 1;
      }
    }
    v.push_back(cnt);
    ans.push_back(s[s.length() - 1]);
    for (long long i = 0; i < v.size(); i++) {
      if (v[i] >= 2) {
        v[i] = 2;
        if (i > 0 && v[i - 1] == 2) v[i]--;
      }
    }
    for (long long i = 0; i < ans.size(); i++) {
      for (long long j = 1; j <= v[i]; j++) cout << ans[i];
    }
  }
  return 0;
}
