#include<stdio.h>
#include<stdlib.h>
char c[8];
char d[3];
char ret[8][10]={"black","blue","lime","aqua","red","fuchsia","yellow","white"};
int R[]={0,0,0,0,255,255,255,255};
int G[]={0,0,255,255,0,0,255,255};
int B[]={0,255,0,255,0,255,0,255};
int main(){
	while(1){
		scanf("%s",c);
		if(c[0]!='#')return 0;
		d[0]=c[1];
		d[1]=c[2];
		d[2]='\0';
		int r=strtol(d,NULL,16);
		d[0]=c[3];
		d[1]=c[4];
		int g=strtol(d,NULL,16);
		d[0]=c[5];
		d[1]=c[6];
		int b=strtol(d,NULL,16);
		int min=99999999;
		int at=0;
		for(int i=0;i<8;i++)
			if(min>(r-R[i])*(r-R[i])+(g-G[i])*(g-G[i])+(b-B[i])*(b-B[i])){
				min=(r-R[i])*(r-R[i])+(g-G[i])*(g-G[i])+(b-B[i])*(b-B[i]);
				at=i;
			}
		
		printf("%s\n",ret[at]);
	}
}