Problem I
Candy Store
Candy runs, well, a candy store! It is very popular, she has a hard time keeping up with all the orders being placed. She implements a simple system. Each customer who enters the store will fill their order on a form and sign it with their initials.
Maybe she should have asked for their full name instead, since this can sometimes lead to ambiguities about who placed the order. Actually, maybe she should not have let the customers write their own initials because sometimes she might misread them.
At times, Candy needs to consult with the customers about their order. She calls the initials written on the order form. Each time Candy calls out some initials, help her by informing her who the initials corresponds to, or if there are multiple names the initials correspond to, or if nobody has those initials.
Input
The first line of input will contain two integers
The next
Output
For each of the
-
If there is exactly one name that matches the initials, output the name.
-
If there is no name that matches, output nobody
-
If there is more than one name that matches, output ambiguous
Sample Input 1 | Sample Output 1 |
---|---|
4 3 John Doe Jane Doe Jimmy Jimmy Door Jone JJ JD NW |
Jimmy Jimmy ambiguous nobody |