import java.util.*;

class Main{
    public static void main(String[] arg){
      Scanner sc = new Scanner(System.in);
      String S = sc.nextLine();
      int i = 0;
      while(i < 10){
          S = S.replace("0B","");
          S = S.replace("1B","");
          i++;
      }
      System.out.println(S.replace("B",""));
	}
} import java.util.*; util.* java class Main{
    public static void main(String[] arg){
      Scanner sc = new Scanner(System.in);
      String S = sc.nextLine();
      int i = 0;
      while(i < 10){
          S = S.replace("0B","");
          S = S.replace("1B","");
          i++;
      }
      System.out.println(S.replace("B",""));
	}
} Main public static void main(String[] arg){
      Scanner sc = new Scanner(System.in);
      String S = sc.nextLine();
      int i = 0;
      while(i < 10){
          S = S.replace("0B","");
          S = S.replace("1B","");
          i++;
      }
      System.out.println(S.replace("B",""));
	} main {
      Scanner sc = new Scanner(System.in);
      String S = sc.nextLine();
      int i = 0;
      while(i < 10){
          S = S.replace("0B","");
          S = S.replace("1B","");
          i++;
      }
      System.out.println(S.replace("B",""));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc int i = 0; i 0 while(i < 10){
          S = S.replace("0B","");
          S = S.replace("1B","");
          i++;
      } i < 10 i 10 {
          S = S.replace("0B","");
          S = S.replace("1B","");
          i++;
      } S = S.replace("0B","") S S.replace("0B","") S.replace S "0B" "" S = S.replace("1B","") S S.replace("1B","") S.replace S "1B" "" i++ i System.out.println(S.replace("B","")) System.out.println System.out System System.out S.replace("B","") S.replace S "B" "" String[] arg arg
import java.util.*;

class Main{
    public static void main(String[] arg){
      Scanner sc = new Scanner(System.in);
      String S = sc.nextLine();
      int i = 0;
      while(i < 10){
          S = S.replace("0B","");
          S = S.replace("1B","");
          i++;
      }
      System.out.println(S.replace("B",""));
	}
}
