#include <bits/stdc++.h>
using namespace std;
int main() {
  string a;
  cin >> a;
  bool first = false;
  bool adaHapus = false;
  int firstPoint, lastPoint;
  int count = 0;
  while (true) {
    first = false;
    firstPoint = 0;
    lastPoint = 0;
    adaHapus = false;
    int pStr = a.length();
    for (int i = 0; i < pStr; i++) {
      if ((i == pStr - 1) && first) {
        lastPoint = i;
        first = false;
        adaHapus = true;
        a.erase(firstPoint, lastPoint - firstPoint + 1);
        count++;
        break;
      }
      if ((a[i] != a[i + 1]) && !first) {
        firstPoint = i;
        first = true;
      }
      if ((a[i] == a[i + 1]) && first) {
        lastPoint = i;
        first = false;
        adaHapus = true;
        a.erase(firstPoint, lastPoint - firstPoint + 1);
        count++;
      }
    }
    if (a == "") {
      break;
    } else if (!adaHapus) {
      break;
    }
  }
  cout << a << "\n";
}
