#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
const int ff=255;
int conv(char *str){
    int ret=0;
    for(int i=0;i<2;i++){
        int val;
        if(str[i]>='0'&&str[i]<='9')val=str[i]-'0';
        else val=str[i]-'a'+10;
        ret=(ret<<4)+val;
    }
    return ret;
}
int main(){
    char *Name[8]={"black","blue","lime","aqua","red","fuchsia","yellow","white"};
    int rgb[3][8]={{0,0,0,0,ff,ff,ff,ff},{0,0,ff,ff,0,0,ff,ff},{0,ff,0,ff,0,ff,0,ff}};
    char str[100];
    while(scanf("%s",str),str[0]!='0'){
        int rgb_[3];
        for(int i=0;i<3;i++){
            rgb_[i]=conv(str+1+i*2);
        }
        int mav,mac=1e9;
        for(int i=0;i<8;i++){
            int val=0;
            for(int j=0;j<3;j++)val+=(rgb_[j]-rgb[j][i])*(rgb_[j]-rgb[j][i]);
            if(mac>val){
                mac=val;
                mav=i;
            }
        }
        printf("%s\n",Name[mav]);

    }
    return 0;
}