Kaosar and AND#12324

Kaosar and AND

1 second
256 megabytes
Very easy

You are given an array consisting of integers. Your task is to determine the maximum possible value of the bitwise AND of any subsequence of the array .

A subsequence since the value can be large print it modulus 10^6+3 of an array is defined as a sequence that can be obtained from by deleting some elements (possibly none), without changing the order of the remaining elements.

Input

The first line contains a single integer (1\le t\le 10^4) denoting the number of test cases.

For each test case the first line contains a single integer (1 \le n \le 10^5) — representing the length of array .

The second line contains integers a_1,a_2,...,a_n (0\le a_i \le 10^9) — the array .

It's guaranteed that \sum n \le 10^5 overall tests.

Output

For each test case, output a single integer representing the maximum achievable bitwise value over all possible subsequences of the given array .

Examples

Example 1

Loading
Loading

Scoring

  1. Subtask ( points) : (1 \le \sum n \le 20)

  2. Subtask ( points) : constraints of the statement.