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.
// Piyush Nagpal
import java.util.*;
import java.io.*;
 public class Main{
     
    static int MOD=1000000007;
    static PrintWriter pw;
    static FastReader sc;
    
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;
 
        public FastReader()
        {
            br = new BufferedReader(
                new InputStreamReader(System.in));
        }
 
        String next()
        {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        int nextInt() { return Integer.parseInt(next()); }
 
        long nextLong() { return Long.parseLong(next()); }
 
        double nextDouble(){return Double.parseDouble(next());}
        
        public char nextChar() throws IOException {return next().charAt(0);}
 
        String nextLine(){
            String str = "";
            try {
                str = br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        public int[] intArr(int n) throws IOException {
            int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
            return in;
        }
        public long[] longArr(int n) throws IOException {
            long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
            return in;
        }
        
    }	


     public static long gcd(long a,long b){
        if( b>a ){
            return gcd(b,a);
        }
        if( b==0 ){
            return a;
        }
        return gcd(b,a%b);
    }

    public static ArrayList<Long> Sieve(int n){
        boolean [] arr= new boolean[n+1];
        Arrays.fill(arr, true);
        ArrayList<Long> list= new ArrayList<>();
        for(int i=2;i<=n;i++){
            if( arr[i]==true ){
                list.add((long)i);
            }
            for(int j=2*i;j<=n;j+=i){
                arr[j]=false;
            }
        }
        return list;
    }

    public static void printarr(int [] arr){
        for(int i=0;i<arr.length;i++){
            pw.print(arr[i]+" ");
        }
    }
    
    // int [] arr=sc.intArr(n);
    static void main() throws Exception{
        
        int n=sc.nextInt();
        
        int ans=Power(n);
        pw.println(ans-1);
        
        
    }
    static int Power(int n)
{
     
    int x = (int)(Math.log(n) /
                  Math.log(2));
    return (int)Math.pow(2, x);
}
    
    public static void main(String[] args) throws Exception{
    	sc= new FastReader();
    	pw = new PrintWriter(System.out);
        int tc=1;
        tc=sc.nextInt();
        for(int i=1;i<=tc;i++) {
//            pw.printf("Case #%d: ", i);
            main();
        }
        pw.flush();
    }

}