there n city Berland some pair connect m direct road one use road city there road connect city for pair city xy road x yA path city s city t sequence city p1 p2 pk p1s pkt road city pi city pi1 1 k1 the path pass multiple time city t it can not pass t oncea path p s t ideal lexicographically minimal path in word p ideal path s t path q s t piqi minimum integer piqithere tourist agency country offer q unusual excursion jth excursion start city sj end city tj for pair sj tj help agency study ideal path sj tj note possible ideal path sj tj this possible reason path sj tj path sj tj path p path q sj tj piqi minimum integer piqi the agency like know ideal path sj tj kjth city path way sj tjFor triple sj tj kj 1jq find ideal path sj tj print kjth city path