import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		String result = "";
		for(int i = 0; i < str.length(); i++) {
			switch(str.substring(i, i+1)) {
				case "0":
					result += "0";
					break;
				case "1":
					result += "1";
					break;
				case "B":
					if(result.length() != 0) {
						result = result.substring(0, result.length()-1);
					}
			}
		}
		System.out.println(result);

	}

} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		String result = "";
		for(int i = 0; i < str.length(); i++) {
			switch(str.substring(i, i+1)) {
				case "0":
					result += "0";
					break;
				case "1":
					result += "1";
					break;
				case "B":
					if(result.length() != 0) {
						result = result.substring(0, result.length()-1);
					}
			}
		}
		System.out.println(result);

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		String result = "";
		for(int i = 0; i < str.length(); i++) {
			switch(str.substring(i, i+1)) {
				case "0":
					result += "0";
					break;
				case "1":
					result += "1";
					break;
				case "B":
					if(result.length() != 0) {
						result = result.substring(0, result.length()-1);
					}
			}
		}
		System.out.println(result);

	} main {
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		String result = "";
		for(int i = 0; i < str.length(); i++) {
			switch(str.substring(i, i+1)) {
				case "0":
					result += "0";
					break;
				case "1":
					result += "1";
					break;
				case "B":
					if(result.length() != 0) {
						result = result.substring(0, result.length()-1);
					}
			}
		}
		System.out.println(result);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.next(); str sc.next() sc.next sc String result = ""; result "" for(int i = 0; i < str.length(); i++) {
			switch(str.substring(i, i+1)) {
				case "0":
					result += "0";
					break;
				case "1":
					result += "1";
					break;
				case "B":
					if(result.length() != 0) {
						result = result.substring(0, result.length()-1);
					}
			}
		} int i = 0; int i = 0; i 0 i < str.length() i str.length() str.length str i++ i++ i {
			switch(str.substring(i, i+1)) {
				case "0":
					result += "0";
					break;
				case "1":
					result += "1";
					break;
				case "B":
					if(result.length() != 0) {
						result = result.substring(0, result.length()-1);
					}
			}
		} {
			switch(str.substring(i, i+1)) {
				case "0":
					result += "0";
					break;
				case "1":
					result += "1";
					break;
				case "B":
					if(result.length() != 0) {
						result = result.substring(0, result.length()-1);
					}
			}
		} switch(str.substring(i, i+1)) {
				case "0":
					result += "0";
					break;
				case "1":
					result += "1";
					break;
				case "B":
					if(result.length() != 0) {
						result = result.substring(0, result.length()-1);
					}
			} str.substring(i, i+1) str.substring str i i+1 i 1 case "0": "0" case "0": result += "0" result "0" break; case "1": "1" case "1": result += "1" result "1" break; case "B": "B" case "B": if(result.length() != 0) {
						result = result.substring(0, result.length()-1);
					} result.length() != 0 result.length() result.length result 0 {
						result = result.substring(0, result.length()-1);
					} result = result.substring(0, result.length()-1) result result.substring(0, result.length()-1) result.substring result 0 result.length()-1 result.length() result.length result 1 System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		String result = "";
		for(int i = 0; i < str.length(); i++) {
			switch(str.substring(i, i+1)) {
				case "0":
					result += "0";
					break;
				case "1":
					result += "1";
					break;
				case "B":
					if(result.length() != 0) {
						result = result.substring(0, result.length()-1);
					}
			}
		}
		System.out.println(result);

	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		String result = "";
		for(int i = 0; i < str.length(); i++) {
			switch(str.substring(i, i+1)) {
				case "0":
					result += "0";
					break;
				case "1":
					result += "1";
					break;
				case "B":
					if(result.length() != 0) {
						result = result.substring(0, result.length()-1);
					}
			}
		}
		System.out.println(result);

	}

} Main
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		String result = "";
		for(int i = 0; i < str.length(); i++) {
			switch(str.substring(i, i+1)) {
				case "0":
					result += "0";
					break;
				case "1":
					result += "1";
					break;
				case "B":
					if(result.length() != 0) {
						result = result.substring(0, result.length()-1);
					}
			}
		}
		System.out.println(result);

	}

}
