#include<bits/stdc++.h>
#define INF 2100000000
using namespace std;
int main(void)
{
	char color[8][15]={"black","blue","lime","aqua",
				  "red","fuchsia","yellow","white"};
	int i,j,k,a,b,c,mini;
	int suu[16]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
	int red[8]={0,0,0,0,255,255,255,255},
		lime[8]={0,0,255,255,0,0,255,255},
		blue[8]={0,255,0,255,0,255,0,255};
	char sin[17]={"0123456789abcdef"};
	char pu[8];
	while(1) {
		cin>>pu;
		if(pu[0]=='0') break;
		a=b=c=0;
		for(i=1;i<8;i++) {
			for(j=0;j<16;j++) {
				if(pu[i]==sin[j]) {
					if(i<=2) {
						if(i%2==1)a+=suu[j]*16;
						else a+=suu[j];
					}
					else if(i<=4) {
						if(i%2==1) b+=suu[j]*16;
						else b+=suu[j];
					}
					else {
						if(i%2==1) c+=suu[j]*16;
						else c+=suu[j];
					}
					break;
				}
			}
		}
		mini=INF;
		int d,x;
		for(i=0;i<8;i++) {
			d=sqrt(((a-red[i])*(a-red[i]))+
					((b-lime[i])*(b-lime[i]))+
					((c-blue[i])*(c-blue[i])));
			if(mini>d) {
				mini=d;
				x=i;
			}
		}
		cout<<color[x]<<endl;
	}
}