#include <iostream>
#include <stack>
using namespace std;
int main() {
string str;
string str1 = "";
stack<char> temp;
cin >> str;
for (int i = 0; i < str.size(); i++) {
if (temp.empty() || temp.top() != str[i]) {
temp.push(str[i]);
} else {
temp.pop();
}
}
if (temp.empty())
cout << 0 << endl;
string res(temp.size(), '0');
for (int i = temp.size() - 1; i >= 0; i--) {
res[i] = temp.top();
temp.pop();
}
cout << res << endl;
}

京公网安备 11010502036488号