import java.util.Scanner;

public class Main {
	static boolean[][] nodes;
	static int cnt = 0;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();

		while (s.contains("B")) {
			s = s.replaceAll("^B|[01]B", "");
		}

		System.out.println(s);
		sc.close();
	}

} import java.util.Scanner; Scanner java.util public class Main {
	static boolean[][] nodes;
	static int cnt = 0;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();

		while (s.contains("B")) {
			s = s.replaceAll("^B|[01]B", "");
		}

		System.out.println(s);
		sc.close();
	}

} Main static boolean[][] nodes; nodes static int cnt = 0; cnt 0 public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();

		while (s.contains("B")) {
			s = s.replaceAll("^B|[01]B", "");
		}

		System.out.println(s);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();

		while (s.contains("B")) {
			s = s.replaceAll("^B|[01]B", "");
		}

		System.out.println(s);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc while (s.contains("B")) {
			s = s.replaceAll("^B|[01]B", "");
		} s.contains("B") s.contains s "B" {
			s = s.replaceAll("^B|[01]B", "");
		} s = s.replaceAll("^B|[01]B", "") s s.replaceAll("^B|[01]B", "") s.replaceAll s "^B|[01]B" "" System.out.println(s) System.out.println System.out System System.out s sc.close() sc.close sc String[] args args public class Main {
	static boolean[][] nodes;
	static int cnt = 0;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();

		while (s.contains("B")) {
			s = s.replaceAll("^B|[01]B", "");
		}

		System.out.println(s);
		sc.close();
	}

} public class Main {
	static boolean[][] nodes;
	static int cnt = 0;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();

		while (s.contains("B")) {
			s = s.replaceAll("^B|[01]B", "");
		}

		System.out.println(s);
		sc.close();
	}

} Main
import java.util.Scanner;

public class Main {
	static boolean[][] nodes;
	static int cnt = 0;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();

		while (s.contains("B")) {
			s = s.replaceAll("^B|[01]B", "");
		}

		System.out.println(s);
		sc.close();
	}

}
