import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Scanner;

public class Main {

	private static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		String s = sc.next();
		Deque<String> deq = new ArrayDeque<>();
		for (int i = 0; i < s.length(); i++) {
			char c = s.charAt(i);
			if (c == '0') {
				deq.addLast("0");
			} else if (c == '1') {
				deq.addLast("1");
			} else {
				deq.pollLast();
			}
		}
		StringBuilder sb = new StringBuilder();
		while (deq.size() != 0) {
			sb.append(deq.pollFirst());
		}
		System.out.println(sb);
	}
} import java.util.ArrayDeque; ArrayDeque java.util import java.util.Deque; Deque java.util import java.util.Scanner; Scanner java.util public class Main {

	private static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		String s = sc.next();
		Deque<String> deq = new ArrayDeque<>();
		for (int i = 0; i < s.length(); i++) {
			char c = s.charAt(i);
			if (c == '0') {
				deq.addLast("0");
			} else if (c == '1') {
				deq.addLast("1");
			} else {
				deq.pollLast();
			}
		}
		StringBuilder sb = new StringBuilder();
		while (deq.size() != 0) {
			sb.append(deq.pollFirst());
		}
		System.out.println(sb);
	}
} Main private static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
		String s = sc.next();
		Deque<String> deq = new ArrayDeque<>();
		for (int i = 0; i < s.length(); i++) {
			char c = s.charAt(i);
			if (c == '0') {
				deq.addLast("0");
			} else if (c == '1') {
				deq.addLast("1");
			} else {
				deq.pollLast();
			}
		}
		StringBuilder sb = new StringBuilder();
		while (deq.size() != 0) {
			sb.append(deq.pollFirst());
		}
		System.out.println(sb);
	} main {
		String s = sc.next();
		Deque<String> deq = new ArrayDeque<>();
		for (int i = 0; i < s.length(); i++) {
			char c = s.charAt(i);
			if (c == '0') {
				deq.addLast("0");
			} else if (c == '1') {
				deq.addLast("1");
			} else {
				deq.pollLast();
			}
		}
		StringBuilder sb = new StringBuilder();
		while (deq.size() != 0) {
			sb.append(deq.pollFirst());
		}
		System.out.println(sb);
	} String s = sc.next(); s sc.next() sc.next sc Deque<String> deq = new ArrayDeque<>(); deq new ArrayDeque<>() for (int i = 0; i < s.length(); i++) {
			char c = s.charAt(i);
			if (c == '0') {
				deq.addLast("0");
			} else if (c == '1') {
				deq.addLast("1");
			} else {
				deq.pollLast();
			}
		} int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
			char c = s.charAt(i);
			if (c == '0') {
				deq.addLast("0");
			} else if (c == '1') {
				deq.addLast("1");
			} else {
				deq.pollLast();
			}
		} {
			char c = s.charAt(i);
			if (c == '0') {
				deq.addLast("0");
			} else if (c == '1') {
				deq.addLast("1");
			} else {
				deq.pollLast();
			}
		} char c = s.charAt(i); c s.charAt(i) s.charAt s i if (c == '0') {
				deq.addLast("0");
			} else if (c == '1') {
				deq.addLast("1");
			} else {
				deq.pollLast();
			} c == '0' c '0' {
				deq.addLast("0");
			} deq.addLast("0") deq.addLast deq "0" if (c == '1') {
				deq.addLast("1");
			} else {
				deq.pollLast();
			} c == '1' c '1' {
				deq.addLast("1");
			} deq.addLast("1") deq.addLast deq "1" {
				deq.pollLast();
			} deq.pollLast() deq.pollLast deq StringBuilder sb = new StringBuilder(); sb new StringBuilder() while (deq.size() != 0) {
			sb.append(deq.pollFirst());
		} deq.size() != 0 deq.size() deq.size deq 0 {
			sb.append(deq.pollFirst());
		} sb.append(deq.pollFirst()) sb.append sb deq.pollFirst() deq.pollFirst deq System.out.println(sb) System.out.println System.out System System.out sb String[] args args public class Main {

	private static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		String s = sc.next();
		Deque<String> deq = new ArrayDeque<>();
		for (int i = 0; i < s.length(); i++) {
			char c = s.charAt(i);
			if (c == '0') {
				deq.addLast("0");
			} else if (c == '1') {
				deq.addLast("1");
			} else {
				deq.pollLast();
			}
		}
		StringBuilder sb = new StringBuilder();
		while (deq.size() != 0) {
			sb.append(deq.pollFirst());
		}
		System.out.println(sb);
	}
} public class Main {

	private static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		String s = sc.next();
		Deque<String> deq = new ArrayDeque<>();
		for (int i = 0; i < s.length(); i++) {
			char c = s.charAt(i);
			if (c == '0') {
				deq.addLast("0");
			} else if (c == '1') {
				deq.addLast("1");
			} else {
				deq.pollLast();
			}
		}
		StringBuilder sb = new StringBuilder();
		while (deq.size() != 0) {
			sb.append(deq.pollFirst());
		}
		System.out.println(sb);
	}
} Main
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Scanner;

public class Main {

	private static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		String s = sc.next();
		Deque<String> deq = new ArrayDeque<>();
		for (int i = 0; i < s.length(); i++) {
			char c = s.charAt(i);
			if (c == '0') {
				deq.addLast("0");
			} else if (c == '1') {
				deq.addLast("1");
			} else {
				deq.pollLast();
			}
		}
		StringBuilder sb = new StringBuilder();
		while (deq.size() != 0) {
			sb.append(deq.pollFirst());
		}
		System.out.println(sb);
	}
}