Welcome to Zhejiang Gongshang University's annual acm school competition !
In the live competition, each problem has a balloon of corresponding color. Look up at the blackboard to see the color corresponding to the problem number!
Then! Here comes the point! Every time solve a problem can get a balloon of corresponding color sent by the volunteer younger sister (little brother)!
Now it is up to you to check the accepted records and tell the volunteers what color balloons to take.
First line contains two positive integers, the number of problems n (n <= 15) and the number of participants m (m <= 500).
Next n lines, each line contains a lowercase word s (| s | <= 20) means the color corresponds to the problem number (starting from 0).
Next line contains the number of accepted records t(0 <= t <= 2000).
Output t lines, for each line containing a lowercase word s for balloon colors to each accepted record in order.
5 200 blue red green yellow black 2 60 2 155 3
green yellow