E

Gun Fight

Input: Standard Input

Output: Standard Output

The above diagram illustrates sample #1.

The imaginary line is represented by the red line passing through two watch towers shown in red. There are 5 gun towers in total. The two groups are represented by two colors blue and black of which blue group is smaller in size. The yellow arrows show the two fights where the black ones get defeated.

 

 

Here we are in a gun fight again. We have a battlefield similar to a 2-dimensional Cartesian plane. In some of the grid points there are some watch towers.  Some of the watch towers have gunmen inside them. Let us denote them as gun towers. The power of each gun tower is given as an integer number P. When a fight takes place between two gun towers, the tower with higher P wins (No result in case of equal P).

 

Now, there are two opposing groups in the battle. The groups are separated by a boundary line. This boundary line is an imaginary infinite line drawn through two given free watch towers (watch towers without gunmen). The two groups stay in either side of the field. Interestingly, there are always an odd number of gun towers in the field at the start of a battle. This implies that the two groups will be of unequal size. The smaller group wants to adopt a strategy to ensure maximum possible success. A gun tower can fight with at most one of the opposing gun towers. Again, a gun tower can attack an enemy gun tower if the Euclidean distance between them is not greater than a particular distance R. Each gun tower of the smaller group is given the choice to select its opponent.

 

What is the maximum number of fight the smaller group can win?

 

Input

There are at most 60 test cases in the input. Every test case starts with an integer N (5≤N≤300), the number of watch towers. Each of the next N lines contains 3 non-negative integers x, y and P. The first two integers (0 ≤ x,y ≤ 10000) denote co-ordinates of the tower. The final integer P (0 ≤ P ≤ 10000) denotes the power of the tower. Note that, a watch tower with P=0 means a free watch tower. The (i+1)th line corresponds to watch tower number i (1 ≤ i ≤ N). Two watch towers will never be placed in the same location.

 

The next line contains three integers a, b (1 ≤ a,b ≤ N, a!=b) and R (1≤R≤10000), here a and b are the IDs of two free towers to draw the separation line through and meaning of R is given in the problem statement. There will be at least two free towers in the field. There will be no gun towers on the separation line.

 

The end of input is denoted by a case with N = 0. This case should not be processed.

 

Output

For each test case, print a line in this format, “Case X: Y”, where X is the case number and Y is the maximum possible number of fight the smaller group can win.

 

Sample Input                               Output for Sample Input

7

2 3 3

3 1 2

3 2 0

4 4 4

7 4 0

6 2 1

7 3 6

3 5 50

7

2 3 1

3 1 4

3 2 0

4 4 2

5 3 0

6 2 5

7 3 6

3 5 50

0

Case 1: 2

Case 2: 0


Problem setter: Mohammad Mahmudur Rahman , Special Thanks: Sohel Hafiz, Rujia Liu