program kabe; uses crt; var f:text; P:array[1..8,1..8] of integer; a:string; t,g,b:integer; begin clrscr; assign(f,'seis.txt'); reset(f); for g:=1 to 8 do begin readln (f,a); for t:=1 to 8 do begin if copy(a,t,1)='O' then b:=0; if copy(a,t,1)='X' then b:=1; if copy(a,t,1)=' ' then b:=3; P[t,g]:=b; end; end; close(f); textcolor(blue); textbackground(white); for t:=1 to 8 do begin for g:=1 to 8 do begin gotoxy(t,g); if P[t,g]=3 then write(' '); if P[t,g]=1 then write('X'); if P[t,g]=0 then begin if (P[t+1,g+1]=3) or (P[t-1,g+1]=3) then textcolor(red); write('O'); textcolor(blue); end; end; end; readln; end.