public static void main ( String [ ] args ) {
  Scanner scanner = new Scanner ( System . in ) ;
  String probCount = scanner . nextLine ( ) ;
  String [ ] timesList = scanner . nextLine ( ) . split ( " " ) ;
  Integer drinkCount = new Integer ( scanner . nextLine ( ) ) ;
  IntStream . range ( 0 , drinkCount ) . forEach ( i -> {
    String [ ] pair = scanner . nextLine ( ) . split ( " " ) ;
    Integer nProb = new Integer ( pair [ 0 ] ) ;
    String nTime = pair [ 1 ] ;
    String [ ] copiedList = new String [ timesList . length ] ;
    System . arraycopy ( timesList , 0 , copiedList , 0 , timesList . length ) ;
    copiedList [ nProb - 1 ] = nTime ;
    System . out . println ( addTimes ( copiedList ) ) ;
  }
  ) ;
}

public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String probCount = scanner . nextLine ( ) ; String [ ] timesList = scanner . nextLine ( ) . split ( " ▁ " ) ; Integer drinkCount = new Integer ( scanner . nextLine ( ) ) ; IntStream . range ( 0 , drinkCount ) . forEach ( i -> { String [ ] pair = scanner . nextLine ( ) . split ( " ▁ " ) ; Integer nProb = new Integer ( pair [ 0 ] ) ; String nTime = pair [ 1 ] ; String [ ] copiedList = new String [ timesList . length ] ; System . arraycopy ( timesList , 0 , copiedList , 0 , timesList . length ) ; copiedList [ nProb - 1 ] = nTime ; System . out . println ( addTimes ( copiedList ) ) ; } ) ; }
(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: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (array_type element: (type_identifier) 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 (string_literal))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (expression_statement (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (identifier))) name: (identifier) arguments: (argument_list (lambda_expression parameters: (identifier) body: (block (local_variable_declaration type: (array_type element: (type_identifier) 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 (string_literal))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (array_access array: (identifier) index: (decimal_integer_literal)))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (decimal_integer_literal)))) (local_variable_declaration type: (array_type element: (type_identifier) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (type_identifier) dimensions: (dimensions_expr (field_access object: (identifier) field: (identifier)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (decimal_integer_literal) (identifier) (decimal_integer_literal) (field_access object: (identifier) field: (identifier))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (identifier))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation name: (identifier) arguments: (argument_list (identifier)))))))))))))