The first line contains the number of vertices n (1≤n≤300000).
The second line contains a string of n characters, each of them the capital letter A or the capital letter B. The j-th character of the string is the character initially written in vertex j.
Each of the next n−1 lines contains two different positive integers x and y (1≤x,y≤n), the labels of two vertices joined directly by an edge. The vertices and edges form a tree as described above.