#include <bits/stdc++.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
string s;
void check() {
  if (s.size() < 3) return;
  if (s.back() == s[s.size() - 2] && s.back() == s[s.size() - 3]) s.pop_back();
  if (s.size() < 4) return;
  if (s.back() == s[s.size() - 2] && s[s.size() - 3] == s[s.size() - 4])
    s.pop_back();
}
int32_t main() {
  char ch;
  while (cin >> ch) {
    s += ch;
    check();
  }
  cout << s;
  return 0;
}
