#include <bits/stdc++.h>

using namespace std;

int hextod(char a,char b){
    int ret=0;
    if(isdigit(b))ret+=b-'0';
    else ret+=10+b-'a';
    if(isdigit(a))ret+=16*(a-'0');
    else ret+=16*(10+a-'a');
    return ret;
}

int main(){
    while(true){
        char un;
        cin>>un;
        if(un=='0')break;
        char r1,r2,g1,g2,b1,b2;
        cin>>r1>>r2>>g1>>g2>>b1>>b2;
        int r,g,b;
        r=hextod(r1,r2);
        g=hextod(g1,g2);
        b=hextod(b1,b2);

        vector<vector<int>> iro(8,vector<int>(3));
        for (int i = 0; i < 8; ++i) {
            if(i%2==0)iro[i][0]=0;
            else iro[i][0]=255;
            if(i%4==0||i%4==1)iro[i][1]=0;
            else iro[i][1]=255;
            if(i<4)iro[i][2]=0;
            else iro[i][2]=255;
        }
        vector<string> ironame={"black","blue","lime","aqua","red","fuchsia","yellow","white"};
        int ans=-1;
        long long mdist=numeric_limits<int>::max();
        for (int i = 0; i < 8; ++i) {
            long long td=0;
            td+=(r-iro[i][2])*(r-iro[i][2]);
            td+=(g-iro[i][1])*(g-iro[i][1]);
            td+=(b-iro[i][0])*(b-iro[i][0]);
            if(td<mdist){
                ans=i;
                mdist=td;
            }
        }
        cout<<ironame[ans]<<endl;
    }

    return 0;
}
