
import java.io.*;
import java.util.*;
//import java.util.stream.*;;
//import java.math.*;

public class Main {

    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        Scanner sc = new Scanner(System.in);
        String s = br.readLine();
        StringBuilder str = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                str.append("0");
            } else if (s.charAt(i) == '1') {
                str.append("1");
            } else if (str.length() - 1 >= 0 && str.toString() != null) {
                str.deleteCharAt(str.length() - 1);
            }
        }
        System.out.println(str.toString());
        bw.flush();
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {

    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        Scanner sc = new Scanner(System.in);
        String s = br.readLine();
        StringBuilder str = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                str.append("0");
            } else if (s.charAt(i) == '1') {
                str.append("1");
            } else if (str.length() - 1 >= 0 && str.toString() != null) {
                str.deleteCharAt(str.length() - 1);
            }
        }
        System.out.println(str.toString());
        bw.flush();
    }
} Main public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        Scanner sc = new Scanner(System.in);
        String s = br.readLine();
        StringBuilder str = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                str.append("0");
            } else if (s.charAt(i) == '1') {
                str.append("1");
            } else if (str.length() - 1 >= 0 && str.toString() != null) {
                str.deleteCharAt(str.length() - 1);
            }
        }
        System.out.println(str.toString());
        bw.flush();
    } main {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        Scanner sc = new Scanner(System.in);
        String s = br.readLine();
        StringBuilder str = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                str.append("0");
            } else if (s.charAt(i) == '1') {
                str.append("1");
            } else if (str.length() - 1 >= 0 && str.toString() != null) {
                str.deleteCharAt(str.length() - 1);
            }
        }
        System.out.println(str.toString());
        bw.flush();
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); bw new BufferedWriter(new OutputStreamWriter(System.out)) Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = br.readLine(); s br.readLine() br.readLine br StringBuilder str = new StringBuilder(); str new StringBuilder() for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                str.append("0");
            } else if (s.charAt(i) == '1') {
                str.append("1");
            } else if (str.length() - 1 >= 0 && str.toString() != null) {
                str.deleteCharAt(str.length() - 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') {
                str.append("0");
            } else if (s.charAt(i) == '1') {
                str.append("1");
            } else if (str.length() - 1 >= 0 && str.toString() != null) {
                str.deleteCharAt(str.length() - 1);
            }
        } {
            if (s.charAt(i) == '0') {
                str.append("0");
            } else if (s.charAt(i) == '1') {
                str.append("1");
            } else if (str.length() - 1 >= 0 && str.toString() != null) {
                str.deleteCharAt(str.length() - 1);
            }
        } if (s.charAt(i) == '0') {
                str.append("0");
            } else if (s.charAt(i) == '1') {
                str.append("1");
            } else if (str.length() - 1 >= 0 && str.toString() != null) {
                str.deleteCharAt(str.length() - 1);
            } s.charAt(i) == '0' s.charAt(i) s.charAt s i '0' {
                str.append("0");
            } str.append("0") str.append str "0" if (s.charAt(i) == '1') {
                str.append("1");
            } else if (str.length() - 1 >= 0 && str.toString() != null) {
                str.deleteCharAt(str.length() - 1);
            } s.charAt(i) == '1' s.charAt(i) s.charAt s i '1' {
                str.append("1");
            } str.append("1") str.append str "1" if (str.length() - 1 >= 0 && str.toString() != null) {
                str.deleteCharAt(str.length() - 1);
            } str.length() - 1 >= 0 && str.toString() != null str.length() - 1 >= 0 str.length() - 1 str.length() str.length str 1 0 str.toString() != null str.toString() str.toString str null {
                str.deleteCharAt(str.length() - 1);
            } str.deleteCharAt(str.length() - 1) str.deleteCharAt str str.length() - 1 str.length() str.length str 1 System.out.println(str.toString()) System.out.println System.out System System.out str.toString() str.toString str bw.flush() bw.flush bw String[] args args public class Main {

    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        Scanner sc = new Scanner(System.in);
        String s = br.readLine();
        StringBuilder str = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                str.append("0");
            } else if (s.charAt(i) == '1') {
                str.append("1");
            } else if (str.length() - 1 >= 0 && str.toString() != null) {
                str.deleteCharAt(str.length() - 1);
            }
        }
        System.out.println(str.toString());
        bw.flush();
    }
} public class Main {

    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        Scanner sc = new Scanner(System.in);
        String s = br.readLine();
        StringBuilder str = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                str.append("0");
            } else if (s.charAt(i) == '1') {
                str.append("1");
            } else if (str.length() - 1 >= 0 && str.toString() != null) {
                str.deleteCharAt(str.length() - 1);
            }
        }
        System.out.println(str.toString());
        bw.flush();
    }
} Main

import java.io.*;
import java.util.*;
//import java.util.stream.*;;
//import java.math.*;

public class Main {

    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        Scanner sc = new Scanner(System.in);
        String s = br.readLine();
        StringBuilder str = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                str.append("0");
            } else if (s.charAt(i) == '1') {
                str.append("1");
            } else if (str.length() - 1 >= 0 && str.toString() != null) {
                str.deleteCharAt(str.length() - 1);
            }
        }
        System.out.println(str.toString());
        bw.flush();
    }
}
