301702: CF323A. Black-and-White Cube

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

Description

Black-and-White Cube

题意翻译

给你一个k×k×k大小的立方体,它由单位立方体组成。两个单元立方体如果有共同的面孔,就被认为是相邻的。你的任务是绘制两种颜色(黑色或白色)中的每一个k×k×k大小的单元立方体,这个立方体必须满足以下条件: 1. 每个白色立方体正好有两个相邻的白色立方体; 2.每个黑色立方体正好有两个相邻的黑色立方体。

题目描述

You are given a cube of size $ k×k×k $ , which consists of unit cubes. Two unit cubes are considered neighbouring, if they have common face. Your task is to paint each of $ k^{3} $ unit cubes one of two colours (black or white), so that the following conditions must be satisfied: - each white cube has exactly 2 neighbouring cubes of white color; - each black cube has exactly 2 neighbouring cubes of black color.

输入输出格式

输入格式


The first line contains integer $ k $ $ (1<=k<=100) $ , which is size of the cube.

输出格式


Print -1 if there is no solution. Otherwise, print the required painting of the cube consequently by layers. Print a $ k×k $ matrix in the first $ k $ lines, showing how the first layer of the cube should be painted. In the following $ k $ lines print a $ k×k $ matrix — the way the second layer should be painted. And so on to the last $ k $ -th layer. Note that orientation of the cube in the space does not matter. Mark a white unit cube with symbol "w" and a black one with "b". Use the format of output data, given in the test samples. You may print extra empty lines, they will be ignored.

输入输出样例

输入样例 #1

1

输出样例 #1

-1

输入样例 #2

2

输出样例 #2

bb
ww

bb
ww

Input

题意翻译

给你一个k×k×k大小的立方体,它由单位立方体组成。两个单元立方体如果有共同的面孔,就被认为是相邻的。你的任务是绘制两种颜色(黑色或白色)中的每一个k×k×k大小的单元立方体,这个立方体必须满足以下条件: 1. 每个白色立方体正好有两个相邻的白色立方体; 2.每个黑色立方体正好有两个相邻的黑色立方体。

加入题单

算法标签: