Fight for freedom, Fight for honor!

In June 6, 2044, the main force of country Z's United Fleet encountered the main force of country M's Pacific Fleet. And the battle started.

At the beginning of the battle, the both sides lost a few ships, and some ships lost contact to some other ones. 1 hour later, the commander of United Fleet-you, made a design: Forming a special fleet with the most power to attack the enemy's back. And in the special fleet, every ship can keep in touch with any other ones.

Given the situation of your fleet, you were to build the special fleet and calculate its power.

Input

There are multiple test cases. In the first line of each test case, two integers n (0<n<100) and m show the number of your ships and how many contacts are lost between the ships, separated by a blank. The followed n lines of integers indicate one ship's power (from 0 to n-1). Each of the followed m lines contains the numbers of the two ships, which can not contact with each other. The input end with n=0 and m=0.

Output

For each test case, you should output:"Case ",the case number, ": ", and the max power you can get in a single line.

Sample Input

4 1
25
37
14
15
2 3
3 3
98
99
100
0 1
2 0
2 1
0 0

Sample Output

Case 1: 77
Case 2: 100