#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#define EPS 1e-10
using namespace std;
typedef long long llong;
string color(int x) {
	switch (x) {
	case 0:return "black";
	case 1:return "blue";
	case 2:return "lime";
	case 3:return "aqua";
	case 4:return "red";
	case 5:return "fuchsia";
	case 6:return "yellow";
	case 7:return "white";
	default:return "gray";
	}
}

int h(char c) {
	if (isalpha(c))return (c - 'a')+10;
	else return (c - '0');
}

int main() {

	map<int, vector<double> >m;
	m[0].push_back(0x00);
	m[0].push_back(0x00);
	m[0].push_back(0x00);
	m[1].push_back(0x00);
	m[1].push_back(0x00);
	m[1].push_back(0xff);
	m[2].push_back(0x00);
	m[2].push_back(0xff);
	m[2].push_back(0x00);
	m[3].push_back(0x00);
	m[3].push_back(0xff);
	m[3].push_back(0xff);
	m[4].push_back(0xff);
	m[4].push_back(0x00);
	m[4].push_back(0x00);
	m[5].push_back(0xff);
	m[5].push_back(0x00);
	m[5].push_back(0xff);
	m[6].push_back(0xff);
	m[6].push_back(0xff);
	m[6].push_back(0x00);
	m[7].push_back(0xff);
	m[7].push_back(0xff);
	m[7].push_back(0xff);

	vector<double>d(8);

	string s;

	while (cin >> s, s != "0") {

		double r, g, b;

		r = h(s[1]) * 16 + h(s[2]); //cout << "red is " << r << endl;
		g = h(s[3]) * 16 + h(s[4]); //cout << "green is " << g << endl;
		b = h(s[5]) * 16 + h(s[6]); //cout << "blue is " << b << endl;

		for (int i = 0; i < 8; i++) {

			d[i] = pow(pow(r - m[i][0], 2) + pow(g - m[i][1], 2) + pow(b - m[i][2], 2), 0.5);
		//	cout << d[i] << " ";
		}//cout << endl;
		cout << color(distance(d.begin(),min_element(d.begin(), d.end()))) << endl;


	}



	return 0;
}