import java.util.*;

public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        System.out.println(execute(sc.nextLine()));

    }

    public static String execute(String input) {
        String[] charArray = input.split("");
        StringBuilder sb = new StringBuilder();
        for(String chara : charArray){
            if(sb.length() != 0 && chara.equals("B")){
                sb.deleteCharAt(sb.length() - 1);
            }
            else if(chara.equals("0") || chara.equals("1")){
                sb.append(chara);
            }
        }

        return sb.toString();
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        System.out.println(execute(sc.nextLine()));

    }

    public static String execute(String input) {
        String[] charArray = input.split("");
        StringBuilder sb = new StringBuilder();
        for(String chara : charArray){
            if(sb.length() != 0 && chara.equals("B")){
                sb.deleteCharAt(sb.length() - 1);
            }
            else if(chara.equals("0") || chara.equals("1")){
                sb.append(chara);
            }
        }

        return sb.toString();
    }
} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        System.out.println(execute(sc.nextLine()));

    } main {

        Scanner sc = new Scanner(System.in);

        System.out.println(execute(sc.nextLine()));

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) System.out.println(execute(sc.nextLine())) System.out.println System.out System System.out execute(sc.nextLine()) execute sc.nextLine() sc.nextLine sc String[] args args public static String execute(String input) {
        String[] charArray = input.split("");
        StringBuilder sb = new StringBuilder();
        for(String chara : charArray){
            if(sb.length() != 0 && chara.equals("B")){
                sb.deleteCharAt(sb.length() - 1);
            }
            else if(chara.equals("0") || chara.equals("1")){
                sb.append(chara);
            }
        }

        return sb.toString();
    } execute {
        String[] charArray = input.split("");
        StringBuilder sb = new StringBuilder();
        for(String chara : charArray){
            if(sb.length() != 0 && chara.equals("B")){
                sb.deleteCharAt(sb.length() - 1);
            }
            else if(chara.equals("0") || chara.equals("1")){
                sb.append(chara);
            }
        }

        return sb.toString();
    } String[] charArray = input.split(""); charArray input.split("") input.split input "" StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(String chara : charArray){
            if(sb.length() != 0 && chara.equals("B")){
                sb.deleteCharAt(sb.length() - 1);
            }
            else if(chara.equals("0") || chara.equals("1")){
                sb.append(chara);
            }
        } String chara charArray {
            if(sb.length() != 0 && chara.equals("B")){
                sb.deleteCharAt(sb.length() - 1);
            }
            else if(chara.equals("0") || chara.equals("1")){
                sb.append(chara);
            }
        } {
            if(sb.length() != 0 && chara.equals("B")){
                sb.deleteCharAt(sb.length() - 1);
            }
            else if(chara.equals("0") || chara.equals("1")){
                sb.append(chara);
            }
        } if(sb.length() != 0 && chara.equals("B")){
                sb.deleteCharAt(sb.length() - 1);
            }
            else if(chara.equals("0") || chara.equals("1")){
                sb.append(chara);
            } sb.length() != 0 && chara.equals("B") sb.length() != 0 sb.length() sb.length sb 0 chara.equals("B") chara.equals chara "B" {
                sb.deleteCharAt(sb.length() - 1);
            } sb.deleteCharAt(sb.length() - 1) sb.deleteCharAt sb sb.length() - 1 sb.length() sb.length sb 1 if(chara.equals("0") || chara.equals("1")){
                sb.append(chara);
            } chara.equals("0") || chara.equals("1") chara.equals("0") chara.equals chara "0" chara.equals("1") chara.equals chara "1" {
                sb.append(chara);
            } sb.append(chara) sb.append sb chara return sb.toString(); sb.toString() sb.toString sb String input input public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        System.out.println(execute(sc.nextLine()));

    }

    public static String execute(String input) {
        String[] charArray = input.split("");
        StringBuilder sb = new StringBuilder();
        for(String chara : charArray){
            if(sb.length() != 0 && chara.equals("B")){
                sb.deleteCharAt(sb.length() - 1);
            }
            else if(chara.equals("0") || chara.equals("1")){
                sb.append(chara);
            }
        }

        return sb.toString();
    }
} public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        System.out.println(execute(sc.nextLine()));

    }

    public static String execute(String input) {
        String[] charArray = input.split("");
        StringBuilder sb = new StringBuilder();
        for(String chara : charArray){
            if(sb.length() != 0 && chara.equals("B")){
                sb.deleteCharAt(sb.length() - 1);
            }
            else if(chara.equals("0") || chara.equals("1")){
                sb.append(chara);
            }
        }

        return sb.toString();
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        System.out.println(execute(sc.nextLine()));

    }

    public static String execute(String input) {
        String[] charArray = input.split("");
        StringBuilder sb = new StringBuilder();
        for(String chara : charArray){
            if(sb.length() != 0 && chara.equals("B")){
                sb.deleteCharAt(sb.length() - 1);
            }
            else if(chara.equals("0") || chara.equals("1")){
                sb.append(chara);
            }
        }

        return sb.toString();
    }
}
