public static void main ( final String ... args ) throws IOException {
  final String fname = "C-large" ;
  final Scanner sc = new Scanner ( new File ( fname + ".in" ) ) ;
  final PrintWriter pw = new PrintWriter ( fname + ".out" ) ;
  final int t = sc . nextInt ( ) ;
  for ( int i = 1 ;
  i <= t ;
  ++ i ) {
    System . out . println ( i ) ;
    final int n = sc . nextInt ( ) ;
    final long [ ] a = new long [ n ] ;
    for ( int j = 0 ;
    j < n ;
    ++ j ) {
      a [ j ] = sc . nextLong ( ) ;
    }
    final Random rnd = new Random ( ) ;
    final Map < Long , Long > m = new HashMap < Long , Long > ( ) ;
    long s1 = - 1 ;
    long s2 = - 1 ;
    while ( true ) {
      long j = rnd . nextLong ( ) ;
      if ( j < 0 ) {
        continue ;
      }
      long x = j ;
      int k = 0 ;
      long s = 0 ;
      while ( x > 0 ) {
        if ( ( x & 1 ) != 0 ) {
          s += a [ k ] ;
        }
        x >>= 1 ;
        ++ k ;
      }
      final Long b = m . get ( s ) ;
      if ( b == null ) {
        m . put ( s , j ) ;
      }
      else if ( b != j ) {
        s1 = b ;
        s2 = j ;
        break ;
      }
    }
    pw . println ( "Case #" + i + ":" ) ;
    int k = 0 ;
    while ( s1 > 0 ) {
      if ( ( s1 & 1 ) != 0 ) {
        pw . print ( a [ k ] + " " ) ;
      }
      s1 >>= 1 ;
      ++ k ;
    }
    pw . println ( ) ;
    k = 0 ;
    while ( s2 > 0 ) {
      if ( ( s2 & 1 ) != 0 ) {
        pw . print ( a [ k ] + " " ) ;
      }
      s2 >>= 1 ;
      ++ k ;
    }
    pw . println ( ) ;
  }
  pw . close ( ) ;
}

public static void main ( final String ... args ) throws IOException { final String fname = " C - large " ; final Scanner sc = new Scanner ( new File ( fname + " . in " ) ) ; final PrintWriter pw = new PrintWriter ( fname + " . out " ) ; final int t = sc . nextInt ( ) ; for ( int i = 1 ; i <= t ; ++ i ) { System . out . println ( i ) ; final int n = sc . nextInt ( ) ; final long [ ] a = new long [ n ] ; for ( int j = 0 ; j < n ; ++ j ) { a [ j ] = sc . nextLong ( ) ; } final Random rnd = new Random ( ) ; final Map < Long , Long > m = new HashMap < Long , Long > ( ) ; long s1 = - 1 ; long s2 = - 1 ; while ( true ) { long j = rnd . nextLong ( ) ; if ( j < 0 ) { continue ; } long x = j ; int k = 0 ; long s = 0 ; while ( x > 0 ) { if ( ( x & 1 ) != 0 ) { s += a [ k ] ; } x >>= 1 ; ++ k ; } final Long b = m . get ( s ) ; if ( b == null ) { m . put ( s , j ) ; } else if ( b != j ) { s1 = b ; s2 = j ; break ; } } pw . println ( " Case ▁ # " + i + " : " ) ; int k = 0 ; while ( s1 > 0 ) { if ( ( s1 & 1 ) != 0 ) { pw . print ( a [ k ] + " ▁ " ) ; } s1 >>= 1 ; ++ k ; } pw . println ( ) ; k = 0 ; while ( s2 > 0 ) { if ( ( s2 & 1 ) != 0 ) { pw . print ( a [ k ] + " ▁ " ) ; } s2 >>= 1 ; ++ k ; } pw . println ( ) ; } pw . close ( ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (spread_parameter (modifiers) (type_identifier) (variable_declarator name: (identifier)))) (throws (type_identifier)) body: (block (local_variable_declaration (modifiers) type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (string_literal))) (local_variable_declaration (modifiers) type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (binary_expression left: (identifier) right: (string_literal)))))))) (local_variable_declaration (modifiers) type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (binary_expression left: (identifier) right: (string_literal)))))) (local_variable_declaration (modifiers) 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 (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier)))) (local_variable_declaration (modifiers) type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration (modifiers) type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (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: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration (modifiers) type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (local_variable_declaration (modifiers) type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal)))) (while_statement condition: (parenthesized_expression (true)) body: (block (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 (continue_statement))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (update_expression (identifier))))) (local_variable_declaration (modifiers) type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (null_literal))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (break_statement)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (string_literal) right: (identifier)) right: (string_literal))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (string_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (update_expression (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (string_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (update_expression (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))