P12858 [HackerEarth] nikhil and matrice 1
普及
题目描述

Nikhil got to know about what is a matrice. He made several patterns using 1-d and 2-d matrices. One of which was his favorite pattern. Your task is to right a code for his favorite pattern.

NOTE :- To understand his favorite pattern see the sample output

Input:-

First line of code takes number of test cases 'N' as its input. The following N lines take size 'S' of a sqaure matrice as its input.

Output:-

Print Nikhils favorite pattern and seperate two different test cases with an empty line.

Constraint:-

N ≤ 10

S ≤ 10

SAMPLE INPUT
1
3

SAMPLE OUTPUT
123
894
765

输入格式

见题面

输出格式

见题面

样例输入
1 3 SAMPLE
样例输出
123 894 765