Vishal and Priyanka are friends. Priyanka has been given a task by her teacher. Since Vishal likes Priyanka, help him in impressing her.
The task is that there are dots in a screen pattern lock. There are some rules for all the possible lock patterns. The lock pattern starts at the coordinates: and ends at . From any dot, the pattern can only move in these directions: right, left or bottom. Also, the pattern never repeats over same dot.
Given and , find out how many different patterns can exist. Since answer may be very large, output your answer modulo .
Input Format:
The first line has an integer T which represents number of test cases.
Each test case has two lines. The first line of test case has two integers .
The second line has four integers .
Output Format:
Print answer for each test case modulo .
Input Constraints:
Note:
!=