import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		sc.close();
		 StringBuilder sb = new StringBuilder();
		for(int i = 0; i < S.length(); i++) {
			if(S.substring(i, i + 1).equals("0")) {
				sb.append("0");
			}else if(S.substring(i, i + 1).equals("1")) {
				sb.append("1");
			}else {
				if(sb.length() != 0) {
					sb.setLength(sb.length()-1);
				}
			}
		}
		System.out.println(sb.toString());
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		sc.close();
		 StringBuilder sb = new StringBuilder();
		for(int i = 0; i < S.length(); i++) {
			if(S.substring(i, i + 1).equals("0")) {
				sb.append("0");
			}else if(S.substring(i, i + 1).equals("1")) {
				sb.append("1");
			}else {
				if(sb.length() != 0) {
					sb.setLength(sb.length()-1);
				}
			}
		}
		System.out.println(sb.toString());
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		sc.close();
		 StringBuilder sb = new StringBuilder();
		for(int i = 0; i < S.length(); i++) {
			if(S.substring(i, i + 1).equals("0")) {
				sb.append("0");
			}else if(S.substring(i, i + 1).equals("1")) {
				sb.append("1");
			}else {
				if(sb.length() != 0) {
					sb.setLength(sb.length()-1);
				}
			}
		}
		System.out.println(sb.toString());
	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		sc.close();
		 StringBuilder sb = new StringBuilder();
		for(int i = 0; i < S.length(); i++) {
			if(S.substring(i, i + 1).equals("0")) {
				sb.append("0");
			}else if(S.substring(i, i + 1).equals("1")) {
				sb.append("1");
			}else {
				if(sb.length() != 0) {
					sb.setLength(sb.length()-1);
				}
			}
		}
		System.out.println(sb.toString());
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc sc.close() sc.close sc StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(int i = 0; i < S.length(); i++) {
			if(S.substring(i, i + 1).equals("0")) {
				sb.append("0");
			}else if(S.substring(i, i + 1).equals("1")) {
				sb.append("1");
			}else {
				if(sb.length() != 0) {
					sb.setLength(sb.length()-1);
				}
			}
		} int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
			if(S.substring(i, i + 1).equals("0")) {
				sb.append("0");
			}else if(S.substring(i, i + 1).equals("1")) {
				sb.append("1");
			}else {
				if(sb.length() != 0) {
					sb.setLength(sb.length()-1);
				}
			}
		} {
			if(S.substring(i, i + 1).equals("0")) {
				sb.append("0");
			}else if(S.substring(i, i + 1).equals("1")) {
				sb.append("1");
			}else {
				if(sb.length() != 0) {
					sb.setLength(sb.length()-1);
				}
			}
		} if(S.substring(i, i + 1).equals("0")) {
				sb.append("0");
			}else if(S.substring(i, i + 1).equals("1")) {
				sb.append("1");
			}else {
				if(sb.length() != 0) {
					sb.setLength(sb.length()-1);
				}
			} S.substring(i, i + 1).equals("0") S.substring(i, i + 1).equals S.substring(i, i + 1) S.substring S i i + 1 i 1 "0" {
				sb.append("0");
			} sb.append("0") sb.append sb "0" if(S.substring(i, i + 1).equals("1")) {
				sb.append("1");
			}else {
				if(sb.length() != 0) {
					sb.setLength(sb.length()-1);
				}
			} S.substring(i, i + 1).equals("1") S.substring(i, i + 1).equals S.substring(i, i + 1) S.substring S i i + 1 i 1 "1" {
				sb.append("1");
			} sb.append("1") sb.append sb "1" {
				if(sb.length() != 0) {
					sb.setLength(sb.length()-1);
				}
			} if(sb.length() != 0) {
					sb.setLength(sb.length()-1);
				} sb.length() != 0 sb.length() sb.length sb 0 {
					sb.setLength(sb.length()-1);
				} sb.setLength(sb.length()-1) sb.setLength 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 public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		sc.close();
		 StringBuilder sb = new StringBuilder();
		for(int i = 0; i < S.length(); i++) {
			if(S.substring(i, i + 1).equals("0")) {
				sb.append("0");
			}else if(S.substring(i, i + 1).equals("1")) {
				sb.append("1");
			}else {
				if(sb.length() != 0) {
					sb.setLength(sb.length()-1);
				}
			}
		}
		System.out.println(sb.toString());
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		sc.close();
		 StringBuilder sb = new StringBuilder();
		for(int i = 0; i < S.length(); i++) {
			if(S.substring(i, i + 1).equals("0")) {
				sb.append("0");
			}else if(S.substring(i, i + 1).equals("1")) {
				sb.append("1");
			}else {
				if(sb.length() != 0) {
					sb.setLength(sb.length()-1);
				}
			}
		}
		System.out.println(sb.toString());
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		sc.close();
		 StringBuilder sb = new StringBuilder();
		for(int i = 0; i < S.length(); i++) {
			if(S.substring(i, i + 1).equals("0")) {
				sb.append("0");
			}else if(S.substring(i, i + 1).equals("1")) {
				sb.append("1");
			}else {
				if(sb.length() != 0) {
					sb.setLength(sb.length()-1);
				}
			}
		}
		System.out.println(sb.toString());
	}
}