#include <iostream>
#include <string>
#include <cmath>
using namespace std;

int checkHeight(double h);
const string COLORS[8] = {"black", "blue", "lime", "aqua"
                         , "red", "fuchsia", "yellow", "white"};

const int RGB_VALUES[8][3] = {{0, 0, 0},
                             {0, 0, 255},
                             {0, 255, 0},
                             {0, 255, 255},
                             {255, 0, 0},
                             {255, 0, 255},
                             {255, 255, 0},
                             {255, 255, 255}};

int toDec(char s);

int main()
{
    while(1)
    {
        string in_str;
        cin >> in_str;
        if(in_str == "0")
        {
            break;
        }
        
        int r = toDec(in_str[1]) * 16 + toDec(in_str[2]);
        int g = toDec(in_str[3]) * 16 + toDec(in_str[4]);
        int b = toDec(in_str[5]) * 16 + toDec(in_str[6]);

        double dist_min = 1000000;
        int index = 0;
        for(int i = 0; i < 8; i++)
        {
            double dist_square = (r - RGB_VALUES[i][0]) * (r - RGB_VALUES[i][0])
                                 + (g - RGB_VALUES[i][1]) * (g - RGB_VALUES[i][1])
                                 + (b - RGB_VALUES[i][2]) * (b - RGB_VALUES[i][2]);
            if(isless(dist_square, dist_min))
            {
                dist_min = dist_square;
                index = i;
            }
        }
        cout << COLORS[index] << endl;
    }
    return 0;
}

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

