# 50107. Height and Weight

## I'm a slow walker, but I never walk backwards.

Write a program to sort students according to their BMI.

You are given $N$ students’ names, heights and weights and you need to sort them. We will sort them according to the BMI first, which is defined as the weight (in kilogram) divided by the square of the height (in meter). If two students have the same BMI, then we compare the weight, if they are still the same then we compare the height. If they are still the same we compare the names (in dictionary order). It is guaranteed that no two students have the same name. Note that you need to use floating-point to compute BMI.

• 10 points: There are only 2 students.
• 30 points: There are only 5000 students.
• 60 points: The number of students is so large that you have to use qsort().

## Input Format

There is one number $N$ in the first line indicating the number of students. The next $N$ lines are students’ names, heights(centimeter) and weights(kilogram). Each line contains one string and two integers. The string is student’s name. The first number is student’s height. The second number is student’s weight.

• $0 \lt N \lt 100001$
• $\text{length of name} \lt 64$

## Output Format

Print sorted data in different line. The output format for each student is name height weight.

## Sample Input 1

1232Tom 160 80John 175 70


## Sample Output 1

12John 175 70Tom 160 80


## Sample Input 2

1234565Tom 160 80John 175 70Tony 200 125Andy 160 80Morris 175 65


## Sample Output 2

12345Morris 175 65John 175 70Andy 160 80Tom 160 80Tony 200 125