public static void main ( String [ ] Args ) throws FileNotFoundException {
  Scanner sc = new Scanner ( new File ( "A-large (1).in" ) ) ;
  PrintWriter out = new PrintWriter ( new File ( "things.out" ) ) ;
  int t = sc . nextInt ( ) , cc = 0 ;
  while ( t -- > 0 ) {
    int n = sc . nextInt ( ) ;
    int l = sc . nextInt ( ) ;
    long [ ] things = new long [ n ] ;
    long [ ] things2 = new long [ n ] ;
    HashSet < Long > hs = new HashSet < Long > ( ) ;
    for ( int k = 0 ;
    k < n ;
    k ++ ) things [ k ] = make ( sc . next ( ) ) ;
    for ( int k = 0 ;
    k < n ;
    k ++ ) {
      things2 [ k ] = make ( sc . next ( ) ) ;
      hs . add ( things2 [ k ] ) ;
    }
    int ans = l + 1 ;
    for ( int k = 0 ;
    k < n ;
    k ++ ) {
      long swit = things [ 0 ] ^ things2 [ k ] ;
      boolean good = true ;
      for ( int j = 0 ;
      good && j < n ;
      j ++ ) if ( ! hs . contains ( things [ j ] ^ swit ) ) good = false ;
      if ( good ) ans = Math . min ( Long . bitCount ( swit ) , ans ) ;
    }
    if ( ans != l + 1 ) out . printf ( "Case #%d: %d%n" , ++ cc , ans ) ;
    else out . printf ( "Case #%d: NOT POSSIBLE%n" , ++ cc ) ;
  }
  out . close ( ) ;
}

public static void main ( String [ ] Args ) throws FileNotFoundException { Scanner sc = new Scanner ( new File ( " A - large ▁ ( 1 ) . in " ) ) ; PrintWriter out = new PrintWriter ( new File ( " things . out " ) ) ; int t = sc . nextInt ( ) , cc = 0 ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; int l = sc . nextInt ( ) ; long [ ] things = new long [ n ] ; long [ ] things2 = new long [ n ] ; HashSet < Long > hs = new HashSet < Long > ( ) ; for ( int k = 0 ; k < n ; k ++ ) things [ k ] = make ( sc . next ( ) ) ; for ( int k = 0 ; k < n ; k ++ ) { things2 [ k ] = make ( sc . next ( ) ) ; hs . add ( things2 [ k ] ) ; } int ans = l + 1 ; for ( int k = 0 ; k < n ; k ++ ) { long swit = things [ 0 ] ^ things2 [ k ] ; boolean good = true ; for ( int j = 0 ; good && j < n ; j ++ ) if ( ! hs . contains ( things [ j ] ^ swit ) ) good = false ; if ( good ) ans = Math . min ( Long . bitCount ( swit ) , ans ) ; } if ( ans != l + 1 ) out . printf ( " Case ▁ # % d : ▁ % d % n " , ++ cc , ans ) ; else out . printf ( " Case ▁ # % d : ▁ NOT ▁ POSSIBLE % n " , ++ cc ) ; } out . close ( ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_identifier)) body: (block (local_variable_declaration 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 (string_literal))))))) (local_variable_declaration 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 (string_literal))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (update_expression (identifier)) right: (decimal_integer_literal))) 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: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (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 (type_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: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation name: (identifier) arguments: (argument_list (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 (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (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 (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (identifier))))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (true))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier))) update: (update_expression (identifier)) body: (if_statement condition: (parenthesized_expression (unary_expression operand: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier)))))) consequence: (expression_statement (assignment_expression left: (identifier) right: (false))))) (if_statement condition: (parenthesized_expression (identifier)) consequence: (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) (identifier)))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal) (update_expression (identifier)) (identifier)))) alternative: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal) (update_expression (identifier)))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))