After a long ACPC contest, Mouf could finally buy a new Yu-Gi-Oh structure deck "Fire Kings". He was amazed by how strong this deck is, and now he is ready to duel with Jack Atlas, The Crimson King.
However, during the duel, Mouf found a little problem. Calculating the damage he inflicted on Jack is very complicated as Fire Kings monsters are burning the field! Mouf has $$$n$$$ monsters on the field, and each of them has the following five parameters:
Level $$$l$$$, strength $$$s$$$, developing rate $$$x$$$, damage suppression $$$ds$$$, and $$$t$$$, the number of turns it will remain on the field before it will be destroyed.
Every monster will do the following until the end of the $$$t_{th}$$$ turn, respectively:
It took Mouf a few minutes to calculate damage fast, and now he is challenging you -yes, you bot! For every monster given in the input, output the total damage it causes during all $$$t$$$ turns modulo $$$10^9+7$$$.
The first line of the input contains one integer $$$n$$$ $$$(1 \le n \le 2 \cdot 10^4)$$$ — the number of monsters Mouf has on the field.
Then next $$$n$$$ lines follows, each of them contains five integers $$$l$$$, $$$s$$$, $$$x$$$, $$$ds$$$, $$$t$$$ $$$(1 \le l, s, x, ds, t \le 10^9)$$$.
Print $$$n$$$ lines, the $$$i$$$-th line contains one integer, the total damage the $$$i$$$-th monster causes to Jack Atlas, modulo $$$10^9+7$$$.
11 8 2 2 3
90
35 4 6 9 82 9 5 8 36 9 8 1 9
149564498 656250204 11070
In the first test case, Mouf has a monster with these parameters: $$$l=1, s=8, x=2, ds=2, t=3$$$. Then the following will happen:
During the end of the third turn, the monster will be destroyed, and the total damage it causes is $$$8 + 4 + 2 + 24 + 12 + 40 = 90$$$.
| Name |
|---|


