import java.util.Scanner;
import java.util.ArrayList;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String a = sc.next();
		ArrayList<String> b = new ArrayList<String>();
		for(int i=0 ; i<a.length() ; i++) {
			if(a.charAt(i) == '0') {
				b.add(a.substring(i, i+1));
			}
			else if(a.charAt(i) == '1') {
				b.add(a.substring(i, i+1));
			}
			else if(!b.isEmpty()) {
				b.remove((b.size()-1));
			}
		}
		for(int i=0 ; i<b.size() ; i++) {
			System.out.print(b.get(i));
		}
		System.out.println("");
	}
} import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String a = sc.next();
		ArrayList<String> b = new ArrayList<String>();
		for(int i=0 ; i<a.length() ; i++) {
			if(a.charAt(i) == '0') {
				b.add(a.substring(i, i+1));
			}
			else if(a.charAt(i) == '1') {
				b.add(a.substring(i, i+1));
			}
			else if(!b.isEmpty()) {
				b.remove((b.size()-1));
			}
		}
		for(int i=0 ; i<b.size() ; i++) {
			System.out.print(b.get(i));
		}
		System.out.println("");
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String a = sc.next();
		ArrayList<String> b = new ArrayList<String>();
		for(int i=0 ; i<a.length() ; i++) {
			if(a.charAt(i) == '0') {
				b.add(a.substring(i, i+1));
			}
			else if(a.charAt(i) == '1') {
				b.add(a.substring(i, i+1));
			}
			else if(!b.isEmpty()) {
				b.remove((b.size()-1));
			}
		}
		for(int i=0 ; i<b.size() ; i++) {
			System.out.print(b.get(i));
		}
		System.out.println("");
	} main {
		Scanner sc = new Scanner(System.in);
		String a = sc.next();
		ArrayList<String> b = new ArrayList<String>();
		for(int i=0 ; i<a.length() ; i++) {
			if(a.charAt(i) == '0') {
				b.add(a.substring(i, i+1));
			}
			else if(a.charAt(i) == '1') {
				b.add(a.substring(i, i+1));
			}
			else if(!b.isEmpty()) {
				b.remove((b.size()-1));
			}
		}
		for(int i=0 ; i<b.size() ; i++) {
			System.out.print(b.get(i));
		}
		System.out.println("");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String a = sc.next(); a sc.next() sc.next sc ArrayList<String> b = new ArrayList<String>(); b new ArrayList<String>() for(int i=0 ; i<a.length() ; i++) {
			if(a.charAt(i) == '0') {
				b.add(a.substring(i, i+1));
			}
			else if(a.charAt(i) == '1') {
				b.add(a.substring(i, i+1));
			}
			else if(!b.isEmpty()) {
				b.remove((b.size()-1));
			}
		} int i=0 ; int i=0 ; i 0 i<a.length() i a.length() a.length a i++ i++ i {
			if(a.charAt(i) == '0') {
				b.add(a.substring(i, i+1));
			}
			else if(a.charAt(i) == '1') {
				b.add(a.substring(i, i+1));
			}
			else if(!b.isEmpty()) {
				b.remove((b.size()-1));
			}
		} {
			if(a.charAt(i) == '0') {
				b.add(a.substring(i, i+1));
			}
			else if(a.charAt(i) == '1') {
				b.add(a.substring(i, i+1));
			}
			else if(!b.isEmpty()) {
				b.remove((b.size()-1));
			}
		} if(a.charAt(i) == '0') {
				b.add(a.substring(i, i+1));
			}
			else if(a.charAt(i) == '1') {
				b.add(a.substring(i, i+1));
			}
			else if(!b.isEmpty()) {
				b.remove((b.size()-1));
			} a.charAt(i) == '0' a.charAt(i) a.charAt a i '0' {
				b.add(a.substring(i, i+1));
			} b.add(a.substring(i, i+1)) b.add b a.substring(i, i+1) a.substring a i i+1 i 1 if(a.charAt(i) == '1') {
				b.add(a.substring(i, i+1));
			}
			else if(!b.isEmpty()) {
				b.remove((b.size()-1));
			} a.charAt(i) == '1' a.charAt(i) a.charAt a i '1' {
				b.add(a.substring(i, i+1));
			} b.add(a.substring(i, i+1)) b.add b a.substring(i, i+1) a.substring a i i+1 i 1 if(!b.isEmpty()) {
				b.remove((b.size()-1));
			} !b.isEmpty() b.isEmpty() b.isEmpty b {
				b.remove((b.size()-1));
			} b.remove((b.size()-1)) b.remove b (b.size()-1) b.size() b.size b 1 for(int i=0 ; i<b.size() ; i++) {
			System.out.print(b.get(i));
		} int i=0 ; int i=0 ; i 0 i<b.size() i b.size() b.size b i++ i++ i {
			System.out.print(b.get(i));
		} {
			System.out.print(b.get(i));
		} System.out.print(b.get(i)) System.out.print System.out System System.out b.get(i) b.get b i System.out.println("") System.out.println System.out System System.out "" String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String a = sc.next();
		ArrayList<String> b = new ArrayList<String>();
		for(int i=0 ; i<a.length() ; i++) {
			if(a.charAt(i) == '0') {
				b.add(a.substring(i, i+1));
			}
			else if(a.charAt(i) == '1') {
				b.add(a.substring(i, i+1));
			}
			else if(!b.isEmpty()) {
				b.remove((b.size()-1));
			}
		}
		for(int i=0 ; i<b.size() ; i++) {
			System.out.print(b.get(i));
		}
		System.out.println("");
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String a = sc.next();
		ArrayList<String> b = new ArrayList<String>();
		for(int i=0 ; i<a.length() ; i++) {
			if(a.charAt(i) == '0') {
				b.add(a.substring(i, i+1));
			}
			else if(a.charAt(i) == '1') {
				b.add(a.substring(i, i+1));
			}
			else if(!b.isEmpty()) {
				b.remove((b.size()-1));
			}
		}
		for(int i=0 ; i<b.size() ; i++) {
			System.out.print(b.get(i));
		}
		System.out.println("");
	}
} Main
import java.util.Scanner;
import java.util.ArrayList;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String a = sc.next();
		ArrayList<String> b = new ArrayList<String>();
		for(int i=0 ; i<a.length() ; i++) {
			if(a.charAt(i) == '0') {
				b.add(a.substring(i, i+1));
			}
			else if(a.charAt(i) == '1') {
				b.add(a.substring(i, i+1));
			}
			else if(!b.isEmpty()) {
				b.remove((b.size()-1));
			}
		}
		for(int i=0 ; i<b.size() ; i++) {
			System.out.print(b.get(i));
		}
		System.out.println("");
	}
}