#include <iostream>
#include <map>
#include <vector>
#include <string>
#include <tuple>

using namespace std;

class Solver{

};

int main() {
	vector<tuple<string, string>> colors{
		make_tuple("#000000","black"),
		make_tuple("#0000ff","blue"),
		make_tuple("#00ff00","lime"),
		make_tuple("#00ffff","aqua"),
		make_tuple("#ff0000","red"),
		make_tuple("#ff00ff","fuchsia"),
		make_tuple("#ffff00","yellow"),
		make_tuple("#ffffff","white"),
	};


	while (true) {
		string s;
		cin >> s;
		if (s[0] == '0')break;

		int num = -1;
		int dd = 1e9;
		int r = 0;
		int g = 0;
		int b = 0;
		if ('a' <= s[1] && s[1] <= 'f')r += 16 * (s[1] - 'a' + 10);
		else r += 16 * (s[1] - '0');
		if ('a' <= s[2] && s[2] <= 'f')r += (s[2] - 'a' + 10);
		else r += (s[2] - '0');
		if ('a' <= s[3] && s[3] <= 'f')g += 16 * (s[3] - 'a' + 10);
		else g += 16 * (s[3] - '0');
		if ('a' <= s[4] && s[4] <= 'f')g += (s[4] - 'a' + 10);
		else g += (s[4] - '0');
		if ('a' <= s[5] && s[5] <= 'f')b += 16 * (s[5] - 'a' + 10);
		else b += 16 * (s[5] - '0');
		if ('a' <= s[6] && s[6] <= 'f')b += (s[6] - 'a' + 10);
		else b += (s[6] - '0');

		for (int i = 0; i < 8; i++) {
			int rr = 0;
			int gg = 0;
			int bb = 0;
			if (get<0>(colors[i])[1] == 'f')rr = 255;
			if (get<0>(colors[i])[3] == 'f')gg = 255;
			if (get<0>(colors[i])[5] == 'f')bb = 255;

			int tmp_d = (rr - r) * (rr - r)
				+ (gg - g) * (gg - g) + (bb - b) * (bb - b);
			if (tmp_d < dd) {
				num = i;
				dd = tmp_d;
			}
		}

		cout << get<1>(colors[num]) << endl;
	}
}
