#include <bits/stdc++.h>
using namespace std;
int i, j, k;
void A();
void B();
void C();
void D();
void E();
int main() {
  C();
  return 0;
}
string three(string s) {
  string p = "";
  int i = 1, n = (int)s.size();
  while (i <= n) {
    int cnt = 1;
    while (i < n && s[i] == s[i - 1]) i++, cnt++;
    p += s[i - 1];
    if (cnt > 1) p += s[i - 1];
    i++;
  }
  return p;
}
string two(string s) {
  string p = "";
  int i = 3, n = (int)s.size(), k = 0;
  if (n < 4) return s;
  while (i < n) {
    p += s[k = i - 3];
    if (s[i] == s[i - 1] && s[i - 2] == s[i - 3]) {
      p += s[i - 2];
      p += s[(k = i) - 1];
      i += 4;
    } else
      i++;
  }
  if (i != n + 3)
    while (++k < n) p += s[k];
  return p;
}
void C() {
  string s;
  cin >> s;
  cout << two(three(s)) << endl;
}
