#K12676. Sort Employee Records

    ID: 23744 Type: Default 1000ms 256MiB

Sort Employee Records

Sort Employee Records

You are given a list of employee records. Each record consists of a name, an age, and a salary. Your task is to sort the employee records in ascending order by salary. In case two employees have the same salary, sort them by age in ascending order. After sorting, print each record in the exact format: Name: <name>, Age: <age>, Salary: <salary>.

Note: The sorting criteria can be formally described as follows. Given two records \(a=(name_a, age_a, salary_a)\) and \(b=(name_b, age_b, salary_b)\), record \(a\) should come before record \(b\) if either \(salary_a < salary_b\) or \(salary_a = salary_b\) and \(age_a < age_b\).

inputFormat

The input is read from stdin and has the following format:

N
name1 age1 salary1
name2 age2 salary2
... 
nameN ageN salaryN

Here, the first line contains a single integer N (\(1 \leq N \leq 10^5\)), the number of employees. The next N lines each contain a string name (without spaces), an integer age, and a float salary, separated by spaces.

outputFormat

Output the sorted employee records to stdout with each record printed in a separate line in the following format:

Name: , Age: , Salary: 

The salary should be printed as a float value. Ensure that each output line ends with a newline character.

## sample
4
Alice 30 60000.0
Bob 25 50000.0
Charlie 28 50000.0
David 35 70000.0
Name: Bob, Age: 25, Salary: 50000.0

Name: Charlie, Age: 28, Salary: 50000.0 Name: Alice, Age: 30, Salary: 60000.0 Name: David, Age: 35, Salary: 70000.0

</p>