static long resi ( String s , long value , int position ) {
  if ( jePotpunKvadrat ( value ) ) return value ;
  if ( position == s . length ( ) ) return - 1 ;
  if ( s . charAt ( position ) == '?' ) {
    long res = resi ( s , value , position + 1 ) ;
    if ( res != - 1 ) return res ;
    return resi ( s , value + stepeni [ s . length ( ) - position - 1 ] , position + 1 ) ;
  }
  else return resi ( s , value , position + 1 ) ;
}

static long resi ( String s , long value , int position ) { if ( jePotpunKvadrat ( value ) ) return value ; if ( position == s . length ( ) ) return - 1 ; if ( s . charAt ( position ) == ' ? ' ) { long res = resi ( s , value , position + 1 ) ; if ( res != - 1 ) return res ; return resi ( s , value + stepeni [ s . length ( ) - position - 1 ] , position + 1 ) ; } else return resi ( s , value , position + 1 ) ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (method_invocation name: (identifier) arguments: (argument_list (identifier)))) consequence: (return_statement (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) consequence: (return_statement (unary_expression operand: (decimal_integer_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (unary_expression operand: (decimal_integer_literal)))) consequence: (return_statement (identifier))) (return_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (array_access array: (identifier) index: (binary_expression left: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (identifier)) right: (decimal_integer_literal)))) (binary_expression left: (identifier) right: (decimal_integer_literal)))))) alternative: (return_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal))))))))