#include<iostream>
#include<cstdio>
#include<string>
#include<cmath>

using namespace std;

const double INF=10000;

double color[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
};
string colors[8]=
{"black",
"blue",
"lime",
"aqua",
"red",
"fuchsia",
"yellow",
"white"
};

int main(void){
	while(1){
		string str;
		cin >> str;
		if(str=="0")break;
		double c[3]={0,0,0};
		for(int i=0;i<3;i++){
			if(str[i*2+1]>='a' && str[i*2+1]<='f'){
				c[i]+=(str[i*2+1]-'a'+10)*16;
			}else c[i]+=(str[i*2+1]-'0')*16;
			if(str[i*2+2]>='a' && str[i*2+2]<='f'){
				c[i]+=str[i*2+2]-'a'+10;
			}else c[i]+=str[i*2+2]-'0';
		}
		double adk=INF;
		int ans=0;
		for(int i=0;i<8;i++){
			double dk=sqrt(pow(abs(c[0]-color[i][0]),2)+pow(abs(c[1]-color[i][1]),2)+pow(abs(c[2]-color[i][2]),2));
			if(adk>dk){
				ans=i;
				adk=dk;
			}
		}
		cout << colors[ans] << endl;
	}
    return 0;
}