import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] cs = sc.next().toCharArray();
		for(char c :cs) {
			switch(c) {
			case '1': sb.append(c);
			break;
			case '0': sb.append(c);
			break;
			case 'B':
				if (sb.length() > 0) {
					sb.deleteCharAt(sb.length() - 1);
				}
			break;
			}
		}
		System.out.println(sb);

	}

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

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] cs = sc.next().toCharArray();
		for(char c :cs) {
			switch(c) {
			case '1': sb.append(c);
			break;
			case '0': sb.append(c);
			break;
			case 'B':
				if (sb.length() > 0) {
					sb.deleteCharAt(sb.length() - 1);
				}
			break;
			}
		}
		System.out.println(sb);

	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] cs = sc.next().toCharArray();
		for(char c :cs) {
			switch(c) {
			case '1': sb.append(c);
			break;
			case '0': sb.append(c);
			break;
			case 'B':
				if (sb.length() > 0) {
					sb.deleteCharAt(sb.length() - 1);
				}
			break;
			}
		}
		System.out.println(sb);

	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] cs = sc.next().toCharArray();
		for(char c :cs) {
			switch(c) {
			case '1': sb.append(c);
			break;
			case '0': sb.append(c);
			break;
			case 'B':
				if (sb.length() > 0) {
					sb.deleteCharAt(sb.length() - 1);
				}
			break;
			}
		}
		System.out.println(sb);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuilder sb = new StringBuilder(); sb new StringBuilder() char[] cs = sc.next().toCharArray(); cs sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc for(char c :cs) {
			switch(c) {
			case '1': sb.append(c);
			break;
			case '0': sb.append(c);
			break;
			case 'B':
				if (sb.length() > 0) {
					sb.deleteCharAt(sb.length() - 1);
				}
			break;
			}
		} char c cs {
			switch(c) {
			case '1': sb.append(c);
			break;
			case '0': sb.append(c);
			break;
			case 'B':
				if (sb.length() > 0) {
					sb.deleteCharAt(sb.length() - 1);
				}
			break;
			}
		} {
			switch(c) {
			case '1': sb.append(c);
			break;
			case '0': sb.append(c);
			break;
			case 'B':
				if (sb.length() > 0) {
					sb.deleteCharAt(sb.length() - 1);
				}
			break;
			}
		} switch(c) {
			case '1': sb.append(c);
			break;
			case '0': sb.append(c);
			break;
			case 'B':
				if (sb.length() > 0) {
					sb.deleteCharAt(sb.length() - 1);
				}
			break;
			} c case '1': '1' case '1': sb.append(c) sb.append sb c break; case '0': '0' case '0': sb.append(c) sb.append sb c break; case 'B': 'B' case 'B': 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 break; System.out.println(sb) System.out.println System.out System System.out sb String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] cs = sc.next().toCharArray();
		for(char c :cs) {
			switch(c) {
			case '1': sb.append(c);
			break;
			case '0': sb.append(c);
			break;
			case 'B':
				if (sb.length() > 0) {
					sb.deleteCharAt(sb.length() - 1);
				}
			break;
			}
		}
		System.out.println(sb);

	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] cs = sc.next().toCharArray();
		for(char c :cs) {
			switch(c) {
			case '1': sb.append(c);
			break;
			case '0': sb.append(c);
			break;
			case 'B':
				if (sb.length() > 0) {
					sb.deleteCharAt(sb.length() - 1);
				}
			break;
			}
		}
		System.out.println(sb);

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] cs = sc.next().toCharArray();
		for(char c :cs) {
			switch(c) {
			case '1': sb.append(c);
			break;
			case '0': sb.append(c);
			break;
			case 'B':
				if (sb.length() > 0) {
					sb.deleteCharAt(sb.length() - 1);
				}
			break;
			}
		}
		System.out.println(sb);

	}

}
