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

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		ArrayList<String> txt = new ArrayList<String>();
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '0' || s.charAt(i) == '1')
				txt.add(s.substring(i, i + 1));
			else if (!txt.isEmpty())
				txt.remove(txt.size() - 1);
		}
		for (int i = 0; i < txt.size(); i++)
			System.out.print(txt.get(i));
		System.out.println("");
	}
} import java.util.ArrayList; ArrayList java.util 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();
		ArrayList<String> txt = new ArrayList<String>();
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '0' || s.charAt(i) == '1')
				txt.add(s.substring(i, i + 1));
			else if (!txt.isEmpty())
				txt.remove(txt.size() - 1);
		}
		for (int i = 0; i < txt.size(); i++)
			System.out.print(txt.get(i));
		System.out.println("");
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		ArrayList<String> txt = new ArrayList<String>();
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '0' || s.charAt(i) == '1')
				txt.add(s.substring(i, i + 1));
			else if (!txt.isEmpty())
				txt.remove(txt.size() - 1);
		}
		for (int i = 0; i < txt.size(); i++)
			System.out.print(txt.get(i));
		System.out.println("");
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		ArrayList<String> txt = new ArrayList<String>();
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '0' || s.charAt(i) == '1')
				txt.add(s.substring(i, i + 1));
			else if (!txt.isEmpty())
				txt.remove(txt.size() - 1);
		}
		for (int i = 0; i < txt.size(); i++)
			System.out.print(txt.get(i));
		System.out.println("");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc ArrayList<String> txt = new ArrayList<String>(); txt new ArrayList<String>() for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '0' || s.charAt(i) == '1')
				txt.add(s.substring(i, i + 1));
			else if (!txt.isEmpty())
				txt.remove(txt.size() - 1);
		} int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
			if (s.charAt(i) == '0' || s.charAt(i) == '1')
				txt.add(s.substring(i, i + 1));
			else if (!txt.isEmpty())
				txt.remove(txt.size() - 1);
		} {
			if (s.charAt(i) == '0' || s.charAt(i) == '1')
				txt.add(s.substring(i, i + 1));
			else if (!txt.isEmpty())
				txt.remove(txt.size() - 1);
		} if (s.charAt(i) == '0' || s.charAt(i) == '1')
				txt.add(s.substring(i, i + 1));
			else if (!txt.isEmpty())
				txt.remove(txt.size() - 1); s.charAt(i) == '0' || s.charAt(i) == '1' s.charAt(i) == '0' s.charAt(i) s.charAt s i '0' s.charAt(i) == '1' s.charAt(i) s.charAt s i '1' txt.add(s.substring(i, i + 1)) txt.add txt s.substring(i, i + 1) s.substring s i i + 1 i 1 if (!txt.isEmpty())
				txt.remove(txt.size() - 1); !txt.isEmpty() txt.isEmpty() txt.isEmpty txt txt.remove(txt.size() - 1) txt.remove txt txt.size() - 1 txt.size() txt.size txt 1 for (int i = 0; i < txt.size(); i++)
			System.out.print(txt.get(i)); int i = 0; int i = 0; i 0 i < txt.size() i txt.size() txt.size txt i++ i++ i System.out.print(txt.get(i)); System.out.print(txt.get(i)) System.out.print System.out System System.out txt.get(i) txt.get txt i System.out.println("") System.out.println System.out System System.out "" String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		ArrayList<String> txt = new ArrayList<String>();
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '0' || s.charAt(i) == '1')
				txt.add(s.substring(i, i + 1));
			else if (!txt.isEmpty())
				txt.remove(txt.size() - 1);
		}
		for (int i = 0; i < txt.size(); i++)
			System.out.print(txt.get(i));
		System.out.println("");
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		ArrayList<String> txt = new ArrayList<String>();
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '0' || s.charAt(i) == '1')
				txt.add(s.substring(i, i + 1));
			else if (!txt.isEmpty())
				txt.remove(txt.size() - 1);
		}
		for (int i = 0; i < txt.size(); i++)
			System.out.print(txt.get(i));
		System.out.println("");
	}
} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		ArrayList<String> txt = new ArrayList<String>();
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '0' || s.charAt(i) == '1')
				txt.add(s.substring(i, i + 1));
			else if (!txt.isEmpty())
				txt.remove(txt.size() - 1);
		}
		for (int i = 0; i < txt.size(); i++)
			System.out.print(txt.get(i));
		System.out.println("");
	}
}