Unique Color#516

Unique Color

1 second
128 megabytes
Medium (≈1350)

Given a tree with vertices numbered through . The -th edge connects Vertex a_i and Vertex b_i. Vertex is painted in color c_i (in this problem, colors are represented as integers).

Vertex is said to be good when the shortest path from Vertex to Vertex does not contain a vertex painted in the same color as Vertex , except for Vertex itself.

Find all the good vertices.

Input

The first line contains the number of vertices n~(2 \le n \le 10^5). The second line contains colors c_1, c_2, ..., c_n~(1 \le c_i \le 10^5). Each of the next n - 1 lines contains two integers a_i and b_i~(1 \le a_i, b_i \le n).

Output

Print all good vertices as integers, in ascending order. Print each number on a separate line.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading