#include <iostream>

using namespace std;

const int rgb[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}};
const string name[8] = {"black", "blue", "lime",
                        "aqua", "red", "fuchsia",
                        "yellow", "white"};

int to_decimal(string s) 
{
    int d[2];
    int ret = 0;

    for (int i = 0; i < 2; i++) {
        if ('a' <= s[i] && s[i] <= 'f') 
            d[i] = s[i] - 'a' + 10;
        else
            d[i] = s[i] - '0';
    }

    return d[0] * 16 + d[1];
}

int main()
{
    string inp;

    while (cin >> inp, inp != "0") {
        int r, g, b;
        int d = 200000;
        int idx = 0;
        
        r = to_decimal(inp.substr(1, 2));
        g = to_decimal(inp.substr(3, 2));
        b = to_decimal(inp.substr(5, 2));

        for (int i = 0; i < 8; i++) {
            int tmp;
            tmp = (r - rgb[i][0]) * (r - rgb[i][0]) + 
                (g - rgb[i][1]) * (g - rgb[i][1]) +
                (b - rgb[i][2]) * (b - rgb[i][2]);

            if (tmp < d) {
                d = tmp;
                idx = i;
            }
        }
        cout << name[idx] << endl;
    }

    return 0;
}