There are total N+1 squares numbered from 0 to N. You start at square 0. Also there are L ladders, where i-th ladder is denoted by two integers: aibi, it means that the ladder starts at square ai and ends at bi ( ai<bi ). There is no such square where more than one ladder starts, and also, the starting square of any ladder is not the same as the ending square of any other ladder. Now in every move, you can move ahead by 1, 2, 3, 4, 5 or 6 squares. If you land on a square where any ladder starts, then you will climb that ladder and directly get transported to the square where that ladder ends. You cannot move beyond square N, (for e.g., if you are at square N−1, then you have only one option - to move to square N).
For each ladder i, you have to find out the number of ways to reach from square 0 to square N, in which you have climbed (used) ladder i. It doesn't matter if you used the other ladders or not. Since the answer can be large, print your answer modulo 109+7.
Input
Output
Print L lines, the ith of which contains a single integer - the number of ways to reach the square N while having climbed ladder i (modulo 109+7). Also print a new-line at the end.
Constraints
For the first ladder, the 4 possible ways are:
0→1⇒3→4→5→6
0→1⇒3→4→6
0→1⇒3→5→6
0→1⇒3→6
for the second ladder, the only possible way is:
0→2⇒5→6