#include <bits/stdc++.h>
using namespace std;
const int di[8] = {1, 1, -1, -1, 2, 2, -2, -2};
const int dj[8] = {2, -2, 2, -2, 1, -1, 1, -1};
int main()
{
int n;
cin >> n;
vector<string> ans(8, string(8, '.'));
for (int k = 0; k < n; k++)
{
string s;
cin >> s;
int i = 7 - (s[1] - '1'), j = s[0] - 'a';
for (int l = 0; l < 8; l++)
{
int ni = i + di[l], nj = j + dj[l];
if (0 <= ni && ni < 8 && 0 <= nj && nj < 8)
ans[ni][nj] = 'K';
}
}
for (string s : ans)
cout << s << "\n";
return 0;
}