#include<iostream>
#include<cmath>
using namespace std;
string s[]={"black","blue","lime","aqua","red","fuchsia","yellow","white"};
double r[]={0,0,0,0,255,255,255,255},g[]={0,0,255,255,0,0,255,255},b[]={0,255,0,255,0,255,0,255};
int f(char c)
{
	if(c<='9')return c-'0';
	else return c-'a'+10;
}
int main()
{
	string t;
	while(cin>>t,t!="0")
	{
		double R,G,B;
		int i;
		double M=1e9;
		R=f(t[1])*16+f(t[2]);
		G=f(t[3])*16+f(t[4]);
		B=f(t[5])*16+f(t[6]);
		for(int j=0;j<8;j++)
		{
			double now=hypot(r[j]-R,hypot(g[j]-G,b[j]-B));
			if(now<M)
			{
				M=now;
				i=j;
			}
		}
		cout<<s[i]<<endl;
	}
}

