eolymp
Competitions

PP2: Week 9,10: May 17 - 30

Worker and Salary

Each worker got his salary. Print the salary for the given worker

Input

First line contains number n of workers. Each of the next n lines contains information about worker: surname and his salary. Then given number of queries q. Next q lines contain surname of the worker.

Output

For each query - surname of the worker - print his salary. If query person does not exist in the list of workers, print -1.

Time limit 1 second
Memory limit 128 MiB
Input example #1
4
Sidorov 100
Mamedov 150
Ivanov 200
Petrov 120
3
Mamedov
Petrov
Vasechkin
Output example #1
150
120
-1
Author Mykhailo Medvediev