program N10_22(input,output);
Type str=packed array[1..8] of boolean;
Var Board:array[1..8] of str;
    a,b:integer;
    c:char;
    i,j:integer;
Begin
 Read(c);
 a:=ord(c)-ord('a')+1;
 Read(b);
 for i:=1 to 8 do
  for j:=1 to 8 do
   ((Board[i])[j]):=false;
 for i:=-2 to 2 do
  if i<>0 then
   For j:=-2 to 2 do
    if j<>0 then
     if ((a+i)<>(b+j)) and ((a+i)<>(b-j)) and (((a+i)<=8) and ((a+i>=1)) and (((b+j)<=8) and ((b+j)>=1))) then
      ((Board[a+i])[b+j]):=true;
 for i:=8 downto 1 do
  begin
   for j:=1 to 8 do
    if ((Board[i])[j]) then
     write('X')
    else
     write('0');
   writeln;
  end;
end.

