
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		String s, out = "";
		Scanner input = new Scanner(System.in);
		s = input.next();
		for (int j = 0; j <= s.length() - 1; j++) {
			if (Character.valueOf(s.charAt(j)).toString().equals("0")) {
				out += "0";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("1")) {
				out += "1";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("B")) {
				if (!out.equals("")) {
					out = out.substring(0, out.length() - 1);
				}
			}
		}
		System.out.println(out);

	}

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

	public static void main(String[] args) {

		String s, out = "";
		Scanner input = new Scanner(System.in);
		s = input.next();
		for (int j = 0; j <= s.length() - 1; j++) {
			if (Character.valueOf(s.charAt(j)).toString().equals("0")) {
				out += "0";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("1")) {
				out += "1";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("B")) {
				if (!out.equals("")) {
					out = out.substring(0, out.length() - 1);
				}
			}
		}
		System.out.println(out);

	}

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

		String s, out = "";
		Scanner input = new Scanner(System.in);
		s = input.next();
		for (int j = 0; j <= s.length() - 1; j++) {
			if (Character.valueOf(s.charAt(j)).toString().equals("0")) {
				out += "0";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("1")) {
				out += "1";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("B")) {
				if (!out.equals("")) {
					out = out.substring(0, out.length() - 1);
				}
			}
		}
		System.out.println(out);

	} main {

		String s, out = "";
		Scanner input = new Scanner(System.in);
		s = input.next();
		for (int j = 0; j <= s.length() - 1; j++) {
			if (Character.valueOf(s.charAt(j)).toString().equals("0")) {
				out += "0";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("1")) {
				out += "1";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("B")) {
				if (!out.equals("")) {
					out = out.substring(0, out.length() - 1);
				}
			}
		}
		System.out.println(out);

	} String s s out = ""; out "" Scanner input = new Scanner(System.in); input new Scanner(System.in) s = input.next() s input.next() input.next input for (int j = 0; j <= s.length() - 1; j++) {
			if (Character.valueOf(s.charAt(j)).toString().equals("0")) {
				out += "0";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("1")) {
				out += "1";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("B")) {
				if (!out.equals("")) {
					out = out.substring(0, out.length() - 1);
				}
			}
		} int j = 0; int j = 0; j 0 j <= s.length() - 1 j s.length() - 1 s.length() s.length s 1 j++ j++ j {
			if (Character.valueOf(s.charAt(j)).toString().equals("0")) {
				out += "0";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("1")) {
				out += "1";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("B")) {
				if (!out.equals("")) {
					out = out.substring(0, out.length() - 1);
				}
			}
		} {
			if (Character.valueOf(s.charAt(j)).toString().equals("0")) {
				out += "0";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("1")) {
				out += "1";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("B")) {
				if (!out.equals("")) {
					out = out.substring(0, out.length() - 1);
				}
			}
		} if (Character.valueOf(s.charAt(j)).toString().equals("0")) {
				out += "0";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("1")) {
				out += "1";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("B")) {
				if (!out.equals("")) {
					out = out.substring(0, out.length() - 1);
				}
			} Character.valueOf(s.charAt(j)).toString().equals("0") Character.valueOf(s.charAt(j)).toString().equals Character.valueOf(s.charAt(j)).toString() Character.valueOf(s.charAt(j)).toString Character.valueOf(s.charAt(j)) Character.valueOf Character s.charAt(j) s.charAt s j "0" {
				out += "0";
			} out += "0" out "0" if (Character.valueOf(s.charAt(j)).toString().equals("1")) {
				out += "1";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("B")) {
				if (!out.equals("")) {
					out = out.substring(0, out.length() - 1);
				}
			} Character.valueOf(s.charAt(j)).toString().equals("1") Character.valueOf(s.charAt(j)).toString().equals Character.valueOf(s.charAt(j)).toString() Character.valueOf(s.charAt(j)).toString Character.valueOf(s.charAt(j)) Character.valueOf Character s.charAt(j) s.charAt s j "1" {
				out += "1";
			} out += "1" out "1" if (Character.valueOf(s.charAt(j)).toString().equals("B")) {
				if (!out.equals("")) {
					out = out.substring(0, out.length() - 1);
				}
			} Character.valueOf(s.charAt(j)).toString().equals("B") Character.valueOf(s.charAt(j)).toString().equals Character.valueOf(s.charAt(j)).toString() Character.valueOf(s.charAt(j)).toString Character.valueOf(s.charAt(j)) Character.valueOf Character s.charAt(j) s.charAt s j "B" {
				if (!out.equals("")) {
					out = out.substring(0, out.length() - 1);
				}
			} if (!out.equals("")) {
					out = out.substring(0, out.length() - 1);
				} !out.equals("") out.equals("") out.equals out "" {
					out = out.substring(0, out.length() - 1);
				} out = out.substring(0, out.length() - 1) out out.substring(0, out.length() - 1) out.substring out 0 out.length() - 1 out.length() out.length out 1 System.out.println(out) System.out.println System.out System System.out out String[] args args public class Main {

	public static void main(String[] args) {

		String s, out = "";
		Scanner input = new Scanner(System.in);
		s = input.next();
		for (int j = 0; j <= s.length() - 1; j++) {
			if (Character.valueOf(s.charAt(j)).toString().equals("0")) {
				out += "0";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("1")) {
				out += "1";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("B")) {
				if (!out.equals("")) {
					out = out.substring(0, out.length() - 1);
				}
			}
		}
		System.out.println(out);

	}

} public class Main {

	public static void main(String[] args) {

		String s, out = "";
		Scanner input = new Scanner(System.in);
		s = input.next();
		for (int j = 0; j <= s.length() - 1; j++) {
			if (Character.valueOf(s.charAt(j)).toString().equals("0")) {
				out += "0";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("1")) {
				out += "1";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("B")) {
				if (!out.equals("")) {
					out = out.substring(0, out.length() - 1);
				}
			}
		}
		System.out.println(out);

	}

} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		String s, out = "";
		Scanner input = new Scanner(System.in);
		s = input.next();
		for (int j = 0; j <= s.length() - 1; j++) {
			if (Character.valueOf(s.charAt(j)).toString().equals("0")) {
				out += "0";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("1")) {
				out += "1";
			} else if (Character.valueOf(s.charAt(j)).toString().equals("B")) {
				if (!out.equals("")) {
					out = out.substring(0, out.length() - 1);
				}
			}
		}
		System.out.println(out);

	}

}