#include #include #include using ll = long long; using namespace std; constexpr ll INF = 1LL << 60; int w, h, a; char c; int main() { cin >> w >> h >> c; a = c == 'B'; for (int i = 0; i < h; ++i) { string p; for (int j = 0; j < w; ++j) { if (a) p.push_back('B'); else p.push_back('W'); a ^= 1; } if (i & 1) reverse(p.begin(), p.end()); cout << p << endl; } return 0; }