#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  vector<char> v1;
  vector<int> v2;
  v1.push_back(s[0]);
  v2.push_back(1);
  int count = 1;
  for (int i = 1; i < s.length(); i++) {
    if (s[i] != v1[v1.size() - 1]) {
      v1.push_back(s[i]);
      v2.push_back(1);
      count = 1;
    } else {
      count++;
      v2[v2.size() - 1] = count;
    }
  }
  int res = 0;
  for (int i = 0; i < v1.size(); i++) {
    res += max(v2[i] - 2, 0);
    v2[i] = min(2, v2[i]);
  }
  for (int i = 0; i < v1.size(); i++) {
    if (v2[i] == 2) {
      i++;
      if (i < v1.size() && v2[i] == 2) {
        v2[i] = 1;
      }
    }
  }
  for (int i = 0; i < v1.size(); i++) {
    for (int j = 0; j < v2[i]; j++) {
      cout << v1[i];
    }
  }
  cout << endl;
  return 0;
}
