#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

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

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

int main() {
	string str;
	while(cin>>str,str!="0"){
		int r,g,b;
		r=x(str[1])*16+x(str[2]);
		g=x(str[3])*16+x(str[4]);
		b=x(str[5])*16+x(str[6]);
//cout<<r<<" "<<g<<" "<<b<<endl;
		int i;
		string res="";
		int re=1000000000;
		for(i=0;i<8;i++){
			if(re>(r-(i&4?255:0))*(r-(i&4?255:0))+(g-(i&2?255:0))*(g-(i&2?255:0))+(b-(i&1?255:0))*(b-(i&1?255:0))){
				res=color[i];
				re=(r-(i&4?255:0))*(r-(i&4?255:0))+(g-(i&2?255:0))*(g-(i&2?255:0))+(b-(i&1?255:0))*(b-(i&1?255:0));
			}
		}
		cout<<res<<endl;
	}
	return 0;
}