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:
dic = {2:1,     3: 1,   4: 4,   5: 1,   6: 6,   7: 1,   8: 4,   9: 9,   10: 4,   11: 1,   12: 6,   
	   13: 1,   14: 4,   15: 8,   16: 4,   17: 1,   18: 6,   19: 1,   20: 10,   21: 9,   22: 6,   23: 1,   
	   24: 6,   25: 4,   26: 4,   27: 6,   28: 4,   29: 1,   30: 8,   31: 1,   32: 10,   33: 6,   34: 6,   
	   35: 4,   36: 6,   37: 1,   38: 4,   39: 6,   40: 4,   41: 1,   42: 18,   43: 1,   44: 4,   45: 8,
	   46: 4,   47: 1,   48: 6,   49: 4,   50: 4,   51: 8,   52: 6,   53: 1,   54: 14,   55: 8,   56: 6,   
	   57: 6,   58: 4,   59: 1,   60: 12,   61: 1,   62: 6,   63: 6,   64: 6,   65: 4,   66: 8,   67: 1,   
	   68: 4,   69: 6,   70: 4,   71: 1,   72: 8,   73: 1,   74: 4,   75: 8,   76: 8,   77: 6,   78: 6,   
	   79: 1,   80: 4,   81: 8,   82: 6,   83: 1,   84: 6,   85: 4,   86: 12,   87: 12,   88: 4,   
	   89: 1,   90: 12,  91: 6,   92: 6,   93: 9,   94: 4,   95: 10,   96: 6,   97: 1,   98: 4,   
	   99: 9,   100: 4}


for t in range(int(input())):
	n = int(input())
	for i in range(n):
		for j in range(n):
			if i==j:
				if j==n-1:
					print(1)
				else:
					print(1, end= " ")
			else:
				if j==n-1:
					print(dic[n])
				else:
					print(dic[n],  end= " ")