Fibonacci Sequence

For up to 1000 queries, compute the x-th Fibonacci number modulo 10^9, where x can be as large as 2^48.

Medium7MathMatrixDivide and conquerNumber theoryNo attempts yetTime limit2sMemory limit512 MB

Problem

Read an integer xx and compute f(x)f(x) modulo 10910^9, where f(x)f(x) is the xx-th value of the Fibonacci sequence.

The Fibonacci sequence is defined as follows.

f(1)=f(2)=1f(1) = f(2) = 1

f(k)=f(k1)+f(k2)(k>2)f(k) = f(k-1) + f(k-2) \quad (k > 2)

Input

The first line contains the number of test cases tt (1t10001 \le t \le 1000).

Each of the next tt lines contains one integer xx (1x2481 \le x \le 2^{48}).

Output

For each test case, print f(x)f(x) modulo 10910^9 on its own line.