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

int parse(string s){
	int tmp = 0;
	if(s[0] >= 'a' && s[0] <= 'f') tmp = s[0] - 'a' + 10;
	else tmp = s[0] - '0';
	if(s[1] >= 'a' && s[1] <= 'f') tmp = tmp * 16 + s[1] - 'a' + 10;
	else tmp = tmp * 16 + s[1] - '0';
	return tmp;
}

int main(){
	string s;
	string name[] = {"black","blue","lime","aqua","red","fuchsia","yellow","white"};
	int color[3][8] = {{0,0,0,0,255,255,255,255},{0,0,255,255,0,0,255,255},{0,255,0,255,0,255,0,255}};
	while(1){
		int d[8] = {};
		cin >> s;
		if(s == "0") break;
		for(int i = 0;i < 3;i++){
			int num = parse(s.substr(i * 2 + 1,2));
			for(int j = 0;j < 8;j++){
				d[j] += (num - color[i][j]) * (num - color[i][j]);
			}
		}
		int mi = 1e+9,clr;
		for(int i = 0;i < 8;i++){
			if(mi > d[i]){
				mi = d[i];
				clr = i;
			}
		}
		cout << name[clr] << endl;
	}
	return 0;
}