You construct a permutation of length in the following way.
The number line has points . The distance between points and is . Also, there is a sequence that is initially empty. Repeat the following operations from any point until the length of is .
Let be the number corresponding to the current point. If is not in , add to the end of . Next, move to one of the points whose distance is less than or equal to .
Answer the following queries.
You are given integers . Let the sequence created by removing elements larger than from be . Among the possible permutations of , answer the number of permutations in which is greater than or equal to and less than or equal to with mod .
输入格式
represents the -th query.
Each query is given in the following format.
The input satisfies the following constraints.
All inputs consist of integers.
输出格式
Output lines. On the -th line, output the answer of the -th query.