#include<iostream>
#include<stack>
using namespace std;
string removeDuplicates(string s) {
stack<char> ss;
for (int i = 0; i < s.length(); i++)
{
if (ss.empty())
{
ss.push(s[i]);
}
else
{
if (ss.top() == s[i])
{
ss.pop();
}
else
{
ss.push(s[i]);
}
}
}
string s2;
while (ss.size())
{
s2.push_back(ss.top());
ss.pop();
}
reverse(s2.begin(), s2.end());
return s2;
}
int main()
{
string s;
cin >> s;
string result = removeDuplicates(s);
cout << result << "
";
return 0;
}