# Robots

Time Limit: 1000MS

Memory Limit: 10000K

## Input

The input consists of a number of instances. The first line of each instance contains the integers R and T separated by a space. This is followed by R lines containing two integers separated by a space, indicating the row and column of the initial positions of the R robots. You may assume that each robot initially occupies a cell which is not (15, 15) and the locations of the robots are distinct. The next T lines give the list of teleport destinations available. Each line is given by the row and column of the destination cell, separated by a space. The input is terminated by a case with R = T = 0.

## Output

For each case, print the case number (starting from 1), in the format shown in the Sample Output, on its own line. For each teleport taken, print one line of the form: Move m: teleport to (r, c) where m is the number of moves you have made (including this one), and (r, c) is the destination of the teleport. This is followed by three lines containing the result of the game. If you win the game, print Won game after making m moves. Final position (r,c) Number of cells with debris: d Where m is the number of moves you have made when you won the game, (r,c) is your final position, and d is the number of cells with debris (use the word "moves" even if m = 1). If you lose the game, print Lost game after making m moves. Final position: (r,c) Number of cells with debris: d Number of robots remaining: n where m is the number of moves you have made when you lost the game, (r.c) is the location at which you are destroyed, d is the number of cells with debris, and n is the number of robots remaining when you lost the game (use the word "moves" even if m = 1).

## Sample Input

4 0
17 18
13 18
8 12
10 12
4 0
17 17
13 17
13 13
17 13
3 3
17 18
13 18
5 31
15 16
16 15
3 7
0 0

## Sample Output

Case 1:
Won game after making 5 moves.
Final position: (14,16)
Number of cells with debris: 1

Case 2:
Lost game after making 2 moves.
Final position: (15,15)
Number of cells with debris: 1
Number of robots remaining: 0

Case 3:
Move 30: teleport to (16,15)
Move 58: teleport to (15,16)
Move 86: teleport to (3,7)
Lost game after making 114 moves.
Final position: (1,29)
Number of cells with debris: 1
Number of robots remaining: 1

## Source

East Central North America 2001