import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String s = scan.next();
        while(s.contains("B")){
            s = s.replaceAll("^B|[01]B", "");
        }
        System.out.print(s);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String s = scan.next();
        while(s.contains("B")){
            s = s.replaceAll("^B|[01]B", "");
        }
        System.out.print(s);
    }
} Main public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String s = scan.next();
        while(s.contains("B")){
            s = s.replaceAll("^B|[01]B", "");
        }
        System.out.print(s);
    } main {
        Scanner scan = new Scanner(System.in);
        String s = scan.next();
        while(s.contains("B")){
            s = s.replaceAll("^B|[01]B", "");
        }
        System.out.print(s);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String s = scan.next(); s scan.next() scan.next scan while(s.contains("B")){
            s = s.replaceAll("^B|[01]B", "");
        } s.contains("B") s.contains s "B" {
            s = s.replaceAll("^B|[01]B", "");
        } s = s.replaceAll("^B|[01]B", "") s s.replaceAll("^B|[01]B", "") s.replaceAll s "^B|[01]B" "" System.out.print(s) System.out.print System.out System System.out s String[] args args public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String s = scan.next();
        while(s.contains("B")){
            s = s.replaceAll("^B|[01]B", "");
        }
        System.out.print(s);
    }
} public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String s = scan.next();
        while(s.contains("B")){
            s = s.replaceAll("^B|[01]B", "");
        }
        System.out.print(s);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String s = scan.next();
        while(s.contains("B")){
            s = s.replaceAll("^B|[01]B", "");
        }
        System.out.print(s);
    }
}