Poker Face
Since you're a wannabe HFT employee, the first game you decide to play at the casino is Poker. You sit down at the first table you see and study the person across from you. You wonder if they have any tells...
A tell is something a player subconsciously does that might reveal the quality of their hand. For your purposes, let's define a tell as an action that the player does only when they win, and never when they lose.
Over the course of three games, you keep track of your opponent's actions and whether they won or lost:
- Game
: They won. Actions: smile, yawn, blink
- Game
: They lost. Actions: blink
- Game
: They won. Actions: smile, blink
Based on this, you conclude that the only action they do only when they win is smile. So smile
is a tell.
Given your opponent's games and actions, what tells do they have?
Input
The first line consists of an integer
, the number of games you play against your opponent.
The next lines contain
,
, and
, where:
is
W
if your opponent won andL
if the player lost;is the number of actions your opponent did during that game;
is a string representing the
th action your opponent did.
Output
Output all of your opponent's tells, in alphabetical order. If they have no tells, output .
Example
Input 1
3
W 3 Smile Yawn Blink
L 1 Blink
W 2 Smile Blink
Output 1
Smile
This is the above example.
Input 2
4
W 4 Squint Smile Laugh Talk
W 2 Laugh Talk
L 1 Smile
W 3 Laugh Talk Squint
Output 2
Laugh
Talk
Your opponent does things only when they win — talk and laugh.
Input 3
2
W 1 Smile
W 1 Frown
Output 3
-1
Your opponent doesn't have any actions they do only when they win, so they have no tells.
Input 4
3
L 1 Cry
L 1 Cry
L 1 Cry
Output 4
-1
Your opponent never wins (sad) so there's no actions they only do when they win.
Comments