#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main() {
	string a;
	string c[8] = { "black","blue","lime","aqua","red","fuchsia","yellow","white" };
	int d[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} };
	while (cin>>a&&a!="0")
	{
		double t[3];
		for (int i = 1; i < a.length(); i += 2) {
			double b = 0;
			for (int j = 0; j <= 1; j++) {
				if ((int)a[i + j] >= '0' && (int)a[i +j] <= '9')
					b += (pow(16, (j+1)%2)*(int)(a[i +j] - '0'));
				else 
					b += (pow(16, (j+1)%2)*(10 + (int)a[i + j] - 'a'));
			}
			t[(i - 1) / 2] = b;
		}
		double e = 100000;
		string f = "";
		for (int i = 7; i >= 0; i--) {
			double g = sqrt(pow((t[0] - d[i][0]), 2) + pow((t[1] - d[i][1]), 2) + pow((t[2] - d[i][2]), 2));
			if (g <= e) {
				e = g;
				f = c[i];
			}
		}
		cout << f << endl;
	}
}