#include <iostream>
#include <cstdio>
using namespace std;
int HtoD(char c){
	if('0'<=c&&c<='9')return c-'0';
	if('A'<=c&&c<='F')return c-'A'+10;
	if('a'<=c&&c<='f')return c-'a'+10;
	return 0;
}
int main(){
	const int BCOL[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}};
	const string BCOLN[8]={"black","blue","lime","aqua","red","fuchsia","yellow","white"};
	string s;
	while(cin>>s){
		if(s[0]=='0')break;
		int r=(HtoD(s[1])<<4)+HtoD(s[2]),g=(HtoD(s[3])<<4)+HtoD(s[4]),b=(HtoD(s[5])<<4)+HtoD(s[6]);
		int mind=195075;
		int outn=0;
		for(int i=7;i>=0;--i){
			int d = (r-BCOL[i][0])*(r-BCOL[i][0])+(g-BCOL[i][1])*(g-BCOL[i][1])+(b-BCOL[i][2])*(b-BCOL[i][2]);
			if(d<=mind){
				mind = d;
				outn = i;
			}
		}
		cout<<BCOLN[outn]<<"\n";
	}
	return 0;
}