#include <string>
#include <vector>
#include <iostream>

using namespace std;

int hextoi(string S)
{
    int sum = 0;
    
    if(isdigit(S[0]))
    {
        sum += (S[0] - 48) * 16;
    }
    else
    {
        sum += (S[0] - 87) * 16;
    }
    if(isdigit(S[1]))
    {
        sum += S[1] - 48;
    }
    else
    {
        sum += S[1] - 97;
    }
    
    return sum;
}

const vector<string> color = { "black", "blue", "lime", "aqua", "red", "fuchsia", "yellow", "white" };

int main()
{
    string S;
    
    while(true)
    {
        cin >> S;
        
        if(S == "0") { break; }
        
        int R = hextoi(S.substr(1, 2));
        int G = hextoi(S.substr(3, 2));
        int B = hextoi(S.substr(5, 2));
        
        int near = 999999999, c = -1;
        
        for(int i = 0; i < 8; i++)
        {
            int R2 = ((i / 4) % 2 ? 255 : 0);
            int G2 = ((i / 2) % 2 ? 255 : 0);
            int B2 = ((i / 1) % 2 ? 255 : 0);
            
            int N2 = (R - R2) * (R - R2) + (B - B2) * (B - B2) + (G - G2) * (G - G2);
            
            if(N2 < near)
            {
                near = N2; c = i;
            }
        }
        
        cout << color[c] << endl;
    }
    
    return 0;
}