import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    while(true){
      String tmp = str.replace("1B", "").replace("0B", "");
      if(tmp.equals(str)){
        break;
      }
      str = tmp;
    }
    System.out.println(str.replace("B", ""));
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    while(true){
      String tmp = str.replace("1B", "").replace("0B", "");
      if(tmp.equals(str)){
        break;
      }
      str = tmp;
    }
    System.out.println(str.replace("B", ""));
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    while(true){
      String tmp = str.replace("1B", "").replace("0B", "");
      if(tmp.equals(str)){
        break;
      }
      str = tmp;
    }
    System.out.println(str.replace("B", ""));
  } main {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    while(true){
      String tmp = str.replace("1B", "").replace("0B", "");
      if(tmp.equals(str)){
        break;
      }
      str = tmp;
    }
    System.out.println(str.replace("B", ""));
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.next(); str sc.next() sc.next sc while(true){
      String tmp = str.replace("1B", "").replace("0B", "");
      if(tmp.equals(str)){
        break;
      }
      str = tmp;
    } true {
      String tmp = str.replace("1B", "").replace("0B", "");
      if(tmp.equals(str)){
        break;
      }
      str = tmp;
    } String tmp = str.replace("1B", "").replace("0B", ""); tmp str.replace("1B", "").replace("0B", "") str.replace("1B", "").replace str.replace("1B", "") str.replace str "1B" "" "0B" "" if(tmp.equals(str)){
        break;
      } tmp.equals(str) tmp.equals tmp str {
        break;
      } break; str = tmp str tmp System.out.println(str.replace("B", "")) System.out.println System.out System System.out str.replace("B", "") str.replace str "B" "" String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    while(true){
      String tmp = str.replace("1B", "").replace("0B", "");
      if(tmp.equals(str)){
        break;
      }
      str = tmp;
    }
    System.out.println(str.replace("B", ""));
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    while(true){
      String tmp = str.replace("1B", "").replace("0B", "");
      if(tmp.equals(str)){
        break;
      }
      str = tmp;
    }
    System.out.println(str.replace("B", ""));
  }
} Main
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    while(true){
      String tmp = str.replace("1B", "").replace("0B", "");
      if(tmp.equals(str)){
        break;
      }
      str = tmp;
    }
    System.out.println(str.replace("B", ""));
  }
}