static pair Multiply ( pair p , pair q , int M ) {
  int x = ( ( p . first * q . first ) % M - ( p . second * q . second ) % M + M ) % M ;
  int y = ( ( p . first * q . second ) % M + ( p . second * q . first ) % M ) % M ;
  return new pair ( x , y ) ;
}

static pair Multiply ( pair p , pair q , int M ) { int x = ( ( p . first * q . first ) % M - ( p . second * q . second ) % M + M ) % M ; int y = ( ( p . first * q . second ) % M + ( p . second * q . first ) % M ) % M ; return new pair ( x , y ) ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (field_access object: (identifier) field: (identifier)))) right: (identifier)) right: (binary_expression left: (parenthesized_expression (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (field_access object: (identifier) field: (identifier)))) right: (identifier))) right: (identifier))) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (field_access object: (identifier) field: (identifier)))) right: (identifier)) right: (binary_expression left: (parenthesized_expression (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (field_access object: (identifier) field: (identifier)))) right: (identifier)))) right: (identifier)))) (return_statement (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier) (identifier))))))