Interesting Trip | HackerRank

You are given a directed acyclic graph with letters on each vertex. You have to find lexicographically minimal path between two vertexes.