시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 (추가 시간 없음) 1024 MB88514160.294%

문제

You're attending a arcade basketball competition, where the objective is to score as many points as possible until the time runs out. The announcer has informed the crowd that their scoreboard is broken, so they don't have a way to keep track of all the scores. As a seasoned programmer, you feel you can whip up a program that can keep track of the names of the players and the amount of points they've scored, announcing the winner(s) at the end of the contest. 

입력

The first line contains three integers: the number of participants $n$ ($1 \le n \le 100\,000$); the minimum number $p$ of points required to win the contest ($10 \le p \le 10\,001$); and $m$, the number of lines with player names and points ($1 \le m \le 200\,000$). The next $n$ lines contain the names of the participants, each mentioned exactly once. Each name consist of no more than $20$ alphanumerical characters. The remaining $m$ lines each contain the name of a participant, followed by how many points they scored ($1$, $2$, or $3$).

출력

Output the names of those participants who reached the minimum required score, one per line! Output "<Winner> wins!" for each winner. Output the winners in the order in which they've reached the required score. If no one reaches the minimum required score, output "No winner!" (including the exclamation mark!).

예제 입력 1

3 10 13
John
Kelly
George
Kelly 1
George 2
Kelly 1
John 2
George 1
John 3
Kelly 3
Kelly 1
George 3
George 1
John 3
George 3
Kelly 1

예제 출력 1

George wins!

예제 입력 2

4 10 13
Bob
Nina
Jess
Tim
Nina 2
Bob 2
Nina 1
Jess 3
Bob 2
Jess 2
Nina 1
Jess 2
Nina 3
Bob 1
Nina 3
Jess 3
Bob 2

예제 출력 2

Nina wins!
Jess wins!

예제 입력 3

4 15 13
Bob
Nina
Jess
Tim
Nina 2
Bob 2
Nina 1
Jess 3
Bob 2
Jess 2
Nina 1
Jess 2
Nina 3
Bob 1
Nina 3
Jess 3
Bob 2

예제 출력 3

No winner!