eolymp
bolt
Try our new interface for solving problems
Problems

Worker and Salary

Worker and Salary

Each worker got his salary. Print the salary for the given worker. \InputFile The 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$. Each of the next $q$ lines contains surname of the worker. \OutputFile 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