Build The Grid
시간 제한2초메모리 제한1024 MB
흰 칸이 하나로 연결되고 모든 검은 칸이 흰 칸과 변을 맞대며, 각 행과 열의 검은 칸 수가 0부터 N-1의 순열이 되도록 N×N 격자를 만든다.
문제
Given is a square grid of squares. Your task is to paint each square of the grid either white or black such that:
- The white squares are connected: for any two white squares, you can go from one to the other by moving only between white squares that share a side.
- Each black square shares a side with at least one white square.
- Denote the number of black cells in the -th row as . The sequence is then a permutation of integers between and , inclusive.
- Denote the number of black cells in the -th column as . The sequence is then a permutation of integers between and , inclusive.
It can be shown that such a construction always exists.
입력
The input consists of one integer ().
출력
Print lines. On the -th line, print a string of length consisting of characters 'B' and 'W'. The -th character in the -th string corresponds to the square in -th row and -th column: 'B' denotes black squares and 'W' denotes white squares.