static void solve ( ) {
  int n = sc . nextInt ( ) ;
  int k = sc . nextInt ( ) ;
  boolean [ ] arr = new boolean [ n + 1 ] ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    arr [ sc . nextInt ( ) ] = true ;
  }
  List < Integer > al = new ArrayList < > ( ) ;
  for ( int i = 1 ;
  i <= n ;
  i ++ ) if ( arr [ i ] ) al . add ( i ) ;
  if ( al . size ( ) > k ) {
    System . out . println ( - 1 ) ;
    return ;
  }
  while ( al . size ( ) < k ) {
    al . add ( 1 ) ;
  }
  System . out . println ( n * k ) ;
  for ( int i = 1 ;
  i <= n ;
  i ++ ) for ( Integer j : al ) System . out . print ( j + " " ) ;
  System . out . println ( ) ;
}

static void solve ( ) { int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; boolean [ ] arr = new boolean [ n + 1 ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ sc . nextInt ( ) ] = true ; } List < Integer > al = new ArrayList < > ( ) ; for ( int i = 1 ; i <= n ; i ++ ) if ( arr [ i ] ) al . add ( i ) ; if ( al . size ( ) > k ) { System . out . println ( - 1 ) ; return ; } while ( al . size ( ) < k ) { al . add ( 1 ) ; } System . out . println ( n * k ) ; for ( int i = 1 ; i <= n ; i ++ ) for ( Integer j : al ) System . out . print ( j + " ▁ " ) ; System . out . println ( ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters) body: (block (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: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (array_type element: (boolean_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (boolean_type) dimensions: (dimensions_expr (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (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 (expression_statement (assignment_expression left: (array_access array: (identifier) index: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) right: (true))))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments)) 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: (if_statement condition: (parenthesized_expression (array_access array: (identifier) index: (identifier))) consequence: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (identifier))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (unary_expression operand: (decimal_integer_literal))))) (return_statement))) (while_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (identifier))) body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal)))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier))))) (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: (enhanced_for_statement type: (type_identifier) name: (identifier) value: (identifier) body: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (string_literal))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list)))))