Binary Vector
题号:NC209782
时间限制:C/C++/Rust/Pascal 2秒,其他语言4秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
64bit IO Format: %lld

题目描述

Roundgod is obsessive about linear algebra. Let , everyday she will generate a binary vector randomly in . Now she wonders the probability of generating linearly independent vectors in the next days modulo . Formally, it can be proved that the answer has the form of , where  and  are coprime and  is not a multiple of . The answer modulo thus means , where is the multiplicative inverse of .

Wcy thinks the problem too easy. Let the answer of be f_n, she wants to know , where denotes bitwise exclusive or operation.

Note that when adding up two vectors, the components are modulo .

输入描述:

The input contains multiple test cases. The first line of input contains one integer , denoting the number of test cases.

In the following  lines, each line contains an integer  describing one test case.

输出描述:

For each test case, output one integer indicating the answer.
示例1

输入

复制
3
1
2
3

输出

复制
500000004
194473671
861464136

说明