import java.util.Scanner;

class Main{



	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力
		StringBuilder sb = new StringBuilder();
		String string = sc.next();

		for(int i = 0;i < string.length();i++){
			if(string.charAt(i) == '0'){
				sb.append("0");
			}else if(string.charAt(i) == '1'){
				sb.append("1");
			}else{
				if(sb.length()>0){
					sb.deleteCharAt(sb.length()-1);
				}
			}
		}
		System.out.println(sb.toString());


	}
} import java.util.Scanner; Scanner java.util class Main{



	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力
		StringBuilder sb = new StringBuilder();
		String string = sc.next();

		for(int i = 0;i < string.length();i++){
			if(string.charAt(i) == '0'){
				sb.append("0");
			}else if(string.charAt(i) == '1'){
				sb.append("1");
			}else{
				if(sb.length()>0){
					sb.deleteCharAt(sb.length()-1);
				}
			}
		}
		System.out.println(sb.toString());


	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力
		StringBuilder sb = new StringBuilder();
		String string = sc.next();

		for(int i = 0;i < string.length();i++){
			if(string.charAt(i) == '0'){
				sb.append("0");
			}else if(string.charAt(i) == '1'){
				sb.append("1");
			}else{
				if(sb.length()>0){
					sb.deleteCharAt(sb.length()-1);
				}
			}
		}
		System.out.println(sb.toString());


	} main {
		Scanner sc = new Scanner(System.in);			//文字の入力
		StringBuilder sb = new StringBuilder();
		String string = sc.next();

		for(int i = 0;i < string.length();i++){
			if(string.charAt(i) == '0'){
				sb.append("0");
			}else if(string.charAt(i) == '1'){
				sb.append("1");
			}else{
				if(sb.length()>0){
					sb.deleteCharAt(sb.length()-1);
				}
			}
		}
		System.out.println(sb.toString());


	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuilder sb = new StringBuilder(); sb new StringBuilder() String string = sc.next(); string sc.next() sc.next sc for(int i = 0;i < string.length();i++){
			if(string.charAt(i) == '0'){
				sb.append("0");
			}else if(string.charAt(i) == '1'){
				sb.append("1");
			}else{
				if(sb.length()>0){
					sb.deleteCharAt(sb.length()-1);
				}
			}
		} int i = 0; int i = 0; i 0 i < string.length() i string.length() string.length string i++ i++ i {
			if(string.charAt(i) == '0'){
				sb.append("0");
			}else if(string.charAt(i) == '1'){
				sb.append("1");
			}else{
				if(sb.length()>0){
					sb.deleteCharAt(sb.length()-1);
				}
			}
		} {
			if(string.charAt(i) == '0'){
				sb.append("0");
			}else if(string.charAt(i) == '1'){
				sb.append("1");
			}else{
				if(sb.length()>0){
					sb.deleteCharAt(sb.length()-1);
				}
			}
		} if(string.charAt(i) == '0'){
				sb.append("0");
			}else if(string.charAt(i) == '1'){
				sb.append("1");
			}else{
				if(sb.length()>0){
					sb.deleteCharAt(sb.length()-1);
				}
			} string.charAt(i) == '0' string.charAt(i) string.charAt string i '0' {
				sb.append("0");
			} sb.append("0") sb.append sb "0" if(string.charAt(i) == '1'){
				sb.append("1");
			}else{
				if(sb.length()>0){
					sb.deleteCharAt(sb.length()-1);
				}
			} string.charAt(i) == '1' string.charAt(i) string.charAt string i '1' {
				sb.append("1");
			} sb.append("1") sb.append sb "1" {
				if(sb.length()>0){
					sb.deleteCharAt(sb.length()-1);
				}
			} if(sb.length()>0){
					sb.deleteCharAt(sb.length()-1);
				} sb.length()>0 sb.length() sb.length sb 0 {
					sb.deleteCharAt(sb.length()-1);
				} sb.deleteCharAt(sb.length()-1) sb.deleteCharAt sb sb.length()-1 sb.length() sb.length sb 1 System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb String[] args args
import java.util.Scanner;

class Main{



	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力
		StringBuilder sb = new StringBuilder();
		String string = sc.next();

		for(int i = 0;i < string.length();i++){
			if(string.charAt(i) == '0'){
				sb.append("0");
			}else if(string.charAt(i) == '1'){
				sb.append("1");
			}else{
				if(sb.length()>0){
					sb.deleteCharAt(sb.length()-1);
				}
			}
		}
		System.out.println(sb.toString());


	}
}