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<iostream>
#include<climits>
#include<vector>
#include<numeric>
#include<queue>
#include<bits/stdc++.h> 
#include<algorithm>   //inbuilt gcd __gcd(a,b)
using namespace std;

#define fast        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define endl        "\n"
#define sz(s)       s.size()
#define pi          3.14159265358979    
//#define ll         long long int 
#define ld        long double
#define pb        push_back
#define mp   make_pair
#define inf         LLONG_MAX
#define f    first
#define s    second
#define all(v)      v.begin(),v.end()
#define Yes(flag)   flag==1?cout<<"YES\n":cout<<"NO\n"
#define lev  cout<<"\n"  
#define sum(a)     ( accumulate ((a).begin(), (a).end(), 0ll))
#define mine(a)    (*min_element((a).begin(), (a).end()))
#define maxe(a)    (*max_element((a).begin(), (a).end()))
#define mini(a)    ( min_element((a).begin(), (a).end()) - (a).begin())
#define maxi(a)    ( max_element((a).begin(), (a).end()) - (a).begin())

using ll = long long int;
using PII = pair<ll,ll>;
template<typename T>             istream& operator>>(istream& is,  vector<T> &v){for (auto& i : v) is >> i;        return is;}
template<typename T>             ostream& operator<<(ostream& os,  vector<T>  v){for (auto& i : v) os << i << ' '; return os;}

const ll N=1e5+5;
const ll mod=1e9+7;
vector<ll>v[N];
vector<PII>p[N];
ll vis[N]={0};


void time_taken()
{
#ifdef local
    cout << endl;
    cout << "Time Taken: " << (double)(clock() - zzz) / CLOCKS_PER_SEC << endl;
#endif
    return;
}
vector<ll> fact(ll n)
{
    vector<ll> x;
    ll i;

    for(i=1;i<=n;i++)
    {
        if(n%i==0)
            x.pb(i);
    }
    return x;
}
ll factorial(ll x)
{
    ll i=1;
    while(x){i*=x;i=i%mod;x--;}
    return i;
}

ll power(ll x,ll y,ll p = LLONG_MAX ){ll res=1;x%=p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;}
ll nCr(ll n,ll r,ll m=mod){if(r>n)return 0;ll a=1,b=1;while(r){a=(a*n)%m;--n;b=(b*r)%m;--r;}return (a*power(b,m-2,m))%m;}

void bfs(int s) {
        queue <int> q;
        q.push(s);
        vis[ s ] = 1;
        while(!q.empty())
        {
            int p = q.front();
            q.pop();
            for(int i = 0;i < v[ p ].size() ; i++)
            {
                if(vis[ v[ p ][ i ] ] == 0)
                {
            //Setting the level of each node with an increment in the level of parent node               
                     q.push(v[ p ][ i ]);
                     vis[ v[ p ][ i ] ] = 1;
                }
            }
        }
}

void dfs(int s) 
{
        vis[s] =1;
        for(int i = 0;i < v[s].size();++i)   
        {
             if(vis[v[s][i]] == 0)
                 dfs(v[s][i]);
        }
}

bool bysec(pair<ll,ll>&a,pair<ll,ll>&b)
{
    return a.second<b.second;
}
//------------------------------------//
void solve()
{

    ll n,i,cou=0,x=0,flag=0;
    cin>>n;
    
    while(n)
    {
        n=n/2;
        x++;
    }
    
    cout<<power(2,x-1)-1;
    lev;
}
int main()
{   fast;
    ll n=1;
    cin>>n; 
    while(n--)
    {
       solve();
    }
    time_taken();
}