#P1327. Finding the Owner
Finding the Owner
Finding the Owner
题目描述
The picture above shows a note left by a programmer who found a bag for the owner, with a very clever two-way encryption: "I found a bag downstairs. Please contact me if you see it! My phone number: . He claimed that the first two are "the and digits of your ID number", the next is "the digit of your ID number", and the last is "the last digit of your ID number".
Now given the programmer's complete mobile phone number and the ID numbers of a large group of people, please find the owner.
输入格式
Each input file contains one test case. The line gives the phone number of the programmer, and the line gives a positive integer . Then lines follow, each contains an ID number. For the sake of privacy protection, those ID numbers are not real. It is only guaranteed that each ID is an number.
输出格式
Output in a line the ID number of the owner. It is guaranteed that the answer is unique.
样例 #1
样例输入 #1
18328349823
10
130124198703030914
412901197609212008
450703198308160035
412928194606180028
413921194910290412
240902197104212813
371521198711123153
140113196511250117
622922200306127013
342520198912300017
样例输出 #1
371521198711123153