ZZ

No attempts yetTime limit15sMemory limit64 MB

Problem

The function ZZZZ is defined as follows.

ZZ(0,1)=aZZ(0, 1) = a

ZZ(0,2)=bZZ(0, 2) = b

ZZ(0,k)=ZZ(0,k1)+ZZ(0,k2)(k>2)ZZ(0, k) = ZZ(0, k-1) + ZZ(0, k-2) \quad (k > 2)

ZZ(i,k)=j=1kZZ(i1,j)(i1, k1)ZZ(i, k) = \sum_{j=1}^{k} ZZ(i-1, j) \quad (i \ge 1,\ k \ge 1)

Given four integers aa, bb, cc, dd, write a program that computes ZZ(c,d)ZZ(c, d).

Input

The first line contains the number of test cases TT. (T200T \le 200)

Each of the next TT lines holds one test case as four integers aa, bb, cc, dd. (0a,b10000000000 \le a, b \le 1000000000, 1c1001 \le c \le 100, 1c×d1000000001 \le c \times d \le 100000000)

Output

For each test case, print ZZ(c,d)ZZ(c, d) modulo 10000000091000000009 on its own line.