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

using namespace std;

int h(string s){
	int ret = 0;
	int src = 1;
	for(int i=s.length()-1;i>=0;i--){
		ret += (s[i]>'9'?s[i]-'a'+10:s[i]-'0')*src;
		src *= 16;
	}
	return ret;
}

double f(string a,string b){	
	string tr,tg,tb;
	string tr2,tg2,tb2;
	tr = a.substr(1,2);
	tg = a.substr(3,2);
	tb = a.substr(5,2);
	tr2 = b.substr(1,2);
	tg2 = b.substr(3,2);
	tb2 = b.substr(5,2);
	return sqrt(
		(h(tr)-h(tr2))*(h(tr)-h(tr2)) +
		(h(tg)-h(tg2))*(h(tg)-h(tg2)) +
		(h(tb)-h(tb2))*(h(tb)-h(tb2))
	);
}
int main(){
	double MIN;
	string ret;
	
	string rgb;
	while(cin >> rgb && rgb[0] != '0'){
		MIN = (1<<21);
		if(MIN >     f(rgb,"#000000")){
			MIN = f(rgb,"#000000");
			ret = "black";
		}
		if(MIN >     f(rgb,"#0000ff")){
			MIN = f(rgb,"#0000ff");
			ret = "blue";
		}
		if(MIN >     f(rgb,"#00ff00")){
			MIN = f(rgb,"#00ff00");
			ret = "lime";
		}
		if(MIN >     f(rgb,"#00ffff")){
			MIN = f(rgb,"#00ffff");
			ret = "aqua";
		}
		if(MIN >     f(rgb,"#ff0000")){
			MIN = f(rgb,"#ff0000");
			ret = "red";
		}
		if(MIN >     f(rgb,"#ff00ff")){
			MIN = f(rgb,"#ff00ff");
			ret = "fuchsia";
		}
		if(MIN >     f(rgb,"#ffff00")){
			MIN = f(rgb,"#ffff00");
			ret = "yellow";
		}
		if(MIN >     f(rgb,"#ffffff")){
			MIN = f(rgb,"#ffffff");
			ret = "white";
		}
		cout << ret << endl;

	}
}