import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		char[] arr = in.nextLine().toCharArray();
		
		String str = "";
		for (int i = 0; i < arr.length; i++) {
			if (arr[i] == '0') {
				str += "0";
			}
			else if (arr[i] == '1') {
				str += "1";
			}
			else {
				if (str.equals(""))
					continue;
				str = str.substring(0, str.length() - 1); 
			}
		}
		
		System.out.println(str);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		char[] arr = in.nextLine().toCharArray();
		
		String str = "";
		for (int i = 0; i < arr.length; i++) {
			if (arr[i] == '0') {
				str += "0";
			}
			else if (arr[i] == '1') {
				str += "1";
			}
			else {
				if (str.equals(""))
					continue;
				str = str.substring(0, str.length() - 1); 
			}
		}
		
		System.out.println(str);
	}
} Main public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		char[] arr = in.nextLine().toCharArray();
		
		String str = "";
		for (int i = 0; i < arr.length; i++) {
			if (arr[i] == '0') {
				str += "0";
			}
			else if (arr[i] == '1') {
				str += "1";
			}
			else {
				if (str.equals(""))
					continue;
				str = str.substring(0, str.length() - 1); 
			}
		}
		
		System.out.println(str);
	} main {
		Scanner in = new Scanner(System.in);
		char[] arr = in.nextLine().toCharArray();
		
		String str = "";
		for (int i = 0; i < arr.length; i++) {
			if (arr[i] == '0') {
				str += "0";
			}
			else if (arr[i] == '1') {
				str += "1";
			}
			else {
				if (str.equals(""))
					continue;
				str = str.substring(0, str.length() - 1); 
			}
		}
		
		System.out.println(str);
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) char[] arr = in.nextLine().toCharArray(); arr in.nextLine().toCharArray() in.nextLine().toCharArray in.nextLine() in.nextLine in String str = ""; str "" for (int i = 0; i < arr.length; i++) {
			if (arr[i] == '0') {
				str += "0";
			}
			else if (arr[i] == '1') {
				str += "1";
			}
			else {
				if (str.equals(""))
					continue;
				str = str.substring(0, str.length() - 1); 
			}
		} int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i {
			if (arr[i] == '0') {
				str += "0";
			}
			else if (arr[i] == '1') {
				str += "1";
			}
			else {
				if (str.equals(""))
					continue;
				str = str.substring(0, str.length() - 1); 
			}
		} {
			if (arr[i] == '0') {
				str += "0";
			}
			else if (arr[i] == '1') {
				str += "1";
			}
			else {
				if (str.equals(""))
					continue;
				str = str.substring(0, str.length() - 1); 
			}
		} if (arr[i] == '0') {
				str += "0";
			}
			else if (arr[i] == '1') {
				str += "1";
			}
			else {
				if (str.equals(""))
					continue;
				str = str.substring(0, str.length() - 1); 
			} arr[i] == '0' arr[i] arr i '0' {
				str += "0";
			} str += "0" str "0" if (arr[i] == '1') {
				str += "1";
			}
			else {
				if (str.equals(""))
					continue;
				str = str.substring(0, str.length() - 1); 
			} arr[i] == '1' arr[i] arr i '1' {
				str += "1";
			} str += "1" str "1" {
				if (str.equals(""))
					continue;
				str = str.substring(0, str.length() - 1); 
			} if (str.equals(""))
					continue; str.equals("") str.equals str "" continue; str = str.substring(0, str.length() - 1) str str.substring(0, str.length() - 1) str.substring str 0 str.length() - 1 str.length() str.length str 1 System.out.println(str) System.out.println System.out System System.out str String args[] args public class Main {
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		char[] arr = in.nextLine().toCharArray();
		
		String str = "";
		for (int i = 0; i < arr.length; i++) {
			if (arr[i] == '0') {
				str += "0";
			}
			else if (arr[i] == '1') {
				str += "1";
			}
			else {
				if (str.equals(""))
					continue;
				str = str.substring(0, str.length() - 1); 
			}
		}
		
		System.out.println(str);
	}
} public class Main {
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		char[] arr = in.nextLine().toCharArray();
		
		String str = "";
		for (int i = 0; i < arr.length; i++) {
			if (arr[i] == '0') {
				str += "0";
			}
			else if (arr[i] == '1') {
				str += "1";
			}
			else {
				if (str.equals(""))
					continue;
				str = str.substring(0, str.length() - 1); 
			}
		}
		
		System.out.println(str);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		char[] arr = in.nextLine().toCharArray();
		
		String str = "";
		for (int i = 0; i < arr.length; i++) {
			if (arr[i] == '0') {
				str += "0";
			}
			else if (arr[i] == '1') {
				str += "1";
			}
			else {
				if (str.equals(""))
					continue;
				str = str.substring(0, str.length() - 1); 
			}
		}
		
		System.out.println(str);
	}
}
