import java.util.Scanner;

/**
 * @author zengxiangbao
 * @date 2025/10/11 17:10
 * @description   BGN83 完美异或
 */
public class Main {
	//直接使用最偷懒的做法就行了,值得注意的是System.out.print(0 + " ");用println会超时,查了资料是println()每次会强制flush到外设,而print()缓存区满了才会flush
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        while (n-- > 0) {
            int k = in.nextInt(), i = k - 1;
//            boolean flag = false;
            while (i-- > 0) {
                System.out.print(0 + " ");
//                flag = true;
            }
            System.out.println(k);
        }
    }
}