#P6755. Fibonacci Sum

Fibonacci Sum

Problem Description

The Fibonacci numbers are defined as below:


Given three integers N, C and K, calculate the following summation:

Since the answer can be huge, output it modulo 1000000009 ($10^9$+9).

Input

The first line contains an integer T (1≤T≤200), denoting the number of test cases. Each test case contains three space separated integers in the order: N, C, K (1≤N,C≤$10^{18}$,1≤K≤$10^5$).

Output

For each test case, output a single line containing the answer.

2 5 1 1 2 1 2
12 2