#include <bits/stdc++.h>
using namespace std;
const int maxN = 100500;
const int INF = (int)1e9;
const int MOD = 7 + (int)1e9;
const double eps = 1e-9;
vector<string> a;
int solve(vector<string> a) {
  int n = a.size();
  int ans[2];
  ans[0] = ans[1] = 0;
  for (int i = 0; i < n; i++) {
    ans[0] += (int)a[i].size() - (i % 2 + 1);
    ans[1] += (int)a[i].size() - (2 - i % 2);
  }
  for (int i = 0; i < n; i++) {
    int l1 = (i % 2 + 1);
    int l2 = (2 - i % 2);
    if (ans[0] <= ans[1]) {
      while (l1--) {
        cout << a[i][0];
      }
    } else {
      while (l2--) {
        cout << a[i][0];
      }
    }
  }
}
int main(void) {
  string s;
  cin >> s;
  int L = s.size();
  for (int i = 0; i < (int)s.size();) {
    string s2 = "";
    int r = 0;
    while (r + i < L && s[r + i] == s[i]) r++;
    for (int j = 0; j < r; j++) {
      s2.push_back(s[i]);
    }
    a.push_back(s2);
    i = i + r;
  }
  int n = a.size();
  for (int i = 0; i < n;) {
    while (i < n && a[i].size() == 1) {
      cout << a[i];
      i++;
    }
    if (i == n) {
      break;
    }
    vector<string> cur;
    while (i < n && a[i].size() >= 2) {
      cur.push_back(a[i]);
      i++;
    }
    solve(cur);
  }
  return 0;
}
