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.
// check whether to use mod or not while using power
// if string is given initialise n with length
// cout << fixed << setprecision(12) << ans << endl;... to print decinmal values accurately

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define float long double
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define F first
#define S second
#define all(a) (a).begin(), (a).end()
#define deb(x) cout<<#x<<" "<<x<<endl;
#define mem(v,x) memset(v,x,sizeof(v))
#define line cout<<endl;
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef map<ll, ll> mll;
typedef set<ll> sll;
typedef priority_queue<ll> pqll;
typedef queue<ll> qll;

const ll mod = 1e9 + 7;
const ll inf = 1e16 + 7;
const ll mxn = 1e5 + 7;
// vll adj[mxn];

ll powerWithOutMod(ll a, ll b) {
	ll res = 1;
	while (b) {
		if (b % 2) {
			res = (res * a);
		}
		a = (a * a);
		b /= 2;
	}
	return res;
}


int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	IOS
	ll n, m, k, t = 1, temp, ans, flag, min_el, max_el, sum_el;
	string s, s1, s2;
	cin >> t;
	while (t--) {
		ans = 0;
		sum_el = 0;
		flag = 1;
		cin >> n;
		temp = 1;
		ll c = 0;
		while (temp <= n) {
			temp *= 2;
			c++;
		}
		c--;
		cout << powerWithOutMod(2, c) - 1 << endl;



	}
	return 0;
}

// ctrl j to combine lines
// ctrl l to select line
// ctrl shift arrows for moving selected lines