In the NN country, there are $n$ cities, numbered from $1$ to $n$, and $n - 1$ roads, connecting them. There is a roads path between any two cities.
There are $m$ bidirectional bus routes between cities. Buses drive between two cities taking the shortest path with stops in every city they drive through. Travelling by bus, you can travel from any stop on the route to any other. You can travel between cities only by bus.
You are interested in $q$ questions: is it possible to get from one city to another and what is the minimum number of buses you need to use for it?
## Input
The first line contains a single integer $n$ ($2 \le n \le 2 \cdot 10^5$) — the number of cities.
The second line contains $n - 1$ integers $p_2, p_3, \ldots, p_n$ ($1 \le p_i < i$), where $p_i$ means that cities $p_i$ and $i$ are connected by road.
The third line contains a single integer $m$ ($1 \le m \le 2 \cdot 10^5$) — the number of bus routes.
Each of the next $m$ lines contains $2$ integers $a$ and $b$ ($1 \le a, b \le n$, $a \neq b$), meaning that there is a bus route between cities $a$ and $b$. It is possible that there is more than one route between two cities.
The next line contains a single integer $q$ ($1 \le q \le 2 \cdot 10^5$) — the number of questions you are interested in.
Each of the next $q$ lines contains $2$ integers $v$ and $u$ ($1 \le v, u \le n$, $v \neq u$), meaning that you are interested if it is possible to get from city $v$ to city $u$ and what is the minimum number of buses you need to use for it.
## Output
Print the answer for each question on a separate line. If there is no way to get from one city to another, print $-1$. Otherwise print the minimum number of buses you have to use.
[samples]
## Note
<center> Routes for first sample are marked on the picture.</center>
在 NN 国,有 $n$ 座城市,编号从 $1$ 到 $n$,以及 $n -1$ 条道路连接它们。任意两座城市之间都存在一条道路路径。
有 $m$ 条双向公交线路连接城市。公交车沿最短路径在经过的每个城市停靠。乘坐公交车,你可以从路线上的任意一站前往另一站。你只能通过公交车在城市间旅行。
你对 $q$ 个问题感兴趣:是否可以从一座城市到达另一座城市,以及为此需要使用的最少公交车数量是多少?
第一行包含一个整数 $n$($2 lt.eq n lt.eq 2 dot.op 10^5$)——城市数量。
第二行包含 $n -1$ 个整数 $p_2, p_3, dots.h, p_n$($1 lt.eq p_i < i$),其中 $p_i$ 表示城市 $p_i$ 和 $i$ 由一条道路连接。
第三行包含一个整数 $m$($1 lt.eq m lt.eq 2 dot.op 10^5$)——公交线路数量。
接下来的 $m$ 行中,每行包含两个整数 $a$ 和 $b$($1 lt.eq a, b lt.eq n$,$a eq.not b$),表示城市 $a$ 和 $b$ 之间有一条公交线路。两个城市之间可能存在多条线路。
下一行包含一个整数 $q$($1 lt.eq q lt.eq 2 dot.op 10^5$)——你感兴趣的查询数量。
接下来的 $q$ 行中,每行包含两个整数 $v$ 和 $u$($1 lt.eq v, u lt.eq n$,$v eq.not u$),表示你希望知道是否可以从城市 $v$ 到达城市 $u$,以及所需的最少公交车数量。
请在每行输出一个查询的答案。如果无法从一座城市到达另一座城市,请输出 $-1$;否则输出所需的最少公交车数量。
## Input
第一行包含一个整数 $n$($2 lt.eq n lt.eq 2 dot.op 10^5$)——城市数量。第二行包含 $n -1$ 个整数 $p_2, p_3, dots.h, p_n$($1 lt.eq p_i < i$),其中 $p_i$ 表示城市 $p_i$ 和 $i$ 由一条道路连接。第三行包含一个整数 $m$($1 lt.eq m lt.eq 2 dot.op 10^5$)——公交线路数量。接下来的 $m$ 行中,每行包含两个整数 $a$ 和 $b$($1 lt.eq a, b lt.eq n$,$a eq.not b$),表示城市 $a$ 和 $b$ 之间有一条公交线路。两个城市之间可能存在多条线路。下一行包含一个整数 $q$($1 lt.eq q lt.eq 2 dot.op 10^5$)——你感兴趣的查询数量。接下来的 $q$ 行中,每行包含两个整数 $v$ 和 $u$($1 lt.eq v, u lt.eq n$,$v eq.not u$),表示你希望知道是否可以从城市 $v$ 到达城市 $u$,以及所需的最少公交车数量。
## Output
请在每行输出一个查询的答案。如果无法从一座城市到达另一座城市,请输出 $-1$;否则输出所需的最少公交车数量。
[samples]
## Note
第一个样例的线路在图中标出。
**Definitions**
Let $ T = (V, E) $ be a tree with $ n $ vertices (cities) labeled $ 1 $ to $ n $, where $ V = \{1, 2, \dots, n\} $, and $ E $ consists of $ n-1 $ undirected edges defined by parent relations: for each $ i \in \{2, \dots, n\} $, there is an edge between $ i $ and $ p_i $, with $ 1 \le p_i < i $.
Let $ B = \{ (a_j, b_j) \mid j \in \{1, \dots, m\} \} $ be a multiset of $ m $ bidirectional bus routes, where each route connects two distinct cities $ a_j, b_j \in V $.
For any bus route $ (a, b) $, define the *bus path* as the unique simple path between $ a $ and $ b $ in the tree $ T $. A passenger may board or alight at any city along this path.
Let $ G = (V, E_B) $ be the undirected graph where $ E_B $ contains an edge between two cities $ u, v \in V $ if and only if there exists a bus route whose path in $ T $ includes both $ u $ and $ v $.
**Constraints**
1. $ 2 \le n \le 2 \cdot 10^5 $
2. $ 1 \le m \le 2 \cdot 10^5 $
3. $ 1 \le q \le 2 \cdot 10^5 $
4. For each bus route $ (a, b) $: $ a, b \in V $, $ a \ne b $
5. For each query $ (v, u) $: $ v, u \in V $, $ v \ne u $
**Objective**
For each query $ (v, u) $, compute the minimum number of bus routes required to travel from $ v $ to $ u $, where movement is allowed only via bus paths (i.e., you may traverse from any city on a bus route to any other city on the same route). If no such path exists, return $ -1 $.
Formally, define the graph $ H = (V, E_H) $, where $ \{u, v\} \in E_H $ if there exists a bus route whose path in $ T $ contains both $ u $ and $ v $. Then, for each query $ (v, u) $, compute the shortest path distance (in terms of number of edges) from $ v $ to $ u $ in $ H $, or $ -1 $ if $ u $ is unreachable from $ v $.