Given an integer n, find the maximum value of integer k such that the following condition holds: 

n & (n-1) & (n-2) & (n-3) & ... (k) = 0  where & denotes the [bitwise AND operation.](https://en.wikipedia.org/wiki/Bitwise_operation#AND)

Input

The first line contains a single integer t (1 ≤ t ≤ 3 ⋅ 10^4). Then t test cases follow.

The first line of each test case contains a single integer n (1 ≤ n ≤ 10^9).

Output

For each test case, output a single integer — the required integer k.

Example

Input


3
2
5
17


Output


1
3
15

Note

In the first testcase, the maximum value for which the continuous & operation gives 0 value, is 1.

In the second testcase, the maximum value for which the continuous & operation gives 0 value, is 3. No value greater then 3, say for example 4, will give the & sum 0. 

  * 5   \&   4 ≠ 0, 
  * 5   \&   4   \&   3 = 0. 



Hence, 3 is the answer.
#include <bits/stdc++.h>
#define ll long long
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define BIG_N 1e9+7
using namespace std;

int cmp123 (const void * a, const void * b)
{
    return ( *(int*)a - *(int*)b );
}
int cmp321 (const void * a, const void * b)
{
    return ( *(int*)b - *(int*)a );
}
int cmp2d (const void * a, const void * b)
{
	int* arr1 = (int*)a;
  	int* arr2 = (int*)b;
  	int diff = arr1[0] - arr2[0];
	if (diff) return diff;
	return (arr1[1] - arr2[1]);
}

void scan_and_sort(int table[], int n, int sort)
{
	for (int i = 0; i < n; i++) scanf("%d", &table[i]);
	if (sort == 123) qsort(table, n, sizeof(int), cmp123);
	if (sort == 321) qsort(table, n, sizeof(int), cmp321);
	return;
}

int gcd(int a, int b)
{
	int tmp;
	while (a % b) {
		tmp = a % b;
		a = b;
		b = tmp;
	}
	return b;
}

int isPrime(int n)
{
	int m = sqrt(n);
	for (int i = 2; i <= m; i++) if (n % i == 0) return 0;
	return 1;
}

typedef struct node {
	int num;
	struct node *next;
} Node;

int main(int argc, char const *argv[])
{
	int t; cin >> t;
	while (t--) {
		int n; cin >> n;
		int cnt = 0, ans = 1;
		while (n) {
			ans *= 2;
			n /= 2;
		}
		cout << ans/2-1 << '\n';
	}
	return 0;
}


/* int main(int argc, char const *argv[])
{
	int t; cin >> t;
	while (t--) {
		int n, m; cin >> n >> m;
		int table[n], table2[n], tmp;
		for (int i = 0; i < n; i++) {
			cin >> tmp;
			table[i] = tmp % m;
			table2[i] = table[i];
			if (i > 0) table2[i] += table2[i-1];
		}
		
		for (int left = 0, right = n-1; left <= right; ) {
			if ((table2[right] - table2[left]) % m) {
				cout << right-left+1 << '\n';
				break;
			}
			else if (table[left] || table[right]) {
				cout << right-left << '\n';
				break;
			}
			else {
				left++;
				right--;
			}
			if (left > right) {
				cout << "-1\n";
				break;
			}
		}
	}
}*/ 

// priority_queue<int, vector<int>, greater<int> > pq;
// priority_queue<int> pq2;
// map<int, int> cnt;