static int findNthTerm ( int x , int y , int n ) {
  int [ ] f = new int [ 6 ] ;
  f [ 0 ] = x ;
  f [ 1 ] = y ;
  for ( int i = 2 ;
  i <= 5 ;
  i ++ ) f [ i ] = f [ i - 1 ] - f [ i - 2 ] ;
  return f [ n % 6 ] ;
}

static int findNthTerm ( int x , int y , int n ) { int [ ] f = new int [ 6 ] ; f [ 0 ] = x ; f [ 1 ] = y ; for ( int i = 2 ; i <= 5 ; i ++ ) f [ i ] = f [ i - 1 ] - f [ i - 2 ] ; return f [ n % 6 ] ; }
(method_declaration (modifiers) type: (integral_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 (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 (decimal_integer_literal))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (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: (decimal_integer_literal)) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))))) (return_statement (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))))