di = [1, 1, -1, -1, 2, 2, -2, -2]
dj = [2, -2, 2, -2, 1, -1, 1, -1]
n = int(input())
positions = input().split()
ans = [['.' for _ in range(8)] for _ in range(8)]
for s in positions:
i, j = 8 - int(s[1]), ord(s[0]) - ord('a')
for l in range(8):
ni, nj = i + di[l], j + dj[l]
if 0 <= ni < 8 and 0 <= nj < 8:
ans[ni][nj] = 'K'
for row in ans:
print("".join(row))