#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define pb(a) push_back(a)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
using namespace std;

struct color{
    string name;
    int r,g,b;
};

int xx(int a){ return a * a; }

string colorName(struct color c[8], double r, double g, double b){
    double near = 99999;
    string name;
    rep(i,8){
        double dis = sqrt(xx(r - c[i].r) + xx(g - c[i].g) + xx(b - c[i].b));
        if(near > dis){
            near = dis;
            name = c[i].name;
        }
    }
    return name;
}

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

int DecimalNumber(char c16[2]){
    int c10 = 0;
    rep(i,chenge(c16[0])){
        c10 += 16;
    }
    c10+=chenge(c16[1]);
    
    return c10;
}


int main(){
    struct color c[8] = {
        {"black", 0, 0, 0},
        {"blue", 0, 0, 255},
        {"lime", 0, 255, 0},
        {"aqua", 0, 255, 255},
        {"red", 255, 0, 0},
        {"fuchsia", 255, 0, 255},
        {"yellow", 255, 255, 0},
        {"white", 255, 255, 255}
    };

    char r[2],g[2],b[2],gar;
    while(true){
        int R,G,B;
        cin >> gar;
        if(gar == '0') break;
        rep(i,2) cin >> r[i]; 
        rep(i,2) cin >> g[i]; 
        rep(i,2) cin >> b[i]; 

        R =  DecimalNumber(r);
        G =  DecimalNumber(g);
        B =  DecimalNumber(b);
        cout << colorName(c,static_cast<int>(R),static_cast<int>(G),static_cast<int>(B)) << endl;
    }

}