The chef is trying to solve some pattern problems, Chef wants your help to code it. Chef has one number K to form a new pattern. Help the chef to code this pattern problem.
-----Input:-----
- First-line will contain $T$, the number of test cases. Then the test cases follow. 
- Each test case contains a single line of input, one integer $K$. 
-----Output:-----
For each test case, output as the pattern.
-----Constraints-----
- $1 \leq T \leq 100$
- $1 \leq K \leq 100$
-----Sample Input:-----
4
1
2
3
4
-----Sample Output:-----
1
12
34
123
456
789
1234
5678
9101112
13141516
-----EXPLANATION:-----
No need, else pattern can be decode easily.
# cook your dish here
# cook your dish here
n=int(input())
l=[]
for j in range(n):
    t=int(input())
    l.append(t)
    


def pat(n):
    c=1
    for i in range(0,n,1):
        for j in range(0,n,1):
            print(c,end='')
            c+=1
        print()
        
    
for i in range(n):
    pat(l[i])
    
    
    
    
# cook your dish here
# cook your dish here
n=int(input())
l=[]
for j in range(n):
    t=int(input())
    l.append(t)
    


def pat(n):
    c=1
    for i in range(0,n,1):
        for j in range(0,n,1):
            print(c,end='')
            c+=1
        print()
        
    
for i in range(n):
    pat(l[i])
    
    
    
    