#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
string input, check;
string checkstr(string str) {
int pos, p = 0;
int len, l = 1;
int s = str.length();
for(int i = 0; i<s; i++) {
if (i>0 && str[i] == str[i-1]) {
l++;
if(l>len) {
len = l;
pos = p;
}
}
else {
l = 1;
p = i;
}
}
if (len <= 1) return str;
else return str.erase(pos,len);
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> input;
int e = 0;
while (e == 0) {
check = checkstr(input)
if(check==input) {
cout << input << "\n";
e=1;
}
else {
input = check;
}
}
}