What Handle Should I Pick
InterviewTime limit1sMemory limit1024 MB
Given a tree with a letter on each vertex, find the lexicographically largest string spelled by a walk from vertex 1 to a leaf.
Problem
Online judges identify each user by a unique ID. This ID is also called a handle, and the same or similar ID is usually used across several sites. For this reason, competitive programmers who are active on several sites are often better known by their handles than by their real names.
Gyu-hyo dreams of reaching the top of competitive programming, but he is stuck on choosing a handle. He wants one that sounds cool and also means something, but nothing comes to mind. Sang-won, who was watching him struggle, pulled a tree out of his pocket and suggested a way to pick one.

- The tree has vertices numbered from to , and each vertex has a lowercase English letter written on it.
- Start at vertex .
- From the current vertex, move to an adjacent vertex that has not been visited yet. Repeat this until no further move is possible.
- Concatenate the letters on the visited vertices in the order they were visited.
Gyu-hyo uses the resulting string as his handle. There are too many possible strings, so he decides to take the one that comes last in dictionary order. Given the tree that Sang-won gave him, find the handle Gyu-hyo will choose.
Input
The first line contains .
The second line contains the lowercase letters written on the vertices, in order, with no spaces.
Each of the next lines contains two integers and separated by a space. They describe an edge between vertex and vertex .
Output
Print the handle Gyu-hyo will choose.