#include <bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin >> s;
	string result = "";
	for(size_t i = 1; i<s.length()+1;i++){
		if(s[i]=='B'){
			s[i]='m';
			s[i-1]='m';
		}
	}
	for(size_t i=0;i<s.length()+1;i++){
		if(s[i]!='m'){
			result+=s[i];
		}
	}
	cout << result;
}