// 0176
#include <iostream>
#include <string>
#define  N   255
using namespace std;

int c_table[8][3] = {{0,0,0}, {0,0,N}, {0,N,0}, {0,N,N}, {N,0,0}, {N,0,N}, {N,N,0}, {N,N,N}};

int conv_16(char c){
	if((c >= '0') && (c <= '9'))
		return c-'0';
	else if((c >= 'a') && (c <= 'f'))
		return c-'a'+10;
}

int dk(int co1[3], int co2[3]){
	int d = 0;

	for(int i=0;i<3;i++)
		d += (co1[i]-co2[i])*(co1[i]-co2[i]);

	return d;
}

int main(){
	while(1){
		string str;
		cin>>str;

		if(str == "0")
			break;

		int rgb[3], d=3*N*N, color=0;
		for(int i=0;i<3;i++)
			rgb[i] = 16*conv_16(str[2*i+1]) + conv_16(str[2*i+2]);
	
		
		for(int i=0;i<8;i++)
			if(d > dk(c_table[i], rgb)){
				d = dk(c_table[i], rgb);
				color = i;
			}

		if(color == 0)
			cout<<"black"<<endl;
		else if(color == 1)
			cout<<"blue"<<endl;
		else if(color == 2)
			cout<<"lime"<<endl;
		else if(color == 3)
			cout<<"aqua"<<endl;
		else if(color == 4)
			cout<<"red"<<endl;
		else if(color == 5)
			cout<<"fuchsia"<<endl;
		else if(color == 6)
			cout<<"yellow"<<endl;
		else if(color == 7)
			cout<<"white"<<endl;
	}
	return 0;
}