#C12022. Dynamic Highest Average Score

    ID: 41404 Type: Default 1000ms 256MiB

Dynamic Highest Average Score

Dynamic Highest Average Score

You are given an initial set of exam scores for various students. Each score record consists of a student's name and their exam score. After the initial records, a series of additional score records are added one by one. After each new score is added, you must output the name of the student with the highest average score.

The average score for a student is defined as \[ \text{average} = \frac{\text{total score}}{\text{number of scores}}, \] where the total score is the sum of all of the student’s scores. In case of a tie (i.e. two or more students have the same highest average), choose the student whose name is lexicographically smallest.

Read the input from standard input and output the result to standard output.

inputFormat

The input begins with an integer n representing the number of initial score entries.

The next n lines each contain a student's name (a string) followed by an integer score, separated by a space.

After that, an integer q is given, representing the number of additional score entries.

The following q lines each contain a student's name and a score (separated by a space).

outputFormat

For each of the q additional score entries, output a single line containing the name of the student with the highest average score at that moment.

## sample
4
Alice 85
Bob 90
Alice 95
Charlie 88
2
Alice 100
Bob 70
Alice

Alice

</p>