Username
Little Andrej is a hipster. Like all the other hipsters, he must be original. If he is not, his life makes no sense. Every day little Andrej visits Z-training chat using his username "anthraxwar" in order to demonstrate his hipster skills and tell everyone they are very mainstream.
One day, while he was dealing with some hipsteric stuff and listening to some hipster music nobody has ever heard of, he realized that his nick is mainstream and he got a panic attack. First thing on his mind was to delete his account and stop visiting internet, forever. But soon enough he calmed down and decided to ask bl4ck.c0d3r to change his username with his almighty moderator skills. Because no one wants to bother a mod several times, Andrej immediately sent him a list of M elements that contains all the hipster usernames (each is unique) coded so that every username is represented by a positive integer number B. He asked moderator to check which usernames from this list have already been used on the internet, what would mean that they are too mainstream for him.
When mod came he found his base of N elements and contains all usernames ever used on the internet (of course, coded using positive integers A like the ones from the list) and instantly noticed that all the usernames from Andrej's list have been used, and that no username is good enough for him. For reasons unknown to us, moderator thinks that it would be less disappointing for Andrej if he sent him indices in base of all the usernames in his list. Help moderator, who stopped programming after he recently acquired moderator powers, to disappoint Andrej as less as possible.
Footnote: It's guaranteed that every username from the list can be found in the base exactly once. Also, indices in base are starting from 0.
Input data should be read from the standard input. First line of the input contains numbers N and M(1<=N<=10^5, 1<=M<=10^4, M<=N) that represent length of a base and length of Andrej's list. Each from next N lines contains one code A(1<= A <=2^30) of the username from base, and each from next M lines contains one code B(1<= B <=10^9) from the list.
Output data should be written to the standart output. Output should be consisted of M lines - in i-th line index in base of the username that is i-th in Andrej's list should be written.
Input:
7 3
22
13
33
21
19
11
69
21
69
13Output:
3
6
1Explanation:
List contains numbers 21, 69 and 13. Their indices in base(11, 13, 19, 21, 22, 33, 69) are respectively 3,6 and 1.
Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.