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 .
The input is given in the following format:
For each test case, print the sum of all change amounts modulo .
Each case is given in the following format:
The equation of is .