Problem1577--Planting coffee trees

1577: Planting coffee trees

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 1  Solved: 1
[Submit] [Status] [Web Board] [Creator:]

Description

Pasan's coffee farm is square (N x N). Having grown bored managing the farm, Pasan plans to create an artistic farm by planting different types of coffee in a specific pattern to distinguish it as his own. Pasan intends to plant coffee trees in square shapes, starting from the outermost part and extending 1 meter apart, according to the order of the 9 types of coffee he currently possesses. Given the size of the farm as an integer, draw a picture that predicts what shape will result if different trees are planted in 1-meter increments according to the size.


Arabica, Bourbon, Canephora, Gesha, Java, Liberica, Mocha, Pacamara, Typica

Input

The first line contains the number of test cases T (1 <= T <= 10). For the number of test cases, the size of the farm N (1 <= N <= 18) is given.

Output

For each test case, print the first letter (uppercase) of the coffee type to be planted on the farm in a format that follows the rules.
Leave a blank line between the results of each test case.

Sample Input Copy

2
3
8

Sample Output Copy

AAA
ABA
AAA

AAAAAAAA
ABBBBBBA
ABCCCCBA
ABCGGCBA
ABCGGCBA
ABCCCCBA
ABBBBBBA
AAAAAAAA

Source/Category