public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  int K = sc . nextInt ( ) ;
  char [ ] s = sc . next ( ) . toCharArray ( ) ;
  Koshi koshi = new Koshi ( 0 , 0 ) ;
  koshi . reLink ( ) ;
  for ( int i = 0 ;
  i < K ;
  i ++ ) {
    switch ( s [ i ] ) {
      case 'L' : koshi = koshi . left ;
      break ;
      case 'R' : koshi = koshi . right ;
      break ;
      case 'U' : koshi = koshi . up ;
      break ;
      case 'D' : koshi = koshi . down ;
      break ;
    }
    koshi . reLink ( ) ;
  }
  System . out . println ( koshi . x + " " + koshi . y ) ;
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int K = sc . nextInt ( ) ; char [ ] s = sc . next ( ) . toCharArray ( ) ; Koshi koshi = new Koshi ( 0 , 0 ) ; koshi . reLink ( ) ; for ( int i = 0 ; i < K ; i ++ ) { switch ( s [ i ] ) { case ' L ' : koshi = koshi . left ; break ; case ' R ' : koshi = koshi . right ; break ; case ' U ' : koshi = koshi . up ; break ; case ' D ' : koshi = koshi . down ; break ; } koshi . reLink ( ) ; } System . out . println ( koshi . x + " ▁ " + koshi . y ) ; }
(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 (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) 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 (decimal_integer_literal) (decimal_integer_literal))))) (expression_statement (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 (array_access array: (identifier) index: (identifier))) body: (switch_block (switch_block_statement_group (switch_label (character_literal)) (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) (break_statement)) (switch_block_statement_group (switch_label (character_literal)) (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) (break_statement)) (switch_block_statement_group (switch_label (character_literal)) (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) (break_statement)) (switch_block_statement_group (switch_label (character_literal)) (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) (break_statement)))) (expression_statement (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 (binary_expression left: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (string_literal)) right: (field_access object: (identifier) field: (identifier))))))))