#define _USE_MATH_DEFINES //M_PI #include //std::cout, std::cin #include //std::string #include //std::vector #include //std::valarray 数値のみの一次配列 #include //std::sort #include //localtime_s #include //abs #include //abs, std::pow, sqrt, sin, cos, #include //std::ifstream #include //std::setprecision #include //std::random(C++11) #include //std::accumulate int main(void) { //test用 //std::ifstream in("test.txt"); //std::cin.rdbuf(in.rdbuf()); int W, H; char C1, C2; std::cin >> W >> H >> C1; if (C1 == 'B') { C2 = 'W'; } else { C2 = 'B'; } for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { if ((i + j) % 2 == 0) { std::cout << C1; } else { std::cout << C2; } } std::cout << std::endl; } }