program reachHigh; read ( e , w ) ; s := w ; while exists x in {z: y in s, z in e{y}} - s | true loop s with := x ; end loop ; print ( s ) ; end;