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


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


int main(void){
    
    cell head,*a,*b,*new;
    
    
    head.next=NULL;
    
    while(1){
        new=(cell*)malloc(sizeof(cell));
        scanf("%19s", 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;
            
            while(a->next != NULL && new->BMI > a->next->BMI){
                a = a->next;
            }
            
            new->next = a->next;
            a->next = new;
            
        }
        else{
            break;
        }
        
    }
    
    for (a=head.next;a!=NULL;a=b){
        printf("%f %f %f %s\n",a->BMI,a->cm,a->kg,a->name);
	b = a->next;
	free(a);
    }
    
    return 0;
}
