#include<iostream>#include<cstring>usingnamespace std;char text[101], package[101];int top =0;intmain(){while(cin >> text){top =0;package[++top]= text[0];for(int i =1; i <(int)strlen( text );++i){if(package[top]=='o'&& text[i]=='o'){if(top >=2&& package[top-1]=='O') top -=2;else package[top]='O';}elseif(package[top]=='O'&& text[i]=='O') top--;else package[++top]= text[i];}for(int i =1; i <= top ;++i)cout << package[i];cout << endl ;}return0;}