#C3860. Employee of the Month

    ID: 47334 Type: Default 1000ms 256MiB

Employee of the Month

Employee of the Month

You are given a list of employee records. Each record contains an employee's name, department, and points. Your task is to determine, for each department, the employee with the highest points. In case multiple employees in the same department have the same points, select the one who appears first in the input.

After selecting the best employee for each department, output the result in a specific format as described below.

Note: If there are no employees, output nothing.

The scoring criterion can be summarized by the formula: \(\text{Best} = \max_{i}\{\text{points}_i\}\). In ties, the earlier occurrence wins.

inputFormat

The input is given via standard input (stdin) and has the following format:

  1. The first line contains an integer \(n\) representing the number of employees.
  2. The next \(n\) lines each contain three space-separated items: name (a string), department (a string), and points (an integer).

outputFormat

For each department present in the input, output a single line in the format:

<Department>: <Employee's Name> <Points>

The departments must be output in the order of their first appearance in the input. If \(n = 0\), do not output anything.

## sample
6
Alice HR 88
Bob IT 92
Charlie HR 90
David IT 85
Eve HR 88
Frank IT 92
HR: Charlie 90

IT: Bob 92

</p>