Problem: You are given an array [a_1, a_2, ..., a_n] such that 1 ≤ a_i ≤ 10^9. Let S be the sum of all elements of the array a.

Let's call an array b of n integers beautiful if:

  * 1 ≤ b_i ≤ 10^9 for each i from 1 to n; 
  * for every pair of adjacent integers from the array (b_i, b_{i + 1}), either b_i divides b_{i + 1}, or b_{i + 1} divides b_i (or both); 
  * 2 ∑ _{i = 1}^{n} |a_i - b_i| ≤ S. 



Your task is to find any beautiful array. It can be shown that at least one beautiful array always exists.

Input

The first line contains one integer t (1 ≤ t ≤ 1000) — the number of test cases.

Each test case consists of two lines. The first line contains one integer n (2 ≤ n ≤ 50).

The second line contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 10^9).

Output

For each test case, print the beautiful array b_1, b_2, ..., b_n (1 ≤ b_i ≤ 10^9) on a separate line. It can be shown that at least one beautiful array exists under these circumstances. If there are multiple answers, print any of them.

Example

Input


4
5
1 2 3 4 5
2
4 6
2
1 1000000000
6
3 4 8 1 2 3


Output


3 3 3 3 3
3 6
1 1000000000
4 4 8 1 3 3

Solution (in JAVA):

Solution:
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;
import java.util.InputMismatchException;
public class B
{
    public static void solve()
    {
        int t=sc.nextInt();
        while (t-->0)
        {
        	int n=sc.nextInt();
            int[] a=sc.nextIntArray(n);
            long cntEven=0;
            long cntOdd=0;
            for (int i=0;i<n;i+=2) {
            	cntEven+=a[i];
            }
            for (int i=1;i<n;i+=2) {
            	cntOdd+=a[i];
            }
            if (cntEven>cntOdd) {
            	for (int i=0;i<n;i++) {
            		if (i%2==0) out.print(a[i]+" ");
            		else out.print(1+" ");
            	}
            }
            else {
            	for (int i=0;i<n;i++) {
            		if (i%2!=0) out.print(a[i]+" ");
            		else out.print(1+" ");
            	}
            }
            out.println();
        }
    }
    public static void main(String[] args) 
    {
        new Thread(null, null, "Thread", 1 << 27) 
        {
            public void run() 
            {
                try 
                {
                    out = new PrintWriter(new BufferedOutputStream(System.out));
                    sc = new FastReader(System.in);
                    solve();
                    out.close();
                } 
                catch (Exception e) 
                {
                    e.printStackTrace();
                    System.exit(1);
                }
            }
        }
                .start();
    }
    public static class Pair<U extends Comparable<U>, V extends Comparable<V>> implements Comparable<Pair<U, V>> 
    {
        public U x;
        public V y;
    
        public Pair(U x, V y) 
        {
            this.x = x;
            this.y = y;
        }
    
        public int hashCode() 
        {
            return (x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode());
        }
    
        public boolean equals(Object o) 
        {
            if (this == o)
                return true;
            if (o == null || getClass() != o.getClass())
                return false;
            Pair<U, V> p = (Pair<U, V>) o;
            return (x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y));
        }
    
        public int compareTo(Pair<U, V> b) {
            int cmpU = x.compareTo(b.x);
            return cmpU != 0 ? cmpU : y.compareTo(b.y);
        }
    
        public String toString() {
            return String.format("(%s, %s)", x.toString(), y.toString());
        }
    
    }
    static final Random random=new Random();
    static int max(int[] arr)
    {
    	int m=Integer.MIN_VALUE;
    	for (int i=0;i<arr.length;i++)
    	{
    		m=Math.max(arr[i], m);
    	}
    	return m;
    }
    static int min(int[] arr)
    {
    	int m=Integer.MAX_VALUE;
    	for (int i=0;i<arr.length;i++)
    	{
    		m=Math.min(arr[i], m);
    	}
    	return m;
    }
    static int gcd(int a,int b)
    {
        if (b==a)
            return a;
        return gcd(b,a%b);
    }
    static void UjjwalSort(int[] a) 
    {
        int n=a.length;//shuffle, then sort 
        for (int i=0; i<n; i++) 
        {
            int ujjwal=random.nextInt(n), temp=a[ujjwal];
            a[ujjwal]=a[i]; a[i]=temp;
        }
        Arrays.sort(a);
    }
    public static PrintWriter out;
    public static FastReader sc;
    public static class FastReader 
    {
        private InputStream stream;
        private byte[] buf = new byte[4096];
        private int curChar, snumChars;
        public FastReader(InputStream stream) 
        {
            this.stream = stream;
        }
        public int read() 
        {
            if (snumChars == -1) 
            {
                throw new InputMismatchException();
            }
            if (curChar >= snumChars) 
            {
                curChar = 0;
                try 
                {
                    snumChars = stream.read(buf);
                } 
                catch (IOException E) 
                {
                    throw new InputMismatchException();
                }
            }
            if (snumChars <= 0) 
            {
                return -1;
            }
            return buf[curChar++];
        }
        public int nextInt() 
        {
            int c = read();
            while (isSpaceChar(c)) 
            {
                c = read();
            }
            int sgn = 1;
            if (c == '-') 
            {
                sgn = -1;
                c = read();
            }
            int number = 0;
            do 
            {
                number *= 10;
                number += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return number * sgn;
        }
        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) 
            {
                c = read();
            }
            long sgn = 1;
            if (c == '-') 
            {
                sgn = -1;
                c = read();
            }
            long number = 0;
            do 
            {
                number *= 10L;
                number += (long) (c - '0');
                c = read();
            } while (!isSpaceChar(c));
            return number * sgn;
        }
        public int[] nextIntArray(int n) 
        {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) 
            {
                arr[i] = this.nextInt();
            }
            return arr;
        }
        public long[] nextLongArray(int n) 
        {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) 
            {
                arr[i] = this.nextLong();
            }
            return arr;
        }
        public String next()
        {
            int c = read();
            while (isSpaceChar(c)) 
            {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do 
            {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }
        public String nextLine() 
        {
            int c = read();
            while (isSpaceChar(c)) 
            {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do
            {
                res.appendCodePoint(c);
                c = read();	
            } while (!isEndofLine(c));
            return res.toString();
        }
        public boolean isSpaceChar(int c)
        {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
        public boolean isEndofLine(int c) 
        {
            return c == '\n' || c == '\r' || c == -1;
        }
    }
}