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

string cname[] = {"black", "blue", "lime", "aqua", "red", "fuchsia", "yellow", "white"};
int crgb[8][3] = {{0,0,0},{0,0,255},{0,255,0},{0,255,255},{255,0,0},{255,0,255},{255,255,0},{255,255,255}};
int hconvert(char a){
	if('0' <= a && a <= '9'){
		return (a - '0');
	}
	else{
		return (a - 'a' + 10);
	}
}
int main(){
	string str;
	int u,l,rgb[3],now,min,tmp;
	while(cin >> str){
		if(str == "0") break;
		min = 10000000;
		for(int i = 1;i < str.size();i+=2){
			u = hconvert(str[i]);
			l = hconvert(str[i+1]);
			rgb[(i / 2)] = u * 16 + l;
		}
		for(int i = 0;i < 8;++i){
			tmp = 0;
			for(int j = 0;j < 3;++j){
				tmp += (rgb[j] - crgb[i][j]) * (rgb[j] - crgb[i][j]);
			}
			if(tmp < min){
				min = tmp;
				now = i;
			}
		}
		cout << cname[now] << endl;
	}
	return 0;
}