for do
 if then
  
for do
 if then
return
Algorithm 4