#include <bits/stdc++.h>
using namespace std;
bool prime(int x) {
  if (x < 2) return false;
  for (int i = 2; i <= sqrt(x); i++) {
    if ((x % i) == 0) return false;
  }
  return true;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(int a, int b) {
  int temp = gcd(a, b);
  return temp ? (a / temp * b) : 0;
}
string toBin(int x) {
  string res = "";
  while (x != 0) {
    res = to_string(x % 2) + res;
    x /= 2;
  }
  return res;
}
long long countDivisors(long long p, long long first, long long second) {
  long long st;
  if (first % p == 0)
    st = first;
  else {
    long long temp = first % p;
    if (temp > 0)
      st = first + (p - temp);
    else
      st = first - temp;
  }
  long long res = 1;
  if (st > second) return 0;
  res += (second - st) / p;
  return res;
}
string conv(string str) {
  string res = "";
  for (int i = 0; i < str.length(); ++i) {
    if (str[i] >= 'a' && str[i] <= 'z')
      res += str[i];
    else if (str[i] >= 'A' && str[i] <= 'Z')
      res += str[i] - 'A' + 'a';
  }
  return res;
}
bool findseq(string &str1, string str2) {
  for (int i = 0; i <= str1.length() - str2.length(); ++i) {
    if (str1.substr(i, str2.length()) == str2) {
      str1.erase(i, str2.length());
      str1.insert(i, 1, '#');
      return true;
    }
  }
  return false;
}
bool comp(string a, string b) { return a + b < b + a; }
long long f(long long iN, long long iR) {
  if (iR < 0 || iR > iN) {
    return 0;
  }
  long long iComb = 1;
  long long i = 0;
  while (i < iR) {
    ++i;
    iComb *= iN - i + 1;
    iComb /= i;
  }
  return iComb;
}
bool check(long long x) { return false; }
int main() {
  ios_base::sync_with_stdio(false);
  string str;
  cin >> str;
  stack<int> s;
  s.push(str[0]);
  for (int i = 1; i < str.length(); ++i) {
    if (!s.empty() && str[i] == s.top()) {
      s.pop();
    } else
      s.push(str[i]);
  }
  int i = 0;
  int res[200009];
  while (!s.empty()) {
    res[i++] = s.top();
    s.pop();
  }
  for (int j = i - 1; j >= 0; j--) cout << (char)res[j];
  return 0;
}
