
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        while (s.contains("0B") || s.contains("1B")) {

            s = s.replaceAll("0B", "");
            s = s.replaceAll("1B", "");


        }
        s = s.replaceAll("B", "");
        System.out.println(s);


    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        while (s.contains("0B") || s.contains("1B")) {

            s = s.replaceAll("0B", "");
            s = s.replaceAll("1B", "");


        }
        s = s.replaceAll("B", "");
        System.out.println(s);


    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        while (s.contains("0B") || s.contains("1B")) {

            s = s.replaceAll("0B", "");
            s = s.replaceAll("1B", "");


        }
        s = s.replaceAll("B", "");
        System.out.println(s);


    } main {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        while (s.contains("0B") || s.contains("1B")) {

            s = s.replaceAll("0B", "");
            s = s.replaceAll("1B", "");


        }
        s = s.replaceAll("B", "");
        System.out.println(s);


    } Scanner in = new Scanner(System.in); in new Scanner(System.in) String s = in.nextLine(); s in.nextLine() in.nextLine in while (s.contains("0B") || s.contains("1B")) {

            s = s.replaceAll("0B", "");
            s = s.replaceAll("1B", "");


        } s.contains("0B") || s.contains("1B") s.contains("0B") s.contains s "0B" s.contains("1B") s.contains s "1B" {

            s = s.replaceAll("0B", "");
            s = s.replaceAll("1B", "");


        } s = s.replaceAll("0B", "") s s.replaceAll("0B", "") s.replaceAll s "0B" "" s = s.replaceAll("1B", "") s s.replaceAll("1B", "") s.replaceAll s "1B" "" s = s.replaceAll("B", "") s s.replaceAll("B", "") s.replaceAll s "B" "" System.out.println(s) System.out.println System.out System System.out s String[] args args public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        while (s.contains("0B") || s.contains("1B")) {

            s = s.replaceAll("0B", "");
            s = s.replaceAll("1B", "");


        }
        s = s.replaceAll("B", "");
        System.out.println(s);


    }
} public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        while (s.contains("0B") || s.contains("1B")) {

            s = s.replaceAll("0B", "");
            s = s.replaceAll("1B", "");


        }
        s = s.replaceAll("B", "");
        System.out.println(s);


    }
} Main

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        while (s.contains("0B") || s.contains("1B")) {

            s = s.replaceAll("0B", "");
            s = s.replaceAll("1B", "");


        }
        s = s.replaceAll("B", "");
        System.out.println(s);


    }
}
