G. Guard the Kingdom
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Kanade becomes the king of the Kingdom Whatever. There're $$$n$$$ cities in the kingdom, which are connected by $$$n-1$$$ biconnected roads. In other words, the cities and roads construct a tree structure. There're $$$k$$$ important cities that need to be protected by arms. It is known that each troop protects all important cities that are closest to it, and only them. If there are multiple important cities with the minimum distance, all of them are protected. The distance between a city and a troop is equal to the number of roads on the unique path between the city and the city containing the troop. Additionally, the troop can be placed in an important city. Of course, the troop protects only that important city in that case.

There're $$$m$$$ troops that are placed in some cities now. In order to make the plan of kingdom defense for next year, Kanade would like to know how many important cities that each troop protects, and how many troops protect each important city.

Input

The first line contains three integers $$$n,m,k\ (2\le n\le 2\cdot 10^5,1\le m,k\le n)$$$, indicating the number of cities, the number of troops, and the number of important cities, respectively. Cities are numbered from $$$1$$$ to $$$n$$$.

The second line contains $$$n-1$$$ integers $$$p_2,p_3,\ldots,p_n\ (1\le p_i\le n,p_i\neq i)$$$. The $$$i$$$-th integer indicates there is a biconnected road between city $$$i+1$$$ and $$$p_{i+1}$$$.

The third line contains $$$m$$$ integers $$$t_i\ (1\le t_i\le n)$$$. The $$$i$$$-th integer indicates the $$$i$$$-th troop is placed in city $$$t_i$$$. It is guaranteed that for all $$$1\le i,j\le n$$$ and $$$i\neq j$$$, $$$t_i\neq t_j$$$ meets.

The fourth line contains $$$k$$$ integers $$$c_i\ (1\le c_i\le n)$$$. The $$$i$$$-th integer indicates $$$c_i$$$ is an important city. It is guaranteed that for all $$$1\le i,j\le n$$$ and $$$i\neq j$$$, $$$c_i\neq c_j$$$ meets.

Output

Output two lines. The first line contains $$$m$$$ integers. The $$$i$$$-th integer indicates the number of important cities protected by the troop $$$t_i$$$. The second line contains $$$k$$$ integers. The $$$i$$$-th integer indicates the number of troops protecting the important city $$$c_i$$$.

Example
Input
6 2 2
1 4 5 1 4
2 3
5 6
Output
1 2 
2 1 
Note

City $$$5$$$ is protected by troop $$$2,3$$$, and City $$$6$$$ is only protected by troop $$$3$$$.