#include <iostream>
#include <cmath>
#include <string>
using namespace std;
double square(int SQ){
	double KAGA;
	KAGA=SQ*SQ;
	return KAGA;
}
int main(){
	string s,kaga="0123456789abcdef";
	string color[8]={"black","blue","lime","aqua","red","fuchsia","yellow","white"};
	int RK[8]={0,0,0,0,255,255,255,255};
	int GK[8]={0,0,255,255,0,0,255,255};
	int BK[8]={0,255,0,255,0,255,0,255};
	int C[3];
	double tmp;
	double MIN;
	string ans;
	while(cin>>s,s!="0"){
		for(int i=2,j=0;j<3;i+=2,j++){
			C[j]=0;
			for(int k=0;k<20;k++){
				if(s[i]==kaga[k]){
					C[j]+=k;
					k+=30;
				}
			}
			for(int k=0;k<20;k++){
				if(s[i-1]==kaga[k]){
					C[j]+=k*16;
					k+=30;
				}
			}
		}
		
		ans="?";
		MIN=10000000;
		
		for(int i=0;i<8;i++){
			tmp=sqrt(square(C[0]-RK[i])+square(C[1]-GK[i])+square(C[2]-BK[i]));
			if(MIN>tmp){
				MIN=tmp;
				ans=color[i];
			}
		}
		
		cout<<ans<<endl;
	}
	return 0;
}
