#include<iostream>
#include<string>
#include<map>
using namespace std;
int main() {
	map <char, int>b;
	b.insert(map<char, int>::value_type('0', 0));
	b.insert(map<char, int>::value_type('1', 1));
	b.insert(map<char, int>::value_type('2', 2));
	b.insert(map<char, int>::value_type('3', 3));
	b.insert(map<char, int>::value_type('4', 4));
	b.insert(map<char, int>::value_type('5', 5));
	b.insert(map<char, int>::value_type('6', 6));
	b.insert(map<char, int>::value_type('7', 7));
	b.insert(map<char, int>::value_type('8', 8));
	b.insert(map<char, int>::value_type('9', 9));
	b.insert(map<char, int>::value_type('a', 10));
	b.insert(map<char, int>::value_type('b', 11));
	b.insert(map<char, int>::value_type('c', 12));
	b.insert(map<char, int>::value_type('d', 13));
	b.insert(map<char, int>::value_type('e', 14));
	b.insert(map<char, int>::value_type('f', 15));
	string d[8] = { "black","blue","lime","aqua","red","fuchsia","yellow","white" };
	int e[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 a;
	while (cin >> a&&a != "0") {
		int sa = 10000, t[3];
		string iro;
		for (int i = 1; i < 7; i += 2) {
			char f = a[i], g = a[i + 1];
			t[(i - 1) / 2] = b[f]*16 + b[g];
		}
		for (int i = 7; i >= 0; i--) {
			int h = sqrt(pow((e[i][0] - t[0]), 2) + pow((e[i][1] - t[1]), 2) + pow((e[i][2] - t[2]), 2));
			if (h <= sa) {
				sa = h;
				iro = d[i];
			}
		}
		cout << iro << endl;
	}
}