import javax.print.DocFlavor;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.util.*;

public class Main {

    //グローバル変数を定義
    List<char[]> list = new ArrayList<>();

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    void run() {
        Scanner sc = new Scanner(System.in);
        char[] input = sc.next().toCharArray();
        StringBuilder str = new StringBuilder();

        for(char c: input){
            if(c == '0'){
                str.append("0");
            } else if(c == '1'){
                str.append("1");
            } else {
                if(str.length() > 0){
                    str.deleteCharAt(str.length()-1);
                }
            }
        }

        System.out.println(str.toString());
    }
} import javax.print.DocFlavor; DocFlavor javax.print import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.math.BigDecimal; BigDecimal java.math import java.nio.charset.StandardCharsets; StandardCharsets java.nio.charset import java.util.*; util.* java public class Main {

    //グローバル変数を定義
    List<char[]> list = new ArrayList<>();

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    void run() {
        Scanner sc = new Scanner(System.in);
        char[] input = sc.next().toCharArray();
        StringBuilder str = new StringBuilder();

        for(char c: input){
            if(c == '0'){
                str.append("0");
            } else if(c == '1'){
                str.append("1");
            } else {
                if(str.length() > 0){
                    str.deleteCharAt(str.length()-1);
                }
            }
        }

        System.out.println(str.toString());
    }
} Main //グローバル変数を定義
    List<char[]> list = new ArrayList<>(); list new ArrayList<>() public static void main(String[] args) throws IOException {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args void run() {
        Scanner sc = new Scanner(System.in);
        char[] input = sc.next().toCharArray();
        StringBuilder str = new StringBuilder();

        for(char c: input){
            if(c == '0'){
                str.append("0");
            } else if(c == '1'){
                str.append("1");
            } else {
                if(str.length() > 0){
                    str.deleteCharAt(str.length()-1);
                }
            }
        }

        System.out.println(str.toString());
    } run {
        Scanner sc = new Scanner(System.in);
        char[] input = sc.next().toCharArray();
        StringBuilder str = new StringBuilder();

        for(char c: input){
            if(c == '0'){
                str.append("0");
            } else if(c == '1'){
                str.append("1");
            } else {
                if(str.length() > 0){
                    str.deleteCharAt(str.length()-1);
                }
            }
        }

        System.out.println(str.toString());
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] input = sc.next().toCharArray(); input sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc StringBuilder str = new StringBuilder(); str new StringBuilder() for(char c: input){
            if(c == '0'){
                str.append("0");
            } else if(c == '1'){
                str.append("1");
            } else {
                if(str.length() > 0){
                    str.deleteCharAt(str.length()-1);
                }
            }
        } char c input {
            if(c == '0'){
                str.append("0");
            } else if(c == '1'){
                str.append("1");
            } else {
                if(str.length() > 0){
                    str.deleteCharAt(str.length()-1);
                }
            }
        } {
            if(c == '0'){
                str.append("0");
            } else if(c == '1'){
                str.append("1");
            } else {
                if(str.length() > 0){
                    str.deleteCharAt(str.length()-1);
                }
            }
        } if(c == '0'){
                str.append("0");
            } else if(c == '1'){
                str.append("1");
            } else {
                if(str.length() > 0){
                    str.deleteCharAt(str.length()-1);
                }
            } c == '0' c '0' {
                str.append("0");
            } str.append("0") str.append str "0" if(c == '1'){
                str.append("1");
            } else {
                if(str.length() > 0){
                    str.deleteCharAt(str.length()-1);
                }
            } c == '1' c '1' {
                str.append("1");
            } str.append("1") str.append str "1" {
                if(str.length() > 0){
                    str.deleteCharAt(str.length()-1);
                }
            } if(str.length() > 0){
                    str.deleteCharAt(str.length()-1);
                } str.length() > 0 str.length() str.length str 0 {
                    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 public class Main {

    //グローバル変数を定義
    List<char[]> list = new ArrayList<>();

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    void run() {
        Scanner sc = new Scanner(System.in);
        char[] input = sc.next().toCharArray();
        StringBuilder str = new StringBuilder();

        for(char c: input){
            if(c == '0'){
                str.append("0");
            } else if(c == '1'){
                str.append("1");
            } else {
                if(str.length() > 0){
                    str.deleteCharAt(str.length()-1);
                }
            }
        }

        System.out.println(str.toString());
    }
} public class Main {

    //グローバル変数を定義
    List<char[]> list = new ArrayList<>();

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    void run() {
        Scanner sc = new Scanner(System.in);
        char[] input = sc.next().toCharArray();
        StringBuilder str = new StringBuilder();

        for(char c: input){
            if(c == '0'){
                str.append("0");
            } else if(c == '1'){
                str.append("1");
            } else {
                if(str.length() > 0){
                    str.deleteCharAt(str.length()-1);
                }
            }
        }

        System.out.println(str.toString());
    }
} Main
import javax.print.DocFlavor;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.util.*;

public class Main {

    //グローバル変数を定義
    List<char[]> list = new ArrayList<>();

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    void run() {
        Scanner sc = new Scanner(System.in);
        char[] input = sc.next().toCharArray();
        StringBuilder str = new StringBuilder();

        for(char c: input){
            if(c == '0'){
                str.append("0");
            } else if(c == '1'){
                str.append("1");
            } else {
                if(str.length() > 0){
                    str.deleteCharAt(str.length()-1);
                }
            }
        }

        System.out.println(str.toString());
    }
}
