#include <iostream>
#include <cstdio>
using namespace std;

#define sq(x) ((x)*(x))

string color_name[8] = {
	"black",
	"blue",
	"lime",
	"aqua",
	"red",
	"fuchsia",
	"yellow",
	"white"
};

int color_rgb[8][3] = {
	{ 0x00, 0x00, 0x00 },
	{ 0x00, 0x00, 0xff },
	{ 0x00, 0xff, 0x00 },
	{ 0x00, 0xff, 0xff },
	{ 0xff, 0x00, 0x00 },
	{ 0xff, 0x00, 0xff },
	{ 0xff, 0xff, 0x00 },
	{ 0xff, 0xff, 0xff },
};

int main( void )
{
	string input;
	while ( 1 )
	{
		cin >> input;
		if ( input == "0" ) break;
		int r, g, b;
		sscanf( input.c_str(), "#%2x%2x%2x", &r, &g, &b );

		int min_value = 1 << 28, min_no = 0;
		for ( int i = 0; i < 8; i++ )
		{
			int d = sq(r-color_rgb[i][0]) + sq( g-color_rgb[i][1] ) + sq(b-color_rgb[i][2]);
			if ( d < min_value )
			{
				min_value = d;
				min_no = i;
			}
		}

		cout << color_name[min_no] << endl;
	}
	return 0;
}