#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <sstream>
#include <string>
using namespace std;

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

using namespace std;

int sq(int n){
    return n*n;
}

int main(){
    char c[10];
    while(cin>>c && c[0]!='0'){
        unsigned md=1<<30;
        int cn;
        unsigned cd=strtoul(c+1,0,16);
        rep(i,8){
            unsigned d=0;
            rep(j,3){
                static const unsigned cc[]={0x0,0xff,0xff00,0xffff,0xff0000,0xff00ff,0xffff00,0xffffff};
                d+=sq((cd>>j*8&0xFF)-(cc[i]>>j*8&0xFF));
            }
            if(d<md){
                md=d;
                cn=i;
            }
        }

        const string cstr[]= {
            "black",
            "blue",
            "lime",
            "aqua",
            "red",
            "fuchsia",
            "yellow",
            "white"
        };
        cout<<cstr[cn]<<endl;
    }
    return 0;
}