#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, output;
  cin >> s;
  if (s.size() < 3) {
    cout << s << endl;
    return 0;
  }
  output.append(1, s[0]);
  output.append(1, s[1]);
  int a = 0;
  for (int i = 2; i < s.size(); i++) {
    if (s[i] == output[a + 1] && s[i] == output[a])
      continue;
    else if (output.size() >= 3 && output[a - 1] == output[a] &&
             output[a + 1] == s[i])
      continue;
    output.append(1, s[i]);
    a++;
  }
  cout << output << endl;
  return 0;
}
