#include <bits/stdc++.h>
using namespace std;
const int tam = 100010;
const int MOD = 1000000007;
const int MOD1 = 998244353;
const double EPS = 1e-9;
const double PI = acos(-1);
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  char ch[200001];
  cin >> ch;
  char* p = ch;
  int n = 0;
  while (*p != 0) {
    ch[n++] = *p;
    if (n >= 2 && ch[n - 1] == ch[n - 2]) n -= 2;
    ++p;
  }
  ch[n] = 0;
  cout << ch;
  return 0;
}
