#include <iostream>
using namespace std;

const char* color[] = {
	"black", "blue", "lime", "aqua", "red", "fuchsia", "yellow", "white"
};

const int RGB[][ 3 ] = {
	{ 0, 0, 0 }, { 0, 0, 255 }, { 0, 255, 255 },
	{ 0, 255, 255 }, { 255, 0, 0 }, { 255, 0, 255 },
	{ 255, 255, 0 }, { 255, 255, 255 },
};

int xtod( char* c )
{
	int ret = 0;
	int mag = 16;
	for( int i = 0; i < 2; ++i, ++c ){
		int d = 0;
		if( *c >= '0' && *c <= '9' ){
			d = *c - '0';
		}else{
			d = *c - 'a' + 10;
		}
		ret += ( d * mag );
		mag /= 16;
	}
	return ret;
}

int distance( const int* o, int* x )
{
	int dd[ 3 ];
	for( int i = 0; i < 3; ++i ){
		dd[ i ] = x[ i ] - o[ i ];
		dd[ i ] *= dd[ i ];
	}
	return dd[ 0 ] + dd[ 1 ] + dd[ 2 ];
}

int main()
{
	char col[ 8 ];

	while( cin >> col && *col != '0' ){
		int n[ 3 ];
		for( int i = 0; i < 3; ++i ){
			n[ i ] = xtod( col + ( 1 + i * 2 ) );
		}
		int d[ 8 ];
		for( int i = 0; i < 8; ++i ){
			d[ i ] = distance( RGB[ i ], n );
		}
		int ans = 0;
		int ansD = 200000;
		for( int i = 0; i < 8; ++i ){
			if( d[ i ] < ansD ){
				ans = i;
				ansD = d[ i ];
			}
		}
		cout << color[ ans ] << endl;
	}

	return 0;
}