In JOI Kingdom, there are N islands, numbered from 1 to N. Each island has the insecurity level. The insecurity level of the island i (1≤i≤N) is S_i.
In JOI Kingdom, ships between pairs of islands are mostly used as the methods of transportations. There are M ships, numbered from 1 to M. The ship j (1≤j≤M) connects the island A_j and the island B_j. We can run ships when necessary. It is possible to travel from any island to any other island by taking a number of ships.
In JOI Kingdom, there is a plan to introduce new ships. We can choose any pairs of islands where newly introduced ships connect.
One day, an incident occurred. A ship at anchor was attacked. Prime minister K of JOI Kingdom decided to introduce new ships. He also demands that ships in JOI Kingdom should satisfy the following Security Condition.
However, since it is expensive to hire security guards, we want to minimize the number of hired security guards. As long as the condition “it is possible to travel from any island to any other island by taking a number of ships” is satisfied, it is possible to abolish ships which are currently running.
Therefore, we will run ships as follows. Here, k is the number of newly introduced ships.
Condition: For every pair u, v (1≤u≤N, 1≤v≤N) of islands, it is possible to transport a passenger from the island u to the island v by repeating the following operations a number of times. In the process, Security Condition should be satisfied all the time.
Since the budget is limited, we can introduce at most Q new ships. For each k (0≤k≤Q), Prime minister K wants to know the minimum possible number of hired security guards if the number of newly introduced ships is k.
Write a program which, given the information of islands and the routes of the ships and the number of new ships we can introduce, calculates the minimum possible number of hired security guards for each k.
Read the following data from the standard input.
N M Q
S_1 S_2 ⋯ S_N
A_1 B_1
A_2 B_2
⋮
A_M B_M
Write Q+1 lines to the standard output. The (k+1)-th line (0≤k≤Q) of output should contain the minimum possible number of hired security guards if the number of newly introduced ships is k.