import java.util.*;

public class Main {
	  public static void main(String args[]){
      	Scanner scan = new Scanner(System.in);
        StringBuilder sb = new StringBuilder("");
            
        String s = scan.next();
        String cnt = "";
        int i;
        
        for( i = 0 ; i < s.length() ; i++ ){
          if( s.substring(i,i+1).charAt(0) == '0' )sb.insert( sb.length() , "0");
          else if( s.substring(i,i+1).charAt(0) == '1' )sb.insert( sb.length() , "1");
          else{
            if( sb.length() == 0 ){//何もしない
            }
            else if( sb.length() == 1 ){
              sb.setLength(0);
            }
            else{
              sb.setLength( sb.length()-1 );
            }
              
          }

        }
        
        System.out.println(new String(sb));
	  }
} import java.util.*; util.* java public class Main {
	  public static void main(String args[]){
      	Scanner scan = new Scanner(System.in);
        StringBuilder sb = new StringBuilder("");
            
        String s = scan.next();
        String cnt = "";
        int i;
        
        for( i = 0 ; i < s.length() ; i++ ){
          if( s.substring(i,i+1).charAt(0) == '0' )sb.insert( sb.length() , "0");
          else if( s.substring(i,i+1).charAt(0) == '1' )sb.insert( sb.length() , "1");
          else{
            if( sb.length() == 0 ){//何もしない
            }
            else if( sb.length() == 1 ){
              sb.setLength(0);
            }
            else{
              sb.setLength( sb.length()-1 );
            }
              
          }

        }
        
        System.out.println(new String(sb));
	  }
} Main public static void main(String args[]){
      	Scanner scan = new Scanner(System.in);
        StringBuilder sb = new StringBuilder("");
            
        String s = scan.next();
        String cnt = "";
        int i;
        
        for( i = 0 ; i < s.length() ; i++ ){
          if( s.substring(i,i+1).charAt(0) == '0' )sb.insert( sb.length() , "0");
          else if( s.substring(i,i+1).charAt(0) == '1' )sb.insert( sb.length() , "1");
          else{
            if( sb.length() == 0 ){//何もしない
            }
            else if( sb.length() == 1 ){
              sb.setLength(0);
            }
            else{
              sb.setLength( sb.length()-1 );
            }
              
          }

        }
        
        System.out.println(new String(sb));
	  } main {
      	Scanner scan = new Scanner(System.in);
        StringBuilder sb = new StringBuilder("");
            
        String s = scan.next();
        String cnt = "";
        int i;
        
        for( i = 0 ; i < s.length() ; i++ ){
          if( s.substring(i,i+1).charAt(0) == '0' )sb.insert( sb.length() , "0");
          else if( s.substring(i,i+1).charAt(0) == '1' )sb.insert( sb.length() , "1");
          else{
            if( sb.length() == 0 ){//何もしない
            }
            else if( sb.length() == 1 ){
              sb.setLength(0);
            }
            else{
              sb.setLength( sb.length()-1 );
            }
              
          }

        }
        
        System.out.println(new String(sb));
	  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) StringBuilder sb = new StringBuilder(""); sb new StringBuilder("") String s = scan.next(); s scan.next() scan.next scan String cnt = ""; cnt "" int i; i for( i = 0 ; i < s.length() ; i++ ){
          if( s.substring(i,i+1).charAt(0) == '0' )sb.insert( sb.length() , "0");
          else if( s.substring(i,i+1).charAt(0) == '1' )sb.insert( sb.length() , "1");
          else{
            if( sb.length() == 0 ){//何もしない
            }
            else if( sb.length() == 1 ){
              sb.setLength(0);
            }
            else{
              sb.setLength( sb.length()-1 );
            }
              
          }

        } i = 0 ; i = 0 i 0 i < s.length() i s.length() s.length s i++ i++ i {
          if( s.substring(i,i+1).charAt(0) == '0' )sb.insert( sb.length() , "0");
          else if( s.substring(i,i+1).charAt(0) == '1' )sb.insert( sb.length() , "1");
          else{
            if( sb.length() == 0 ){//何もしない
            }
            else if( sb.length() == 1 ){
              sb.setLength(0);
            }
            else{
              sb.setLength( sb.length()-1 );
            }
              
          }

        } {
          if( s.substring(i,i+1).charAt(0) == '0' )sb.insert( sb.length() , "0");
          else if( s.substring(i,i+1).charAt(0) == '1' )sb.insert( sb.length() , "1");
          else{
            if( sb.length() == 0 ){//何もしない
            }
            else if( sb.length() == 1 ){
              sb.setLength(0);
            }
            else{
              sb.setLength( sb.length()-1 );
            }
              
          }

        } if( s.substring(i,i+1).charAt(0) == '0' )sb.insert( sb.length() , "0");
          else if( s.substring(i,i+1).charAt(0) == '1' )sb.insert( sb.length() , "1");
          else{
            if( sb.length() == 0 ){//何もしない
            }
            else if( sb.length() == 1 ){
              sb.setLength(0);
            }
            else{
              sb.setLength( sb.length()-1 );
            }
              
          } s.substring(i,i+1).charAt(0) == '0' s.substring(i,i+1).charAt(0) s.substring(i,i+1).charAt s.substring(i,i+1) s.substring s i i+1 i 1 0 '0' sb.insert( sb.length() , "0") sb.insert sb sb.length() sb.length sb "0" if( s.substring(i,i+1).charAt(0) == '1' )sb.insert( sb.length() , "1");
          else{
            if( sb.length() == 0 ){//何もしない
            }
            else if( sb.length() == 1 ){
              sb.setLength(0);
            }
            else{
              sb.setLength( sb.length()-1 );
            }
              
          } s.substring(i,i+1).charAt(0) == '1' s.substring(i,i+1).charAt(0) s.substring(i,i+1).charAt s.substring(i,i+1) s.substring s i i+1 i 1 0 '1' sb.insert( sb.length() , "1") sb.insert sb sb.length() sb.length sb "1" {
            if( sb.length() == 0 ){//何もしない
            }
            else if( sb.length() == 1 ){
              sb.setLength(0);
            }
            else{
              sb.setLength( sb.length()-1 );
            }
              
          } if( sb.length() == 0 ){//何もしない
            }
            else if( sb.length() == 1 ){
              sb.setLength(0);
            }
            else{
              sb.setLength( sb.length()-1 );
            } sb.length() == 0 sb.length() sb.length sb 0 {//何もしない
            } if( sb.length() == 1 ){
              sb.setLength(0);
            }
            else{
              sb.setLength( sb.length()-1 );
            } sb.length() == 1 sb.length() sb.length sb 1 {
              sb.setLength(0);
            } sb.setLength(0) sb.setLength sb 0 {
              sb.setLength( sb.length()-1 );
            } sb.setLength( sb.length()-1 ) sb.setLength sb sb.length()-1 sb.length() sb.length sb 1 System.out.println(new String(sb)) System.out.println System.out System System.out new String(sb) String args[] args public class Main {
	  public static void main(String args[]){
      	Scanner scan = new Scanner(System.in);
        StringBuilder sb = new StringBuilder("");
            
        String s = scan.next();
        String cnt = "";
        int i;
        
        for( i = 0 ; i < s.length() ; i++ ){
          if( s.substring(i,i+1).charAt(0) == '0' )sb.insert( sb.length() , "0");
          else if( s.substring(i,i+1).charAt(0) == '1' )sb.insert( sb.length() , "1");
          else{
            if( sb.length() == 0 ){//何もしない
            }
            else if( sb.length() == 1 ){
              sb.setLength(0);
            }
            else{
              sb.setLength( sb.length()-1 );
            }
              
          }

        }
        
        System.out.println(new String(sb));
	  }
} public class Main {
	  public static void main(String args[]){
      	Scanner scan = new Scanner(System.in);
        StringBuilder sb = new StringBuilder("");
            
        String s = scan.next();
        String cnt = "";
        int i;
        
        for( i = 0 ; i < s.length() ; i++ ){
          if( s.substring(i,i+1).charAt(0) == '0' )sb.insert( sb.length() , "0");
          else if( s.substring(i,i+1).charAt(0) == '1' )sb.insert( sb.length() , "1");
          else{
            if( sb.length() == 0 ){//何もしない
            }
            else if( sb.length() == 1 ){
              sb.setLength(0);
            }
            else{
              sb.setLength( sb.length()-1 );
            }
              
          }

        }
        
        System.out.println(new String(sb));
	  }
} Main
import java.util.*;

public class Main {
	  public static void main(String args[]){
      	Scanner scan = new Scanner(System.in);
        StringBuilder sb = new StringBuilder("");
            
        String s = scan.next();
        String cnt = "";
        int i;
        
        for( i = 0 ; i < s.length() ; i++ ){
          if( s.substring(i,i+1).charAt(0) == '0' )sb.insert( sb.length() , "0");
          else if( s.substring(i,i+1).charAt(0) == '1' )sb.insert( sb.length() , "1");
          else{
            if( sb.length() == 0 ){//何もしない
            }
            else if( sb.length() == 1 ){
              sb.setLength(0);
            }
            else{
              sb.setLength( sb.length()-1 );
            }
              
          }

        }
        
        System.out.println(new String(sb));
	  }
}