# Coloring Geysers

Once, Lucy found a cave on one of the planets in the Link-Cut system. The cave consists of $n$ halls and $n−1$ passages; each passage connects two halls, and it is possible to reach any other hall from any hall through the passages.

In each hall, there is a coloring geyser. When the coloring geyser in hall number $i$ erupts, it colors all halls that are at a distance of no more than $d_{i}$ from hall $i$ in color number $i$. The distance between two halls is defined as the minimum number of passages you need to travel through in order to move between them.

Lucy knows the structure of the cave, the colors of some halls, and that each geyser erupted exactly once. Based on this information, determine any possible order in which the eruptions could have occurred.

## Input

The first line contains a single integer $n$ $(2≤n≤10_{5})$ — the number of halls in the cave.

The second line contains $n$ integers $d_{1},d_{2},...,d_{n}$ $(0≤d_{i}≤n−1)$ — the distance coloring parameters for the geysers.

The third line contains $n$ integers $c_{1},c_{2},...,c_{n}$ $(−1≤c_{i}≤n)$, where $c_{i}$ is either the color number of the $i$-th hall or $−1$, if the color of the $i$-th hall is unknown.

The next $n−1$ lines describe the passages. The $i$-th line contains two integers $u_{i},v_{i}$ $(1≤u_{i},v_{i}≤n,u_{i}=v_{i})$ — the halls connected by the passage.

## Output

In a single line, output $n$ integers $p_{1},p_{2},...,p_{n}$, where $p_{i}$ is the number of the hall where the geyser which erupted $i$-th is located. It is guaranteed that there is at least one order that corresponds to the input data.

## Examples

## Note

In the first example, here are the colors of halls after each eruption, assuming they happened in the order given in output:

$1,1,1,1,1$

$5,1,1,1,5$

$4,1,1,4,5$

$3,1,3,4,5$

$2,2,3,4,5$

## Scoring

($10$ points): $n≤8$;

($40$ points): $d_{i}=1(1≤i≤n)$;

($30$ points): $u_{i}=1(1≤i≤n−1)$;

($80$ points): $n≤5⋅10_{4}$;

($65$ points): no additional constraints.