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

int hex2digit(const char x) {
    int res = 0;
    if ('0' <= x && x <= '9') {
        res += x - '0';
    } else if ('a' <= x && x <= 'f') {
        res += x - 'a' + 10;
    }
    return res;
}

int main() {
    const int red[] = {0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, };
    const int green[] = {0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, };
    const int blue[] = {0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, };
    const char* color[] = {
        "black", "blue", "lime", "aqua", "red", "fuchsia", "yellow", "white",
    };
    while (true) {
        char input[8];
        cin >> input;
        if (input[0] == '0') {
            break;
        }
        int k = 0,
            r = hex2digit(input[1]) * 16 + hex2digit(input[2]),
            g = hex2digit(input[3]) * 16 + hex2digit(input[4]),
            b = hex2digit(input[5]) * 16 + hex2digit(input[6]);
        double minD = 1000000;
        for (int i = 0; i < (int) sizeof red / (int) sizeof *red; i++) {
            double d = sqrt(pow(r - red[i], 2) + pow(g - green[i], 2) + pow(b - blue[i], 2));
            if (d < minD) {
                minD = d;
                k = i;
            }
        }
        cout << color[k] << endl;
    }
}