#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <utility>
#include <algorithm>
#include <numeric>
#include <typeinfo>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <ctime>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define foreach(i,c) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

int htoi(char c)
{
	if(isdigit(c))
		return c-'0';
	else
		return c-'a'+10;
}

int main()
{
	int color[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"
	};
	
	for(string s;cin>>s,s[0]!='0';){
		s=s.substr(1);
		int c[3];
		rep(i,3)
			c[i]=htoi(s[i*2])*16+htoi(s[i*2+1]);
		
		int res=0;
		rep(i,8){
			int ci=(c[0]-color[i][0])*(c[0]-color[i][0])+(c[1]-color[i][1])*(c[1]-color[i][1])+(c[2]-color[i][2])*(c[2]-color[i][2]);
			int cr=(c[0]-color[res][0])*(c[0]-color[res][0])+(c[1]-color[res][1])*(c[1]-color[res][1])+(c[2]-color[res][2])*(c[2]-color[res][2]);
			if(cr>ci)
				res=i;
		}
		cout<<name[res]<<endl;
	}
	
	return 0;
}