#include<bits/stdc++.h>
using namespace std;

int six_ten(char x){
	if(x >= '0' && x <= '9'){
		return x - '0';
	}
	else{
		return 10 + (x - 'a');
	}
}
 
int main(){
    int color_data[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}};

	string color[8] = {"black", "blue", "lime", "aqua", "red", "fuchsia", "yellow", "white"};
	string s;
	while(true){
		cin >> s;
		if(s == "0")break;
		int r,g,b;
		r = 16 * six_ten(s[1]) + six_ten(s[2]);
		g = 16 * six_ten(s[3]) + six_ten(s[4]);
		b = 16 * six_ten(s[5]) + six_ten(s[6]);

		double maxi = DBL_MAX;
		int key;
		for(int i = 0; i < 8; i++){
			double R = r - color_data[i][0];
			double G = g - color_data[i][1];
			double B = b - color_data[i][2];
			R *= R;
			G *= G;
			B *= B;
			double RGB = sqrt(R + G + B);
			if(RGB < maxi){
				maxi = RGB;
				key = i;
			}
		}
		cout << color[key] << endl;
	}
    return 0;
}
