#include <iostream>
#include <vector>
#include <string>
#define N 8

using namespace std;

int y, x;

bool isSafe(const vector<string> &board, int row, int col)
{
    /* Check this row on left side */
    for (int i = 0; i < col; ++i) {
        if (board[row][i] == 'w') return false;
    }
    /* Check upper diagonal on left side */
    for (int i = row - 1, j = col - 1; i >= 0 && j >= 0; --i, --j) {
        if (board[i][j] == 'w') return false;
    }
    /* Check lower diagonal on left side */
    for (int i = row + 1, j = col - 1; i < N && j >= 0; ++i, --j) {
        if (board[i][j] == 'w') return false;
    }
    return true;
}
// Place all the kings suitably before col x
bool SolveNQueenB(vector<string> &board, int col = 0)
{
    // Solution found!
    if (col == x) {
        board[y][x] = 'w';
        return true;
    }
    for (int i = 0; i < N; ++i) {
        // Found a square for queen[i][col]
        if (isSafe(board, i, col)) {
            board[i][col] = 'w';
            if (SolveNQueenB(board, col + 1))
                return true;
            board[i][col] = '.'; // backtrack
        }
    }
    return false;
}
// Place all the kings suitably after col x
bool SolveNQueenA(vector<string> &board, int col = x + 1)
{
    // Solution found!
    if (col == N) {
        return true;
    }
    for (int i = 0; i < N; ++i) {
        // Found a square for queen[i][col]
        if (isSafe(board, i, col)) {
            board[i][col] = 'w';
            if (SolveNQueenA(board, col + 1))
                return true;
            board[i][col] = '.'; // backtrack
        }
    }
    return false;
}

int main()
{
    // print all solutions to N-Queen problem.
    vector<string> board(N);
    for (int i = 0; i < N; ++i)
        board[i].resize(N, '.');
    cin >> y >> x;
    --y; --x; // set to the right indexes
    SolveNQueenB(board);
    SolveNQueenA(board);
    for (int i = 0; i < N; ++i) {
        cout << board[i] << endl;
    }
    return 0;
}
