import java.util.Scanner;

public class Main{

	public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		String answer = "";
		
		// 問題の入力を受け取る
		String input = scan.next();
		int len = input.length();
		
		for(int i = 0; i < len; i++){
			switch(input.charAt(0)){
				case '0':
					if(input.length() > 0){
						input = input.substring(1);
					}
					answer = answer.concat("0");
					break;
				case '1':
					if(input.length() > 0){
						input = input.substring(1);
					}
					answer = answer.concat("1");
					break;
				case 'B':
					input = input.substring(1);
					if(answer.length() > 0){
						answer = answer.substring(0, answer.length()-1);
					}
					break;
			}
		}
		
		System.out.println(answer);
		
	}
} import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		String answer = "";
		
		// 問題の入力を受け取る
		String input = scan.next();
		int len = input.length();
		
		for(int i = 0; i < len; i++){
			switch(input.charAt(0)){
				case '0':
					if(input.length() > 0){
						input = input.substring(1);
					}
					answer = answer.concat("0");
					break;
				case '1':
					if(input.length() > 0){
						input = input.substring(1);
					}
					answer = answer.concat("1");
					break;
				case 'B':
					input = input.substring(1);
					if(answer.length() > 0){
						answer = answer.substring(0, answer.length()-1);
					}
					break;
			}
		}
		
		System.out.println(answer);
		
	}
} Main public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		String answer = "";
		
		// 問題の入力を受け取る
		String input = scan.next();
		int len = input.length();
		
		for(int i = 0; i < len; i++){
			switch(input.charAt(0)){
				case '0':
					if(input.length() > 0){
						input = input.substring(1);
					}
					answer = answer.concat("0");
					break;
				case '1':
					if(input.length() > 0){
						input = input.substring(1);
					}
					answer = answer.concat("1");
					break;
				case 'B':
					input = input.substring(1);
					if(answer.length() > 0){
						answer = answer.substring(0, answer.length()-1);
					}
					break;
			}
		}
		
		System.out.println(answer);
		
	} main {
		Scanner scan = new Scanner(System.in);
		String answer = "";
		
		// 問題の入力を受け取る
		String input = scan.next();
		int len = input.length();
		
		for(int i = 0; i < len; i++){
			switch(input.charAt(0)){
				case '0':
					if(input.length() > 0){
						input = input.substring(1);
					}
					answer = answer.concat("0");
					break;
				case '1':
					if(input.length() > 0){
						input = input.substring(1);
					}
					answer = answer.concat("1");
					break;
				case 'B':
					input = input.substring(1);
					if(answer.length() > 0){
						answer = answer.substring(0, answer.length()-1);
					}
					break;
			}
		}
		
		System.out.println(answer);
		
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String answer = ""; answer "" String input = scan.next(); input scan.next() scan.next scan int len = input.length(); len input.length() input.length input for(int i = 0; i < len; i++){
			switch(input.charAt(0)){
				case '0':
					if(input.length() > 0){
						input = input.substring(1);
					}
					answer = answer.concat("0");
					break;
				case '1':
					if(input.length() > 0){
						input = input.substring(1);
					}
					answer = answer.concat("1");
					break;
				case 'B':
					input = input.substring(1);
					if(answer.length() > 0){
						answer = answer.substring(0, answer.length()-1);
					}
					break;
			}
		} int i = 0; int i = 0; i 0 i < len i len i++ i++ i {
			switch(input.charAt(0)){
				case '0':
					if(input.length() > 0){
						input = input.substring(1);
					}
					answer = answer.concat("0");
					break;
				case '1':
					if(input.length() > 0){
						input = input.substring(1);
					}
					answer = answer.concat("1");
					break;
				case 'B':
					input = input.substring(1);
					if(answer.length() > 0){
						answer = answer.substring(0, answer.length()-1);
					}
					break;
			}
		} {
			switch(input.charAt(0)){
				case '0':
					if(input.length() > 0){
						input = input.substring(1);
					}
					answer = answer.concat("0");
					break;
				case '1':
					if(input.length() > 0){
						input = input.substring(1);
					}
					answer = answer.concat("1");
					break;
				case 'B':
					input = input.substring(1);
					if(answer.length() > 0){
						answer = answer.substring(0, answer.length()-1);
					}
					break;
			}
		} switch(input.charAt(0)){
				case '0':
					if(input.length() > 0){
						input = input.substring(1);
					}
					answer = answer.concat("0");
					break;
				case '1':
					if(input.length() > 0){
						input = input.substring(1);
					}
					answer = answer.concat("1");
					break;
				case 'B':
					input = input.substring(1);
					if(answer.length() > 0){
						answer = answer.substring(0, answer.length()-1);
					}
					break;
			} input.charAt(0) input.charAt input 0 case '0': '0' case '0': if(input.length() > 0){
						input = input.substring(1);
					} input.length() > 0 input.length() input.length input 0 {
						input = input.substring(1);
					} input = input.substring(1) input input.substring(1) input.substring input 1 answer = answer.concat("0") answer answer.concat("0") answer.concat answer "0" break; case '1': '1' case '1': if(input.length() > 0){
						input = input.substring(1);
					} input.length() > 0 input.length() input.length input 0 {
						input = input.substring(1);
					} input = input.substring(1) input input.substring(1) input.substring input 1 answer = answer.concat("1") answer answer.concat("1") answer.concat answer "1" break; case 'B': 'B' case 'B': input = input.substring(1) input input.substring(1) input.substring input 1 if(answer.length() > 0){
						answer = answer.substring(0, answer.length()-1);
					} answer.length() > 0 answer.length() answer.length answer 0 {
						answer = answer.substring(0, answer.length()-1);
					} answer = answer.substring(0, answer.length()-1) answer answer.substring(0, answer.length()-1) answer.substring answer 0 answer.length()-1 answer.length() answer.length answer 1 break; System.out.println(answer) System.out.println System.out System System.out answer String... args args public class Main{

	public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		String answer = "";
		
		// 問題の入力を受け取る
		String input = scan.next();
		int len = input.length();
		
		for(int i = 0; i < len; i++){
			switch(input.charAt(0)){
				case '0':
					if(input.length() > 0){
						input = input.substring(1);
					}
					answer = answer.concat("0");
					break;
				case '1':
					if(input.length() > 0){
						input = input.substring(1);
					}
					answer = answer.concat("1");
					break;
				case 'B':
					input = input.substring(1);
					if(answer.length() > 0){
						answer = answer.substring(0, answer.length()-1);
					}
					break;
			}
		}
		
		System.out.println(answer);
		
	}
} public class Main{

	public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		String answer = "";
		
		// 問題の入力を受け取る
		String input = scan.next();
		int len = input.length();
		
		for(int i = 0; i < len; i++){
			switch(input.charAt(0)){
				case '0':
					if(input.length() > 0){
						input = input.substring(1);
					}
					answer = answer.concat("0");
					break;
				case '1':
					if(input.length() > 0){
						input = input.substring(1);
					}
					answer = answer.concat("1");
					break;
				case 'B':
					input = input.substring(1);
					if(answer.length() > 0){
						answer = answer.substring(0, answer.length()-1);
					}
					break;
			}
		}
		
		System.out.println(answer);
		
	}
} Main
import java.util.Scanner;

public class Main{

	public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		String answer = "";
		
		// 問題の入力を受け取る
		String input = scan.next();
		int len = input.length();
		
		for(int i = 0; i < len; i++){
			switch(input.charAt(0)){
				case '0':
					if(input.length() > 0){
						input = input.substring(1);
					}
					answer = answer.concat("0");
					break;
				case '1':
					if(input.length() > 0){
						input = input.substring(1);
					}
					answer = answer.concat("1");
					break;
				case 'B':
					input = input.substring(1);
					if(answer.length() > 0){
						answer = answer.substring(0, answer.length()-1);
					}
					break;
			}
		}
		
		System.out.println(answer);
		
	}
}