Casino Strategy


Submit solution


Points: 1
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
C, C++, Java, Python

You have received magical eyeglasses from a gambling genie that will reveal the expected value of different games at any moment. To make the most of this gift, you enter a grand casino. There are some amount of games available, and your glasses give you n visions about the expected value of these games — the amount of money you're likely to win if you play it. These visions could be about games you've never seen before, or they could be a change in the expected value of games.

You've devised a strategy to use, where you will always play a game the first time you see its value, and otherwise, you will only play it if the value has gone up since last time you saw its expected value. You must decide whether to play or skip the game each time you receive a vision.

Input

The first line contains an integer n\ (1 \leq n \leq 10^5), the number of visions you will receive about the expected values of different games.

The next n lines each contain the name of the game G and the expected value of the game, x (1 \leq x \leq 10^6). The game G is a string with a length between 1 and 100 characters inclusive, containing only alphanumeric characters.

Output

For each vision, output either "Play" or "Skip" followed by the name of the game. You should only play the game if you have never seen that game's value before, or if this value is strictly greater than its value the last time you saw it.

Examples

Input 1
6
Blackjack 10
Poker 5
Poker 3
Roulette 8
Slots 12
Blackjack 11
Output 1
Play Blackjack
Play Poker
Skip Poker
Play Roulette
Play Slots
Play Blackjack

Initially you play both Blackjack and Poker, as you haven't seen their values before. Then, you skip Poker as its value has gone down from 5 to 3. Next, you haven't seen Roulette before, so you play it. Same with Slots. Finally, Blackjack has a value of 11, and last time you saw it it was 10, so you play it.

Input 2
5
Poker 5
Darts 6
Poker 5
Darts 4
Poker 6
Output 2
Play Poker
Play Darts
Skip Poker
Skip Darts
Play Poker

We initially play both Poker and Darts as we haven't seen them before. Then, we need strictly greater value, so we skip both Poker and Darts. Finally, Poker goes from 5 to 6, so we play it.

Input 3
3
Blackjack 10
Blackjack 3
Blackjack 5
Output 3
Play Blackjack
Skip Blackjack
Play Blackjack

We play the first Blackjack game as we haven't seen it prior, then skip the next one as it is less than the previously seen value of 10. In the third Blackjack game, we do play it since 5 is greater than the previously seen value of 3.


Comments

There are no comments at the moment.