401608: GYM100499 G Visual Illusion

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

G. Visual Illusiontime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Look closely at this picture! You may think there is curve toward the center because of visual illusion but actually not. It is just a square table with black and white cells in special pattern. This is called visual illusion.

A visual illusion is characterized by visually perceived images that differ from objective reality. The information gathered by the eye is processed in the brain to give a perception that does not tally with a physical measurement of the stimulus source.

This is just a (2n + 1) * (2n + 1) table with black and white square cells. It starts with an almost white table and one black cell in the center. Then we start coloring cells in steps. In each step, we color some cells so that these cells make a minimal diamond shape and they do not share an edge with each other. The diamond shape in one step should also contain all cells colored in previous steps and do not touch them (sharing a point with them). We continue this process even when part of the diamond shape is out of the table.

Conan found this so interesting; and wants to know if a bigger table would make a stronger illusion. He needs you to write a program to print a whole table of this pattern.

Input

The input starts with T - number of tests (T ≤ 10). Then T tests follow. Each test is printed in a line consist of a positive integer n (1 ≤ n ≤ 100).

Output

For each test, print the (2n + 1) * (2n + 1) table using ‘b’ or ‘w’ (denotes a black or white cell).

ExamplesInput
2
1
2
Output
www
wbw
www
wbwbw
bwwwb
wwbww
bwwwb
wbwbw

加入题单

上一题 下一题 算法标签: