#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long nCr(long long n, long long r) {
  long long C[r + 1];
  memset(C, 0, sizeof(C));
  C[0] = 1;
  for (long long i = 1; i < (long long)(n + 1); i++) {
    for (long long j = min(i, r); j > (long long)(0); j--) {
      C[j] = C[j] + C[j - 1];
    }
  }
  return C[r];
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n == 2) return true;
  if (n % 2 == 0) return false;
  long long m = sqrt(n);
  for (long long i = 3; i <= m; i += 2) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  string res = "";
  int length = s.length();
  for (long long i = 0; i < (long long)(length); i++) {
    if (s[i] != res.back() || res.empty()) {
      res += s[i];
    } else
      res.pop_back();
  }
  cout << res << endl;
  return 0;
}
