Pro.ID22309 TitleElection Title链接http://10.20.2.8/oj/exercise/problem?problem_id=22309 AC0 Submit7 Ratio0.00% 时间&空间限制描述Canada has a multi-party system of government. Each candidate is generally associated with a party, and the party whose candidates win the most ridings generally forms the government. Some candidates run as independents, meaning they are not associated with any party. Your job is to count the votes for a particular riding and to determine the party with which the winning candidate is associated. 输入The first line of input contains a positive integer n satisfying 2 ≤ n ≤ 20, the number of candidates in the riding. n pairs of lines follow: the first line in each pair is the name of the candidate, up to 80 characters; the second line is the name of the party, up to 80 characters, or the word "independent" if the candidate has no party. No candidate name is repeated and no party name is repeated in the input. No lines contain leading or trailing blanks. The next line contains a positive integer m ≤ 10000, and is followed by m lines each indicating the name of a candidate for which a ballot is cast. Any names not in the list of candidates should be ignored. 输出Description Canada has a multi-party system of government. Each candidate is generally associated with a party, and the party whose candidates win the most ridings generally forms the government. Some candidates run as independents, meaning they are not associated with any party. Your job is to count the votes for a particular riding and to determine the party with which the winning candidate is associated. Input The first line of input contains a positive integer n satisfying 2 ≤ n ≤ 20, the number of candidates in the riding. n pairs of lines follow: the first line in each pair is the name of the candidate, up to 80 characters; the second line is the name of the party, up to 80 characters, or the word "independent" if the candidate has no party. No candidate name is repeated and no party name is repeated in the input. No lines contain leading or trailing blanks. The next line contains a positive integer m ≤ 10000, and is followed by m lines each indicating the name of a candidate for which a ballot is cast. Any names not in the list of candidates should be ignored. Output Output consists of a single line containing one of:
Sample Input 3 Sample Output Rhinoceros Source 样例输入3 样例输出Rhinoceros 作者 |