Problem Description

Commands: ADD name score, TOP k. TOP prints top k names by score (desc), tie by name.

Input Format

First line q. Next q lines.

Output Format

Outputs for TOP.

Sample Test Case

Input:
6 ADD Bob 10 ADD Ana 15 ADD Bob 5 TOP 2 ADD Cara 15 TOP 3
Output:
Ana Bob Ana Cara Bob

Constraints

q

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next