import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String input = sc.next();

		String[] inputChar = input.split("");
		List<String> output = new ArrayList<String>();
		for (int i = 0; i < inputChar.length; i++) {
			if ("0".equals(inputChar[i])) {
				output.add("0");
			} else if ("1".equals(inputChar[i])) {
				output.add("1");
			} else {
				if (!(output.size() == 0)) {
					output.remove(output.size() - 1);
				}
			}
		}
		for (String s : output) {
			System.out.print(s);
		}
	}
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String input = sc.next();

		String[] inputChar = input.split("");
		List<String> output = new ArrayList<String>();
		for (int i = 0; i < inputChar.length; i++) {
			if ("0".equals(inputChar[i])) {
				output.add("0");
			} else if ("1".equals(inputChar[i])) {
				output.add("1");
			} else {
				if (!(output.size() == 0)) {
					output.remove(output.size() - 1);
				}
			}
		}
		for (String s : output) {
			System.out.print(s);
		}
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String input = sc.next();

		String[] inputChar = input.split("");
		List<String> output = new ArrayList<String>();
		for (int i = 0; i < inputChar.length; i++) {
			if ("0".equals(inputChar[i])) {
				output.add("0");
			} else if ("1".equals(inputChar[i])) {
				output.add("1");
			} else {
				if (!(output.size() == 0)) {
					output.remove(output.size() - 1);
				}
			}
		}
		for (String s : output) {
			System.out.print(s);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		String input = sc.next();

		String[] inputChar = input.split("");
		List<String> output = new ArrayList<String>();
		for (int i = 0; i < inputChar.length; i++) {
			if ("0".equals(inputChar[i])) {
				output.add("0");
			} else if ("1".equals(inputChar[i])) {
				output.add("1");
			} else {
				if (!(output.size() == 0)) {
					output.remove(output.size() - 1);
				}
			}
		}
		for (String s : output) {
			System.out.print(s);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String input = sc.next(); input sc.next() sc.next sc String[] inputChar = input.split(""); inputChar input.split("") input.split input "" List<String> output = new ArrayList<String>(); output new ArrayList<String>() for (int i = 0; i < inputChar.length; i++) {
			if ("0".equals(inputChar[i])) {
				output.add("0");
			} else if ("1".equals(inputChar[i])) {
				output.add("1");
			} else {
				if (!(output.size() == 0)) {
					output.remove(output.size() - 1);
				}
			}
		} int i = 0; int i = 0; i 0 i < inputChar.length i inputChar.length inputChar inputChar.length i++ i++ i {
			if ("0".equals(inputChar[i])) {
				output.add("0");
			} else if ("1".equals(inputChar[i])) {
				output.add("1");
			} else {
				if (!(output.size() == 0)) {
					output.remove(output.size() - 1);
				}
			}
		} {
			if ("0".equals(inputChar[i])) {
				output.add("0");
			} else if ("1".equals(inputChar[i])) {
				output.add("1");
			} else {
				if (!(output.size() == 0)) {
					output.remove(output.size() - 1);
				}
			}
		} if ("0".equals(inputChar[i])) {
				output.add("0");
			} else if ("1".equals(inputChar[i])) {
				output.add("1");
			} else {
				if (!(output.size() == 0)) {
					output.remove(output.size() - 1);
				}
			} "0".equals(inputChar[i]) "0".equals "0" inputChar[i] inputChar i {
				output.add("0");
			} output.add("0") output.add output "0" if ("1".equals(inputChar[i])) {
				output.add("1");
			} else {
				if (!(output.size() == 0)) {
					output.remove(output.size() - 1);
				}
			} "1".equals(inputChar[i]) "1".equals "1" inputChar[i] inputChar i {
				output.add("1");
			} output.add("1") output.add output "1" {
				if (!(output.size() == 0)) {
					output.remove(output.size() - 1);
				}
			} if (!(output.size() == 0)) {
					output.remove(output.size() - 1);
				} !(output.size() == 0) (output.size() == 0) output.size() output.size output 0 {
					output.remove(output.size() - 1);
				} output.remove(output.size() - 1) output.remove output output.size() - 1 output.size() output.size output 1 for (String s : output) {
			System.out.print(s);
		} String s output {
			System.out.print(s);
		} {
			System.out.print(s);
		} System.out.print(s) System.out.print System.out System System.out s String[] args args public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String input = sc.next();

		String[] inputChar = input.split("");
		List<String> output = new ArrayList<String>();
		for (int i = 0; i < inputChar.length; i++) {
			if ("0".equals(inputChar[i])) {
				output.add("0");
			} else if ("1".equals(inputChar[i])) {
				output.add("1");
			} else {
				if (!(output.size() == 0)) {
					output.remove(output.size() - 1);
				}
			}
		}
		for (String s : output) {
			System.out.print(s);
		}
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String input = sc.next();

		String[] inputChar = input.split("");
		List<String> output = new ArrayList<String>();
		for (int i = 0; i < inputChar.length; i++) {
			if ("0".equals(inputChar[i])) {
				output.add("0");
			} else if ("1".equals(inputChar[i])) {
				output.add("1");
			} else {
				if (!(output.size() == 0)) {
					output.remove(output.size() - 1);
				}
			}
		}
		for (String s : output) {
			System.out.print(s);
		}
	}
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String input = sc.next();

		String[] inputChar = input.split("");
		List<String> output = new ArrayList<String>();
		for (int i = 0; i < inputChar.length; i++) {
			if ("0".equals(inputChar[i])) {
				output.add("0");
			} else if ("1".equals(inputChar[i])) {
				output.add("1");
			} else {
				if (!(output.size() == 0)) {
					output.remove(output.size() - 1);
				}
			}
		}
		for (String s : output) {
			System.out.print(s);
		}
	}
}
