#include <stdio.h>
#include <stdlib.h>


typedefstruct field{
    char name[20];
    double  cm,kg,BMI;
    structfield *next;
    int x;
}cell;


int main(void){
    
    cell head,*a,*b,*new;
    
    
    head.next = NULL;
    
    while (1) {
        new = (cell *)malloc(sizeof(cell));
        scanf("%s",&new->name);
        
        if(new->name[0] != '0'){
            
            scanf("%lf",&new->cm);
            scanf("%lf",&new->kg);
            
            new->BMI = new->kg / (0.0001*new->cm*new->cm);
            
            a = &head;
            b = b->next;
            
            while (b != NULL && new->BMI > b->BMI) {
                a = b;
                b = b->next;
            }
            
            new->next = b;
            a->next = new;
            
        }
        else {
            break;
        }
        
    }
    
    for (a = head.next; a != NULL; a = a->next) {
        printf("%f %f %f %s\n", a->BMI,a->cm,a->kg,a->name);
    }
    
    return0;
    
}