program eightqueens(output);
a : array [ 1..8 ] of boolean;
b : array [ 2..16] of boolean;
c : array [-7..7 ] of boolean;
x : array [ 1..8 ] of integer;
for k := 1 to 8 do write(x[k]:2);
procedure trycol(j : integer);
begin a[i] := false; b[i+j] := false; c[i-j] := false;
begin a[i] := true; b[i+j] := true; c[i-j] := true;
repeat i := i+1; safe := a[i] and b[i+j] and c[i-j];
begin setqueen; x[j] := i;
if j < 8 then trycol(j+1) else print;
begin for i := 1 to 8 do a[i] := true;
for i := 2 to 16 do b[i] := true;
for i := -7 to 7 do c[i] := true;
writeln(clock); trycol(1); writeln(clock)