#include <iostream>
#include <vector>
#include <string>
using namespace std;

string color[8] = {
	"black","blue","lime","aqua","red","fuchsia","yellow","white"
};
int dr[8] = {0,0,0,0,255,255,255,255};
int dg[8] = {0,0,255,255,0,0,255,255};
int db[8] = {0,255,0,255,0,255,0,255};

int to_i(string s){
	int n=0;

	if( s[0] >= '0' && s[0] <= '9' ){
		n += (s[0]-'0')*16;
	}else{
		n += (s[0]-'a'+10)*16;
	}
	if( s[1] >= '0' && s[1] <= '9' ){
		n += s[1] - '0';
	}else{
		n += s[1] - 'a' + 10;
	}
	return n;
}

vector<int> to_RGB(string s){
	vector<int> c;
	c.push_back( to_i( s.substr(1,2) ) );
	c.push_back( to_i( s.substr(3,4) ) );
	c.push_back( to_i( s.substr(5,6) ) );
	return c;
}

int d(int r,int rk,int g,int gk,int b,int bk){
	return (r-rk)*(r-rk) + (g-gk)*(g-gk) + (b-bk)*(b-bk);
}

int main(){
	string s;
	while( cin >> s , s != "0" ){
		vector<int> c = to_RGB( s );
		int ans = 200000;

		for(int i=0 ; i < 8 ; i++ ){
			int dk = d( c[0] , dr[i] , c[1] , dg[i] , c[2] , db[i] );
			ans = min( ans , dk );
		}
		for(int i=0 ; i < 8 ; i++ ){
			int dk = d( c[0] , dr[i] , c[1] , dg[i] , c[2] , db[i] );
			if( dk == ans ){
				cout << color[i] << endl;
				break;
			}
		}
	}
}