401608: GYM100499 G Visual Illusion
Description
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.
InputThe 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).
OutputFor each test, print the (2n + 1) * (2n + 1) table using ‘b’ or ‘w’ (denotes a black or white cell).
ExamplesInput2Output
1
2
www
wbw
www
wbwbw
bwwwb
wwbww
bwwwb
wbwbw