#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()

#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,a,b) for(int i=(a); i<(b); i++)

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
const int IMAX=((1<<30)-1)*2+1;
const double EPS=1e-10;
//int mod=1000000007


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

int c[3];

double d(int i){
	double ret=0.0;
	for(int j=0; j<3; j++){
		ret+=(cal[i][j]-c[j])*(cal[i][j]-c[j]);
	}
	return sqrt(ret);
}

int change(char c){
	if(c>='0'&&c<='9')return c-'0';
	return 10+c-'a';
}

int main(){
	string s;
	int ans;
	while(cin>>s){
		if(s=="0")break;
		for(int i=0; i<3; i++){
			c[i]=change(s[i*2+1])*16+change(s[i*2+2]);
		}
		//cout<<c[0]<<" "<<c[1]<<" "<<c[2]<<endl;
		ans=0;
		for(int i=1; i<8; i++){
			if(d(ans)>d(i))ans=i;
		}
		cout<<t[ans]<<endl;
	}
}