Statement
There are distinct points in the plane, and no three of them are collinear. A line passing through none of the points is also given. A point moves along from infinity on one side to infinity on the other side.
At every moment, sort around . Starting from a ray parallel to in one fixed direction, list the point indices encountered clockwise. Call the resulting permutation .
The permutation may change several times. If and are the permutations immediately before and after one change, define its amount as
Find the sum of the amounts of all changes modulo .
Input
The input is given in the following format:
Each case is given in the following format:
The equation of is .
Output
For each test case, print the sum of all change amounts modulo .
Constraints
- All points are distinct, and no three points are collinear.
- The line passes through none of the given points.
- The sum of over all test cases does not exceed .