Problem C: Peggly (2011-ish)

Let's play a rousing round of Peggly! Peggly is played by two players and a pile of stones. Players take turns. During a player's turn, he or she can pick up 1, 2, or K stones from the pile. (The number K is chosen before the start of the game.) A player must pick up at least one stone, if possible. The player whose turn it is once no stone remains in the pile wins the game! (Equivalently, the player forced to pick up the last stone loses.)

Consider this game of Peggly-5 — that is, K = 5) — with 5 stones. The first player picks up 1 stone. The second player picks up 2 stones. The first player picks up 1 stone again, leaving the pile with a single stone. The second player has to pick up the final stone, and thus loses.

In fact, player one can always win a game of Peggly-5 with 5 stones, as long as he or she makes no mistakes; that is, if the player plays perfectly. But in a game of Peggly-5 with 7 stones, player two will always win if he or she plays perfectly (and regardless of whether player one plays perfectly).

Write a program that figures out whether the first player or the second player will win a game of Peggly-K with N stones, assuming the players play perfectly.

input

The input will be a number of lines of inputs — a line for each game — each with two integers: the first represents K (2 < K < 20); and the second the second represents N (0 ≤ N < 10,000). The last line of the input will be just the single integer “-1” which indicates the end of the input (and which you do not process).

Sample Input

5 0
5 1
5 2
5 3
5 4
5 5
5 6
5 7
3 5
7 19
-1

There will be at most 100 lines of input.

Output

Your output should consist of one line per input line (except for the terminating “-1”), reporting whether the first player wins or loses. If the first player wins that game, say “Playing Peggly-K with N stones, first player wins.” Otherwise, say “Playing Peggly-K with N stones, first player loses.”

Sample Output

Playing Peggly-5 with 0 stones, first player wins.
Playing Peggly-5 with 1 stones, first player loses.
Playing Peggly-5 with 2 stones, first player wins.
Playing Peggly-5 with 3 stones, first player wins.
Playing Peggly-5 with 4 stones, first player loses.
Playing Peggly-5 with 5 stones, first player wins.
Playing Peggly-5 with 6 stones, first player wins.
Playing Peggly-5 with 7 stones, first player loses.
Playing Peggly-3 with 5 stones, first player loses.
Playing Peggly-7 with 19 stones, first player loses.