public static void main ( String [ ] args ) {
  MyScanner sc = new MyScanner ( ) ;
  String s = sc . next ( ) ;
  StringBuffer buf = new StringBuffer ( ) ;
  int l = s . length ( ) ;
  for ( int i = 0 ;
  i < l ;
  i ++ ) {
    switch ( s . charAt ( i ) ) {
      case ( '1' ) : buf . append ( "1" ) ;
      break ;
      case ( '0' ) : buf . append ( "0" ) ;
      break ;
      case ( 'B' ) : int a = buf . length ( ) ;
      if ( a != 0 ) {
        buf . deleteCharAt ( a - 1 ) ;
      }
      break ;
    }
  }
  String ans = buf . toString ( ) ;
  System . out . println ( ans ) ;
}

public static void main ( String [ ] args ) { MyScanner sc = new MyScanner ( ) ; String s = sc . next ( ) ; StringBuffer buf = new StringBuffer ( ) ; int l = s . length ( ) ; for ( int i = 0 ; i < l ; i ++ ) { switch ( s . charAt ( i ) ) { case ( '1' ) : buf . append ( "1" ) ; break ; case ( '0' ) : buf . append ( "0" ) ; break ; case ( ' B ' ) : int a = buf . length ( ) ; if ( a != 0 ) { buf . deleteCharAt ( a - 1 ) ; } break ; } } String ans = buf . toString ( ) ; System . out . println ( ans ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (switch_expression condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) body: (switch_block (switch_block_statement_group (switch_label (parenthesized_expression (character_literal))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal)))) (break_statement)) (switch_block_statement_group (switch_label (parenthesized_expression (character_literal))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal)))) (break_statement)) (switch_block_statement_group (switch_label (parenthesized_expression (character_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal))))))) (break_statement)))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))