#P7877. [2021年杭电多校]Mod, Or and Everything

[2021年杭电多校]Mod, Or and Everything

Mod, Or and Everything

Problem Description

You are given an integer nn. You are required to calculate (n mod 1) or (n mod 2) or ... or (n mod (n - 1)) or (n mod n). The "or" operation means "bitwise OR".

Input

The first line contains an integer T(1T5000)T(1\le T\le 5000)representing the number of test cases. For each test case, there is an integer n(1n1012)n(1\le n\le 10^{12})in one line.

Output

For each test case, print the answer in one line.

Sample Input

5

1

2

3

4

5

Sample Output

0

0

1

1

3

Source

2021“MINIEYE杯”中国大学生算法设计超级联赛(1)