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

#define for_(i,a,b) for(int i=(a);i<(b);++i)

int rgb[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 name[8] = {"black","blue","lime","aqua","red","fuchsia","yellow","white"};

int sqr(int x) { return x * x; }

void search(string str) {
	string input = str.substr(1, 2) + " " + str.substr(3, 2) + " " + str.substr(5, 2);
	
	int col[3];
	sscanf(input.c_str(), "%x %x %x", &col[0], &col[1], &col[2]);
	
	int min_dst = 1L << 30, ans = -1;
	
	for_(i,0,8) {
		int dst = 0;
		
		for_(j,0,3) {
			dst += sqr(rgb[i][j] - col[j]);
		}
		
		if (min_dst > dst) {
			min_dst = dst;
			ans = i;
		}
	}
	
	cout << name[ans] << endl;
}

int main() {
	string str;
	while (cin >> str, str != "0") search(str);
}