#include <bits/stdc++.h>
using namespace std;
string s;
char a[1000006];
char m[1000006];
int main() {
  cin >> s;
  int len = s.length();
  int p = 0;
  int sum = 0;
  char b = ' ';
  m[0] = ' ';
  for (int i = 0; i < len; i++) {
    if (b == ' ') {
      b = s[i];
      m[++p] = b;
    } else {
      if (b == s[i]) {
        m[++p] = b;
      } else
        b = m[--p];
    }
  }
  for (int i = 1; i <= p; i++) cout << m[i];
  cout << endl;
}
