#include <cstring>
#include <cstdio>
#include <stack>
using namespace std;
const int N = 110;
stack<char> s;
char str[N];
void print(){
char ans[N];
int idx = 0;
while(!s.empty()){
ans[++idx] = s.top();
s.pop();
}
for(int i = idx;i > 0;i--){
printf("%c",ans[i]);
}
puts("");
}
int main(){
while(~scanf("%s",str)){
while(s.size()) s.pop();
int n = strlen(str);
for(int i = 0;i < n;i++){
char ch = str[i];
if(s.empty()) s.push(str[i]);
else if(ch == 'O' && s.top() == 'O'){
s.pop();
}else if(ch == 'o' && s.top() == 'o'){
s.pop();
if(s.size() && s.top() == 'O') s.pop();
else s.push('O');
}else s.push(ch);
}
print();
}
return 0;
}
京公网安备 11010502036488号