import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    
    StringBuilder sb = new StringBuilder();
    for(int i=0;i<s.length();i++){
      switch(s.charAt(i)){
        case '1':
          sb.append('1');break;
        case '0':
          sb.append('0');break;
        case 'B':
          if(sb.length()>=1){
            sb.setLength(sb.length()-1);
          }
          break;
      }
    }
    System.out.print(sb.toString());
    System.out.flush();
  }
} import java.util.Scanner; Scanner java.util class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    
    StringBuilder sb = new StringBuilder();
    for(int i=0;i<s.length();i++){
      switch(s.charAt(i)){
        case '1':
          sb.append('1');break;
        case '0':
          sb.append('0');break;
        case 'B':
          if(sb.length()>=1){
            sb.setLength(sb.length()-1);
          }
          break;
      }
    }
    System.out.print(sb.toString());
    System.out.flush();
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    
    StringBuilder sb = new StringBuilder();
    for(int i=0;i<s.length();i++){
      switch(s.charAt(i)){
        case '1':
          sb.append('1');break;
        case '0':
          sb.append('0');break;
        case 'B':
          if(sb.length()>=1){
            sb.setLength(sb.length()-1);
          }
          break;
      }
    }
    System.out.print(sb.toString());
    System.out.flush();
  } main {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    
    StringBuilder sb = new StringBuilder();
    for(int i=0;i<s.length();i++){
      switch(s.charAt(i)){
        case '1':
          sb.append('1');break;
        case '0':
          sb.append('0');break;
        case 'B':
          if(sb.length()>=1){
            sb.setLength(sb.length()-1);
          }
          break;
      }
    }
    System.out.print(sb.toString());
    System.out.flush();
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(int i=0;i<s.length();i++){
      switch(s.charAt(i)){
        case '1':
          sb.append('1');break;
        case '0':
          sb.append('0');break;
        case 'B':
          if(sb.length()>=1){
            sb.setLength(sb.length()-1);
          }
          break;
      }
    } int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
      switch(s.charAt(i)){
        case '1':
          sb.append('1');break;
        case '0':
          sb.append('0');break;
        case 'B':
          if(sb.length()>=1){
            sb.setLength(sb.length()-1);
          }
          break;
      }
    } {
      switch(s.charAt(i)){
        case '1':
          sb.append('1');break;
        case '0':
          sb.append('0');break;
        case 'B':
          if(sb.length()>=1){
            sb.setLength(sb.length()-1);
          }
          break;
      }
    } switch(s.charAt(i)){
        case '1':
          sb.append('1');break;
        case '0':
          sb.append('0');break;
        case 'B':
          if(sb.length()>=1){
            sb.setLength(sb.length()-1);
          }
          break;
      } s.charAt(i) s.charAt s i case '1': '1' case '1': sb.append('1') sb.append sb '1' break; case '0': '0' case '0': sb.append('0') sb.append sb '0' break; case 'B': 'B' case 'B': if(sb.length()>=1){
            sb.setLength(sb.length()-1);
          } sb.length()>=1 sb.length() sb.length sb 1 {
            sb.setLength(sb.length()-1);
          } sb.setLength(sb.length()-1) sb.setLength sb sb.length()-1 sb.length() sb.length sb 1 break; System.out.print(sb.toString()) System.out.print System.out System System.out sb.toString() sb.toString sb System.out.flush() System.out.flush System.out System System.out String[] args args
import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    
    StringBuilder sb = new StringBuilder();
    for(int i=0;i<s.length();i++){
      switch(s.charAt(i)){
        case '1':
          sb.append('1');break;
        case '0':
          sb.append('0');break;
        case 'B':
          if(sb.length()>=1){
            sb.setLength(sb.length()-1);
          }
          break;
      }
    }
    System.out.print(sb.toString());
    System.out.flush();
  }
}
