#include <stdio.h> #include <algorithm> #include <iostream> #include <string> #include <vector> #include <functional> #include <map> #include <iomanip> #include <math.h> #include <stack> #include <queue> #include <bitset> #include <cstdlib> #include <tuple> #include <cctype> #include <ctype.h> #include <set> #include <sstream> using namespace std; int main() { int i, j, k; int w, h; char ch; cin >> w >> h; cin >> ch; for (i = 0; i < h; i++) { for (j = 0; j < w; j++) { cout << ch; if (ch == 'B') { ch = 'W'; } else if (ch == 'W') { ch = 'B'; } } if (w % 2 == 0) { if (ch == 'B') { ch = 'W'; } else if (ch == 'W') { ch = 'B'; } } else { if (ch == 'W') { ch = 'W'; } else if (ch == 'B') { ch = 'B'; } } cout << endl; } getchar(); getchar(); return 0; }