Train Fare

After each yearly fare hike from 1 to 2 yen, report how many cities have a cheapest fare to city 1 above the original all-1-yen cost.

Medium7BFSShortest pathGraphNo attempts yetTime limit2.5sMemory limit256 MB

Problem

The country of JOI has NN cities, numbered 11 through NN. City 11 is the capital.

JOI has exactly one railway company, and that company runs MM lines, numbered 11 through MM. Line ii (1iM1 \le i \le M) connects city UiU_i and city ViV_i in both directions. There is no way to travel between cities other than by rail. Every city is reachable from every other city by riding one or more lines.

At the moment every line charges a fare of 1 yen. The company is in financial trouble, so it has drawn up a plan to raise the fare on some lines over the next QQ years. At the start of year jj (1jQ1 \le j \le Q) of the plan, the fare of line RjR_j goes up from 1 yen to 2 yen. A fare that has been raised stays at 2 yen from then on and is never raised again.

The company surveys the residents of each city once a year. Before the plan starts, the residents of every city are satisfied with the company, but a fare increase can make some residents unhappy.

Each year's survey is taken after that year's increase. The survey in year jj (1jQ1 \le j \le Q) is therefore taken in the state where exactly the lines R1,R2,,RjR_1, R_2, \dots, R_j have been raised and no other line has. In the year jj survey, a resident of city kk (2kN2 \le k \le N) is unhappy with the company if and only if the following condition holds.

  • The minimum cost of travelling from city kk to the capital, city 11, under the fares in force at that time is larger than the minimum cost of travelling from city kk to city 11 under the fares in force before the plan started.

The cost of a trip that uses several lines is the sum of the fares of those lines. Residents of city 11 are never unhappy with the company. Note that a route achieving the minimum cost under the raised fares may differ from a route achieving the minimum cost before the plan started.

Given the railway lines of JOI and the fare increase plan, write a program that reports, for each survey, the number of cities that contain unhappy residents.

Input

Read the following data from standard input.

  • The first line contains three integers NN, MM, QQ separated by spaces. JOI has NN cities and MM lines, and the fare increase plan runs for QQ years.
  • Each of the next MM lines contains two integers. Line ii of them (1iM1 \le i \le M) contains UiU_i and ViV_i separated by a space, meaning that line ii connects city UiU_i and city ViV_i.
  • Each of the next QQ lines contains one integer. Line jj of them (1jQ1 \le j \le Q) contains RjR_j, meaning that the fare of line RjR_j is raised in year jj of the plan.

Output

Print QQ lines to standard output. Line jj (1jQ1 \le j \le Q) must contain the number of cities that contain unhappy residents in the year jj survey.

Constraints

  • 2N1000002 \le N \le 100\,000
  • 1QM2000001 \le Q \le M \le 200\,000
  • 1UiN1 \le U_i \le N (1iM1 \le i \le M)
  • 1ViN1 \le V_i \le N (1iM1 \le i \le M)
  • UiViU_i \ne V_i (1iM1 \le i \le M)
  • 1RjM1 \le R_j \le M (1jQ1 \le j \le Q)
  • RjRkR_j \ne R_k (1j<kQ1 \le j < k \le Q)
  • At most one line directly connects any two cities.
  • Every city can reach city 11 by using one or more lines.