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

typedef struct ucenik{
  char ime[21];
 
  float prosek;
}ucenik;


int main(){
    FILE *in;

    int n,j,i;
    int ocene[10];
    ucenik *niz;
    
    in=fopen("ucenici.txt","r");
    fscanf(in,"%d",&n);
    
    niz=(ucenik*)malloc(n*sizeof(ucenik));
    for(i=0;i<n;i++){
	niz[i].prosek=0.0;
	fscanf(in,"%s",niz[i].ime);
	for(j=0;j<9;j++){
	  fscanf(in,"%d",&ocene[j]);
	  niz[i].prosek+=ocene[j];
	  if(ocene[j]==1){
	    printf("%s  nedovoljan \n",niz[i].ime);
	    break;
	  }
	}
	if(j==9){
	  niz[i].prosek/=9;
	  if((niz[i].prosek)>=4.5)
	    printf("%s odlican \n",niz[i].ime);
	}
    }
    free(niz);
    fclose(in);
    return 0;
}
    
    
