#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  getline(cin, s);
  int n = s.length();
  int A[26] = {0};
  int i = n - 1;
  while (i >= 0) {
    if (s[i] == s[i - 1]) {
      if (s[i - 2] == s[i - 3] && i - 3 >= 0) {
        int nn = s.length();
        s.erase(s.begin() + (i - 3));
      } else if (s[i - 2] == s[i]) {
        int nn = s.length();
        s.erase(s.begin() + (i - 2));
      }
    }
    --i;
  }
  cout << s;
  return 0;
}
