#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<long long, long long> a, pair<long long, long long> b) {
  return a.second < b.second;
}
void solve() {
  string s;
  cin >> s;
  if (s.size() <= 2) {
    cout << s << '\n';
    return;
  }
  for (int i = 0; i < s.size() - 2; i++) {
    while (s[i] == s[i + 1] && s[i + 1] == s[i + 2]) {
      s.erase(i, 1);
    }
  }
  for (int i = 2; i < s.size(); i++) {
    if (s[i - 2] == s[i - 1]) {
      while (s[i] == s[i + 1]) {
        s.erase(i, 1);
      }
      if (s[i] == s[i - 1]) {
        s.erase(i, 1);
      }
    }
  }
  cout << s << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) solve();
}
