Problem: Sasha likes investigating different math objects, for example, magic squares. But Sasha understands that magic squares have already been studied by hundreds of people, so he sees no sense of studying them further. Instead, he invented his own type of square — a prime square. 

A square of size n × n is called prime if the following three conditions are held simultaneously: 

  * all numbers on the square are non-negative integers not exceeding 10^5; 
  * there are no prime numbers in the square; 
  * sums of integers in each row and each column are prime numbers. 



Sasha has an integer n. He asks you to find any prime square of size n × n. Sasha is absolutely sure such squares exist, so just help him!

Input

The first line contains a single integer t (1 ≤ t ≤ 10) — the number of test cases.

Each of the next t lines contains a single integer n (2 ≤ n ≤ 100) — the required size of a square.

Output

For each test case print n lines, each containing n integers — the prime square you built. If there are multiple answers, print any.

Example

Input


2
4
2


Output


4 6 8 1
4 9 9 9
4 10 10 65
1 4 4 4
1 1
1 1

Solution (in PYTHON3):

Solution:
# cook your dish here
#t=int(input())
t = int(input())
while(t):
    t=t-1
    n = int(input())
    a={}
    prime = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]
    for x in prime:
        if x not in a:
            a[x]=1
    newL = [[4, 98], [6, 96], [8, 94], [9, 93], [10, 92], [12, 90], [14, 88], [15, 87], [16, 86], [18, 84], [20, 82], [21, 81], [22, 80], [24, 78], [25, 77], [26, 76], [27, 75], [28, 74], [30, 72], [32, 70], [33, 69], [34, 68], [35, 69], [36, 66], [38, 64], [39, 63], [40, 62], [42, 60], [44, 58], [45, 57], [46, 56], [48, 54], [49, 55], [50, 52], [51, 51], [52, 50], [54, 48], [55, 49], [56, 46], [57, 45], [58, 44], [60, 42], [62, 40], [63, 39], [64, 38], [65, 39], [66, 36], [68, 34], [69, 33], [70, 32], [72, 30], [74, 28], [75, 27], [76, 26], [77, 25], [78, 24], [80, 22], [81, 21], [82, 20], [84, 18], [85, 25], [86, 16], [87, 15], [88, 14], [90, 12], [91, 49], [92, 10], [93, 9], [94, 8], [95, 9], [96, 6], [98, 4], [99, 9], [100, 4]]
    for x in newL:
        a[x[0]] = x[1]
    ans = [[1 for x in range(n)]for y in range(n)]
    for i in range(len(ans)):
        for j in range(len(ans)):
            if i==j:
                print(a[n],end=" ")
            else:
                print("1",end=' ')
        print()