//何を何に変換するかが大事だと思う。(良問)
#include<stdio.h>
#define INF 100000000

char *color[8] = {"black","blue","lime","aqua","red","fuchsia","yellow","white"};
int X[8][3] = { {0,0,0},{0,0,255},{0,255,0},{0,255,255},{255,0,0},{255,0,255},{255,255,0},{255,255,255} };

int main(){
	char c[3];
	int rgb[3];
	int index;
	int mini;
	
	while( scanf("%c",c) ){
		if( c[0] == '\n' || c[0] == '\r' )
			continue;			
		if( c[0] == '0' )
			break;
			
		for( int i = 0;i < 3;i++ ){
			int num = 0;
			scanf("%c%c",c,c+1);
			if( c[0] <= '9' )
				num += (c[0]-'0')*16;
			else
				num += (c[0]-'a'+10)*16;
			if( c[1] <= '9' )
				num += (c[1]-'0');
			else
				num += (c[1]-'a'+10);
			rgb[i] = num;
		}
		
		mini = INF;
		
		for( int i = 0;i < 8;i++ ){
			int num = 0;
			for( int j = 0;j < 3;j++ ){
				num += (X[i][j]-rgb[j])*(X[i][j]-rgb[j]);
			}
			if( mini > num ){
				index = i;
				mini = num;
			}
		}
		printf("%s\n",color[index]);
	}
	return 0;
}