CSES - New Roads Queries
  • Time limit: 1.00 s
  • Memory limit: 512 MB

There are nn cities in Byteland but no roads between them. However, each day, a new road will be built. There will be a total of mm roads.

Your task is to process qq queries of the form: "after how many days can we travel from city aa to city bb for the first time?"

Input

The first input line has three integers nn, mm and qq: the number of cities, roads and queries. The cities are numbered 1,2,,n1,2,\dots,n.

After this, there are mm lines that describe the roads in the order they are built. Each line has two integers aa and bb: there will be a road between cities aa and bb.

Finally, there are qq lines that describe the queries. Each line has two integers aa and bb: we want to travel from city aa to city bb.

Output

For each query, print the number of days, or 1-1 if it is never possible.

Constraints

  • 1n,m,q21051 \le n, m, q \le 2 \cdot 10^5
  • 1a,bn1 \le a,b \le n

Example

Input:

5 4 3
1 2
2 3
1 3
2 5
1 3
3 4
3 5

Output:

2
-1
4