static void dfs ( int row , int col , int step ) {
  if ( row < 0 || row >= 8 || col < 0 || col >= 8 ) return ;
  if ( board [ row ] [ col ] == 'A' || step >= 7 ) {
    System . out . println ( "WIN" ) ;
    System . exit ( 0 ) ;
  }
  for ( int i = - 1 ;
  i <= 1 ;
  i ++ ) for ( int j = - 1 ;
  j <= 1 ;
  j ++ ) {
    int x = row + i ;
    int y = col + j ;
    if ( x < 0 || x >= 8 || y < 0 || y >= 8 ) continue ;
    if ( x - step >= 0 && board [ x - step ] [ y ] == 'S' ) continue ;
    if ( x - step - 1 >= 0 && board [ x - step - 1 ] [ y ] == 'S' ) continue ;
    dfs ( x , y , step + 1 ) ;
  }
}

static void dfs ( int row , int col , int step ) { if ( row < 0 || row >= 8 || col < 0 || col >= 8 ) return ; if ( board [ row ] [ col ] == ' A ' || step >= 7 ) { System . out . println ( " WIN " ) ; System . exit ( 0 ) ; } for ( int i = - 1 ; i <= 1 ; i ++ ) for ( int j = - 1 ; j <= 1 ; j ++ ) { int x = row + i ; int y = col + j ; if ( x < 0 || x >= 8 || y < 0 || y >= 8 ) continue ; if ( x - step >= 0 && board [ x - step ] [ y ] == ' S ' ) continue ; if ( x - step - 1 >= 0 && board [ x - step - 1 ] [ y ] == ' S ' ) continue ; dfs ( x , y , step + 1 ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (return_statement)) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (character_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal)))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (continue_statement)) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)) right: (binary_expression left: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))) index: (identifier)) right: (character_literal)))) consequence: (continue_statement)) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)) right: (decimal_integer_literal)) right: (binary_expression left: (array_access array: (array_access array: (identifier) index: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) index: (identifier)) right: (character_literal)))) consequence: (continue_statement)) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal))))))))))