/*我太二了, 上来就暴力,然后TLE两次。然后郁闷的去吃饭,回来一想栈的结构,10分钟AC。有种想撞墙的冲动!*/
//My Code:
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
const int N = 200005;
char s[N];
char str[N];
int main() {
//freopen("data.in", "r", stdin);
int len, top, i;
while(cin.get(str, N) != NULL) {
len = strlen(str);
top = 0;
s[top++] = str[0];
for(i = 1; i < len; i++) {
if(str[i] != s[top-1]) {
s[top++] = str[i];
} else {
top--;
}
}
for(i = 0; i < top; i++)
printf("%c", s[i]);
printf("\n");
}
return 0;
}