Algorithm 4

Input: H m , V n

W.l.o.g assume: i : h i [ 1 , n ] , j : v j [ 1 , m ] , i h i = j v j .

For min ( W ) , min ( E ) = 1, , m and

min ( N ) , min ( S ) = 1, , n do begin

If Δ 2 L , G e o 1 1,1 ( H , V ) or Δ 2 L , G e o 2 1,1 ( H , V ) or...or Δ 2 L , L G e o 7,2 L G E O 7 1,1 ( H , V ) is satisfiable,

then output P = A B C D ¯ and halt.

end

output “failure”.