#1237. 锦标赛

锦标赛

题目描述

Every September, the Kingdom of Loowater holds a jousting tournament. In each of a series of event, a pair of knights attempt to knock each other from their respective horses. The winning knight is paired with another, while the loser is elimnated. This process continues until all but one knight is eliminated; this knight is declared champion.

输入格式

Please Input Input Here

输出格式

Please Input Output Here

样例

样例 1

输入 # 1

3

gallahad 10

lancelot 11

mccartney 2

0

输出 # 1

mccartney