public static void main ( String [ ] args ) throws Exception {
  Scanner in = new Scanner ( new File ( "input.txt" ) ) ;
  PrintWriter out = new PrintWriter ( "output.txt" ) ;
  int test = Integer . parseInt ( in . nextLine ( ) ) ;
  for ( int t = 1 ;
  t <= test ;
  t ++ ) {
    String nums = in . nextLine ( ) ;
    StringTokenizer st = new StringTokenizer ( nums ) ;
    int r = Integer . parseInt ( st . nextToken ( ) ) ;
    int c = Integer . parseInt ( st . nextToken ( ) ) ;
    char [ ] [ ] map = new char [ r ] [ c ] ;
    for ( int i = 0 ;
    i < r ;
    i ++ ) {
      String row = in . nextLine ( ) ;
      map [ i ] = row . toCharArray ( ) ;
    }
    for ( int i = 0 ;
    i < r - 1 ;
    i ++ ) {
      for ( int j = 0 ;
      j < c - 1 ;
      j ++ ) {
        if ( map [ i ] [ j ] == '#' && map [ i ] [ j + 1 ] == '#' && map [ i + 1 ] [ j ] == '#' && map [ i + 1 ] [ j + 1 ] == '#' ) {
          map [ i ] [ j ] = '/' ;
          map [ i + 1 ] [ j + 1 ] = '/' ;
          map [ i ] [ j + 1 ] = '\\';map[i+1][j]=' ▁ \ ▁ \ ▁ ';}}}booleanok=true;for(inti=0;i<r;i++)for(intj=0;j<c;j++)if(map[i][j]==' ▁ # ▁ ' ) ok = false ;
          out . println ( " ▁ Case ▁ ▁ ▁ # ▁ " + t + " ▁ : ▁ " ) ;
          if ( ! ok ) out . println ( " ▁ Impossible ▁ " ) ;
          else {
            for ( int i = 0 ;
            i < r ;
            i ++ ) {
              for ( int j = 0 ;
              j < c ;
              j ++ ) out . print ( map [ i ] [ j ] ) ;
              out . println ( ) ;
            }
          }
        }
        out . close ( ) ;
      }
      
public static void main ( String [ ] args ) throws Exception { Scanner in = new Scanner ( new File ( " input . txt " ) ) ; PrintWriter out = new PrintWriter ( " output . txt " ) ; int test = Integer . parseInt ( in . nextLine ( ) ) ; for ( int t = 1 ; t <= test ; t ++ ) { String nums = in . nextLine ( ) ; StringTokenizer st = new StringTokenizer ( nums ) ; int r = Integer . parseInt ( st . nextToken ( ) ) ; int c = Integer . parseInt ( st . nextToken ( ) ) ; char [ ] [ ] map = new char [ r ] [ c ] ; for ( int i = 0 ; i < r ; i ++ ) { String row = in . nextLine ( ) ; map [ i ] = row . toCharArray ( ) ; } for ( int i = 0 ; i < r - 1 ; i ++ ) { for ( int j = 0 ; j < c - 1 ; j ++ ) { if ( map [ i ] [ j ] == ' # ' && map [ i ] [ j + 1 ] == ' # ' && map [ i + 1 ] [ j ] == ' # ' && map [ i + 1 ] [ j + 1 ] == ' # ' ) { map [ i ] [ j ] = ' / ' ; map [ i + 1 ] [ j + 1 ] = ' / ' ; map [ i ] [ j + 1 ] = ' \ \' ; map [ i + 1 ] [ j ] = ' ▁ \ ▁ \ ▁ ' ; } } } booleanok = true ; for ( inti = 0 ; i < r ; i ++ ) for ( intj = 0 ; j < c ; j ++ ) if ( map [ i ] [ j ] == ' ▁ # ▁ ' ) ok = false ; out . println ( " ▁ Case ▁ ▁ ▁ # ▁ " + t + " ▁ : ▁ " ) ; if ( ! ok ) out . println ( " ▁ Impossible ▁ " ) ; else { for ( int i = 0 ; i < r ; i ++ ) { for ( int j = 0 ; j < c ; j ++ ) out . print ( map [ i ] [ j ] ) ; out . println ( ) ; } } } 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 (string_literal))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) 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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (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 (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)) 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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (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: (binary_expression left: (identifier) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (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: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (character_literal)) right: (binary_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (character_literal))) right: (binary_expression left: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (identifier)) right: (character_literal))) right: (binary_expression left: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (character_literal)))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (character_literal))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (character_literal))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (character_literal))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (identifier)) right: (character_literal))))))))) (expression_statement (assignment_expression left: (identifier) right: (true))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (character_literal))) consequence: (expression_statement (assignment_expression left: (identifier) right: (false)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (string_literal) right: (identifier)) right: (string_literal))))) (if_statement condition: (parenthesized_expression (unary_expression operand: (identifier))) consequence: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal)))) alternative: (block (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 (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 (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))