//stackとqueueのちがい
//char ''
//for --
//調べながら20分

import java.util.Scanner;
import java.util.Stack;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String s = sc.nextLine();

		Stack stack = new Stack();

		for(int i=0;i<s.length();i++) {

			char c = s.charAt(i);

			if(c == '0') {

				stack.push(0);

			}else if(c == '1') {

				stack.push(1);

			}else if(!stack.isEmpty()) {

				stack.pop();

			}
		}

		int size = stack.size();

		String str = "";

		for(int i=0;i<size;i++) {

			str += stack.pop();

		}

		for(int i=size-1;i>=0;i--) {

			System.out.print(str.charAt(i));
		}
	}

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

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String s = sc.nextLine();

		Stack stack = new Stack();

		for(int i=0;i<s.length();i++) {

			char c = s.charAt(i);

			if(c == '0') {

				stack.push(0);

			}else if(c == '1') {

				stack.push(1);

			}else if(!stack.isEmpty()) {

				stack.pop();

			}
		}

		int size = stack.size();

		String str = "";

		for(int i=0;i<size;i++) {

			str += stack.pop();

		}

		for(int i=size-1;i>=0;i--) {

			System.out.print(str.charAt(i));
		}
	}

} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String s = sc.nextLine();

		Stack stack = new Stack();

		for(int i=0;i<s.length();i++) {

			char c = s.charAt(i);

			if(c == '0') {

				stack.push(0);

			}else if(c == '1') {

				stack.push(1);

			}else if(!stack.isEmpty()) {

				stack.pop();

			}
		}

		int size = stack.size();

		String str = "";

		for(int i=0;i<size;i++) {

			str += stack.pop();

		}

		for(int i=size-1;i>=0;i--) {

			System.out.print(str.charAt(i));
		}
	} main {

		Scanner sc = new Scanner(System.in);

		String s = sc.nextLine();

		Stack stack = new Stack();

		for(int i=0;i<s.length();i++) {

			char c = s.charAt(i);

			if(c == '0') {

				stack.push(0);

			}else if(c == '1') {

				stack.push(1);

			}else if(!stack.isEmpty()) {

				stack.pop();

			}
		}

		int size = stack.size();

		String str = "";

		for(int i=0;i<size;i++) {

			str += stack.pop();

		}

		for(int i=size-1;i>=0;i--) {

			System.out.print(str.charAt(i));
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc Stack stack = new Stack(); stack new Stack() for(int i=0;i<s.length();i++) {

			char c = s.charAt(i);

			if(c == '0') {

				stack.push(0);

			}else if(c == '1') {

				stack.push(1);

			}else if(!stack.isEmpty()) {

				stack.pop();

			}
		} int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {

			char c = s.charAt(i);

			if(c == '0') {

				stack.push(0);

			}else if(c == '1') {

				stack.push(1);

			}else if(!stack.isEmpty()) {

				stack.pop();

			}
		} {

			char c = s.charAt(i);

			if(c == '0') {

				stack.push(0);

			}else if(c == '1') {

				stack.push(1);

			}else if(!stack.isEmpty()) {

				stack.pop();

			}
		} char c = s.charAt(i); c s.charAt(i) s.charAt s i if(c == '0') {

				stack.push(0);

			}else if(c == '1') {

				stack.push(1);

			}else if(!stack.isEmpty()) {

				stack.pop();

			} c == '0' c '0' {

				stack.push(0);

			} stack.push(0) stack.push stack 0 if(c == '1') {

				stack.push(1);

			}else if(!stack.isEmpty()) {

				stack.pop();

			} c == '1' c '1' {

				stack.push(1);

			} stack.push(1) stack.push stack 1 if(!stack.isEmpty()) {

				stack.pop();

			} !stack.isEmpty() stack.isEmpty() stack.isEmpty stack {

				stack.pop();

			} stack.pop() stack.pop stack int size = stack.size(); size stack.size() stack.size stack String str = ""; str "" for(int i=0;i<size;i++) {

			str += stack.pop();

		} int i=0; int i=0; i 0 i<size i size i++ i++ i {

			str += stack.pop();

		} {

			str += stack.pop();

		} str += stack.pop() str stack.pop() stack.pop stack for(int i=size-1;i>=0;i--) {

			System.out.print(str.charAt(i));
		} int i=size-1; int i=size-1; i size-1 size 1 i>=0 i 0 i-- i-- i {

			System.out.print(str.charAt(i));
		} {

			System.out.print(str.charAt(i));
		} System.out.print(str.charAt(i)) System.out.print System.out System System.out str.charAt(i) str.charAt str i String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String s = sc.nextLine();

		Stack stack = new Stack();

		for(int i=0;i<s.length();i++) {

			char c = s.charAt(i);

			if(c == '0') {

				stack.push(0);

			}else if(c == '1') {

				stack.push(1);

			}else if(!stack.isEmpty()) {

				stack.pop();

			}
		}

		int size = stack.size();

		String str = "";

		for(int i=0;i<size;i++) {

			str += stack.pop();

		}

		for(int i=size-1;i>=0;i--) {

			System.out.print(str.charAt(i));
		}
	}

} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String s = sc.nextLine();

		Stack stack = new Stack();

		for(int i=0;i<s.length();i++) {

			char c = s.charAt(i);

			if(c == '0') {

				stack.push(0);

			}else if(c == '1') {

				stack.push(1);

			}else if(!stack.isEmpty()) {

				stack.pop();

			}
		}

		int size = stack.size();

		String str = "";

		for(int i=0;i<size;i++) {

			str += stack.pop();

		}

		for(int i=size-1;i>=0;i--) {

			System.out.print(str.charAt(i));
		}
	}

} Main
//stackとqueueのちがい
//char ''
//for --
//調べながら20分

import java.util.Scanner;
import java.util.Stack;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String s = sc.nextLine();

		Stack stack = new Stack();

		for(int i=0;i<s.length();i++) {

			char c = s.charAt(i);

			if(c == '0') {

				stack.push(0);

			}else if(c == '1') {

				stack.push(1);

			}else if(!stack.isEmpty()) {

				stack.pop();

			}
		}

		int size = stack.size();

		String str = "";

		for(int i=0;i<size;i++) {

			str += stack.pop();

		}

		for(int i=size-1;i>=0;i--) {

			System.out.print(str.charAt(i));
		}
	}

}
