program reachLow; read (e,w); s := w; t := {}; u := {}; for x in s loop for y in e { x } loop if y notin t then t with := y; if y notin s then u with := y; end if; end if; end loop; end loop; while exists x in u | true loop for y in e { x } loop if y notin t then if y notin s then u with := y; end if; t with := y; end if; end loop; if x in t then u less := x; end if; s with := x; end loop; print(s); end;