Problem E

Who is Smarter?

Two brothers (let's call them Rob and Doug) are trying to decide who is smarter. After a lot of argument they come up with the following game. They have a really long narrow table balanced on two edges as shown below.

We know from basic Physics that if we place objects on the table (not between the edges), the objects exert a twisting force around the nearer edge. So in general when one places or removes an object the table could tip over. Thus if objects are being moved, it is a challenge to keep the table balanced. The table would tip if the net torque around the left fulcrum (resulting from the weights of the packages and the table itself) were counterclockwise or if the net torque around the right fulcrum were clockwise.

Rob and Doug have a straight, evenly weighted table, 20 meters long and weighing three kilograms. The middle of the table is the center of mass, and we will call that position 0. So the possible positions on the table range from -10 (the left end) to +10 (the right end). The table is supported at positions -1.5 and +1.5 by two equal edges, both two meters tall and standing on a flat floor. On the table are six objects, at positions -8, -4, -3, 2, 5 and 8, having weights of 4, 10, 10, 4, 7 and 8 kilograms, respectively as in the picture below. The game involves one brother placing the objects on the table and the other brother has to remove objects one by one until all objects are removed without tipping the table. If the latter is able to do so he wins, otherwise the former wins.

Your job is to write a program that computes an ordering of objects to remove (one at a time) in such a way that the table does not tip. A possible solution to this problem is: first remove the object at position -4, then the object at 8, then -8, then 5, then -3 and finally 2.

Input

The input contains multiple cases. Each case starts with three integers: the length of the table (in meters, at least 3), the weight of the table (in kilograms) and n the number of objects on the table (n < 21). The table is supported at positions -1.5 and +1.5 by two equal fulcrums, both two meters tall and standing on a flat floor. The following n lines contain two integers each: the position of a object on the table (in meters measured from the center, negative means to the left) and the weight of the object (in kilograms). A line containing three 0's ends the input.

Output

For each case you are to output the number of the case in the format shown below and then a line containing "Possible" (if objects can be removed without causing the table to tip) and "Impossible" if there is no solution to the problem. There is no solution if in the initial configuration the table is not balanced.

Sample Input

20 3 6
-8 4
-4 10
-3 10
2 4
5 7
8 8
20 3 15
1 10
8 5
-6 8
5 9
-8 4
8 10
-3 10
-4 5
2 9
-2 2
3 3
-3 2
5 1
-6 1
2 5
30 10 2
-8 100
9 91
0 0 0

Sample Output

Case 1:
Possible
Case 2:
Possible
Case 3:
Impossible