public static String solve ( ) {
  String out = "" ;
  int B = in . nextInt ( ) ;
  long M = in . nextLong ( ) - 1 ;
  String binary = "" ;
  while ( M > 0 ) {
    binary += M % 2 ;
    M = M / 2 ;
  }
  System . err . println ( binary ) ;
  if ( binary . length ( ) > B - 2 ) {
    out = "IMPOSSIBLE" ;
  }
  else {
    out = "POSSIBLE" ;
    for ( int i = 0 ;
    i < B ;
    i ++ ) {
      String line = "" ;
      for ( int j = 0 ;
      j <= i ;
      j ++ ) {
        line += "0" ;
      }
      for ( int j = 0 ;
      j < B - 2 - i ;
      j ++ ) {
        line += "1" ;
      }
      if ( i < B - 1 ) {
        if ( i == 0 ) {
          line += "1" ;
        }
        else if ( i - 1 < binary . length ( ) ) {
          line += binary . charAt ( i - 1 ) ;
        }
        else {
          line += "0" ;
        }
      }
      out += "\n" + line ;
    }
  }
  return out ;
}

public static String solve ( ) { String out = " " ; int B = in . nextInt ( ) ; long M = in . nextLong ( ) - 1 ; String binary = " " ; while ( M > 0 ) { binary += M % 2 ; M = M / 2 ; } System . err . println ( binary ) ; if ( binary . length ( ) > B - 2 ) { out = " IMPOSSIBLE " ; } else { out = " POSSIBLE " ; for ( int i = 0 ; i < B ; i ++ ) { String line = " " ; for ( int j = 0 ; j <= i ; j ++ ) { line += "0" ; } for ( int j = 0 ; j < B - 2 - i ; j ++ ) { line += "1" ; } if ( i < B - 1 ) { if ( i == 0 ) { line += "1" ; } else if ( i - 1 < binary . length ( ) ) { line += binary . charAt ( i - 1 ) ; } else { line += "0" ; } } out += " \n " + line ; } } return out ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (string_literal))) (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: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (string_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (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: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (string_literal)))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (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: (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: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (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: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier))) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (string_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (string_literal)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal))))))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (string_literal)))))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (string_literal) right: (identifier)))))))) (return_statement (identifier))))