#include <bits/stdc++.h>
using namespace std;
stack <char> st;
char a[25];
int main()
{
char ch;
while (cin >> ch)
{
if (st.top() == ch) st.pop();
else st.push(ch);
}
int cnt = 0;
while (!st.empty())
{
a[++cnt] = st.top();
st.pop();
}
for (int i = cnt;i >= 1;i--) cout << a[i];
}