Nowadays, the systems in mobile phones are very user friendly. There is a shortcut button labelled Favourite for the most frequent dialed phone number so that you can make a phone call to that friend in a very short amount of time. The cellphone is smart enough to update the button dynamically.
Your job is to determine which phone number should be stored as the Favourite.
The input consists of two parts. The first part is the phone book showing the name of friends and their phone numbers. The second part is the phone numbers that have been dialed. The first integer in the input represents the total number of records in the phone book. Then each of the records follows on its own line. Each record starts with a name with no more than 20 characters (without any whitespace) and then a phone number with exactly 8 digits. Next, another integer in the input represents the total number of phone numbers that have been dialed. Finally, these phone numbers are listed, one per line.
For the most frequently dialed phone number, output the corresponding name. If there are two such numbers, output the one with the smaller phone number (where smaller mean numerically less than).
5 Mary 26000404 Susan 92132122 May 21232132 Ann 62343244 Peter 21321322 8 92132122 62343244 62343244 26000404 21321322 21232132 62343244 92132122