Martian War

Time limit: 0.5s Memory limit: 32MB Input: Output:

Recent studies have shown that there is indeed intelligent life on Mars. The problem is that now humanity is at war with the Martians and our best bet for survival is that we need to strike first. On Mars there is a complex railroad system of nn cities connected by mm bidirectional railroads.

Earth has called upon the best bomber there is, mister RANDy, to strike down those railroads. Because he is a maniac, he only has one bomb left so he can only strike down a single one of those railroads. RANDy will only target strategic railroads. A railroad is strategic if and only if there exists a pair of cities (x,yx, y) such that you can reach xx from yy and after bombing the given railroad, you can no longer reach xx from yy.

The Martians are starting to pick up on our plan, so they are now constructing qq additional railroads. After the construction of each new railroad, RANDy wants to know how many strategic railroads there are. RANDy now asks you to help him find the answer he seeks.

Input

The input will contain on the first line nn, the number of cities on the Martian surface, mm, the number of railroads connecting those cities and qq, the number of additional railroads that the Martians will be constructing.

On the next mm lines you will find a pair (x,yx, y), meaning that there is a bidirectional railroad from city xx to city yy.

On the next qq lines you will find a pair (x,yx, y), meaning that the Martians will construct a railroad from city xx to city yy.

Output

The output will contain qq lines, the ithith line will contain a single number ss, representing the number of strategic railroads after the Martians have constructed the first ii new railroads.

Constraints

  • 1n,m,q2.51051 \leq n, m, q \leq 2.5 \cdot 10^5
  • The graph is not guaranteed to be connected
  • For tests worth 3030 points, 1n,m,q1031 \leq n, m, q \leq 10^3
  • For tests worth 4040 more points, 1n,m,q1051 \leq n, m, q \leq 10^5
  • The scores from the contest might be different than the scores you get here

Example 1

stdin

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

stdout

2
1

Explanation

For the first sample, after the first built railroad, the strategic railroads are (2,42, 4) and (2,32, 3). After the second built railroad, the only strategic railroad is (2,42, 4).

Example 2

stdin

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

stdout

0
1

Log in or sign up to be able to send submissions!