e-olymp
Competitions

PP2: Week 9,10: May 17 - 30

Worker and Salary 2

Each worker got his salary. This salary was changed during the year. Print surnames of the workers with their final salary at the end of the year in increasing order of surname.

Input

Each line contains information about worker: surname and his salary. If the same worker appears once more again, it means that his salary was changed.

Output

Print surnames and salaries of all workers at the end of the year in increasing order of surname.

Time limit 1 second
Memory limit 128 MiB
Input example #1
Sidorov 100
Mamedov 150
Mamedov 250
Sidorov 110
Ivanov 200
Petrov 120
Sidorov 160
Ivanov 270
Output example #1
Ivanov 270
Mamedov 250
Petrov 120
Sidorov 160
Author Mykhailo Medvediev