We imagine the infinite 2D plane. We define an up-right path as a path that uses only steps of type up (from the point to the point ), right (from the point to the point ), or up-right (from the point to the point ). For example, a valid path is the following: , , , .
Task
You are given queries, and for each query the numbers , , and . How many paths exist from the point to the point , knowing that we must use exactly up-right steps?
Input data
The first line contains the natural number , with the meaning given in the statement.
Each of the next lines contains a triplet of natural numbers separated by spaces, , , and , with the meaning given in the statement.
Output data
Line should contain the answer for query , modulo .
Constraints and clarifications
- ;
- ;
- ;
- Due to the very large input set, it is recommended to use fastio.
- For tests worth points: ;
- For other tests worth points: ;
- For other tests worth points: ;
- For other tests worth points: ;
- For other tests worth points: no additional constraints.
Example
stdin
8
2 2 1
3 3 0
3 3 1
3 3 2
3 3 3
10 15 8
1000 2000 1000
100000 200000 100000
stdout
6
20
30
12
1
875160
72475738
879467333
Explanation
The solutions for the first query are illustrated below: