public static void main ( String [ ] args ) throws FileNotFoundException {
  Scanner cin = new Scanner ( new File ( "D-small-attempt0.in" ) ) ;
  PrintStream cout = new PrintStream ( "D-small-attempt0.out" ) ;
  int _case = 0 ;
  for ( int T = cin . nextInt ( ) ;
  T > 0 ;
  T -- ) {
    _case ++ ;
    StringBuilder ans = new StringBuilder ( ) ;
    int N = cin . nextInt ( ) ;
    int L = cin . nextInt ( ) ;
    String [ ] a = new String [ N ] ;
    boolean impossible = false ;
    for ( int i = 0 ;
    i < N ;
    i ++ ) a [ i ] = cin . next ( ) ;
    String shit = cin . next ( ) ;
    for ( String each : a ) if ( each . equals ( shit ) ) impossible = true ;
    if ( impossible ) ans . append ( "IMPOSSIBLE" ) ;
    else {
      String one = "0" ;
      for ( int i = 0 ;
      i < L - 1 ;
      i ++ ) one += "1" ;
      String two = "" ;
      for ( int i = 0 ;
      i < L ;
      i ++ ) two += "0?" ;
      ans . append ( one ) ;
      ans . append ( " " ) ;
      ans . append ( two ) ;
    }
    cout . printf ( "Case #%d: %s%n" , _case , ans . toString ( ) ) ;
  }
  cin . close ( ) ;
  cout . close ( ) ;
}

public static void main ( String [ ] args ) throws FileNotFoundException { Scanner cin = new Scanner ( new File ( " D - small - attempt0 . in " ) ) ; PrintStream cout = new PrintStream ( " D - small - attempt0 . out " ) ; int _case = 0 ; for ( int T = cin . nextInt ( ) ; T > 0 ; T -- ) { _case ++ ; StringBuilder ans = new StringBuilder ( ) ; int N = cin . nextInt ( ) ; int L = cin . nextInt ( ) ; String [ ] a = new String [ N ] ; boolean impossible = false ; for ( int i = 0 ; i < N ; i ++ ) a [ i ] = cin . next ( ) ; String shit = cin . next ( ) ; for ( String each : a ) if ( each . equals ( shit ) ) impossible = true ; if ( impossible ) ans . append ( " IMPOSSIBLE " ) ; else { String one = "0" ; for ( int i = 0 ; i < L - 1 ; i ++ ) one += "1" ; String two = " " ; for ( int i = 0 ; i < L ; i ++ ) two += "0 ? " ; ans . append ( one ) ; ans . append ( " ▁ " ) ; ans . append ( two ) ; } cout . printf ( " Case ▁ # % d : ▁ % s % n " , _case , ans . toString ( ) ) ; } cin . close ( ) ; cout . 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 (string_literal))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (expression_statement (update_expression (identifier))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_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: (integral_type) 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: (array_creation_expression type: (type_identifier) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (false))) (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 object: (identifier) name: (identifier) arguments: (argument_list))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (enhanced_for_statement type: (type_identifier) name: (identifier) value: (identifier) body: (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) consequence: (expression_statement (assignment_expression left: (identifier) right: (true))))) (if_statement condition: (parenthesized_expression (identifier)) consequence: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal)))) alternative: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (string_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: (binary_expression left: (identifier) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (identifier) right: (string_literal)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (string_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: (expression_statement (assignment_expression left: (identifier) right: (string_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal) (identifier) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))