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

const int INF = 1 << 28;

int decimal(char a, char b) {
    int d;
    if (isdigit(a)) d += a - '0';
    else d += a - 'a' + 10;
    d *= 16;

    if (isdigit(b)) d += b - '0';
    else d += b - 'a' + 10;
    
    return d;
}

struct color_t {
    int r, g, b;
    color_t(int r=0, int g=0, int b=0) : r(r), g(g), b(b) {}
    color_t(string s) {
        r = decimal(s[1], s[2]);
        g = decimal(s[3], s[4]);
        b = decimal(s[5], s[6]);
    }
};

int square_distance(color_t a, color_t b) {
    return (a.r - b.r) * (a.r - b.r) + (a.g - b.g) * (a.g - b.g) + (a.b - b.b) * (a.b - b.b);
}

int main() {
    string color[8];
    color_t color_v[8];

    color[0] = "black";   color_v[0] = color_t("#000000");
    color[1] = "blue";    color_v[1] = color_t("#0000ff");
    color[2] = "lime";    color_v[2] = color_t("#00ff00");
    color[3] = "aqua";    color_v[3] = color_t("#00ffff");
    color[4] = "red";     color_v[4] = color_t("#ff0000");
    color[5] = "fuchsia"; color_v[5] = color_t("#ff00ff");
    color[6] = "yellow";  color_v[6] = color_t("#ffff00");
    color[7] = "white";   color_v[7] = color_t("#ffffff");

    string s;
    while (getline(cin, s)) {
        if (s == "0") break;
        color_t c(s);
        int min_sq_dist = INF;
        string min_dist_color_name;
        for (int i = 0; i < 8; i++) {
            int sq_dist = square_distance(color_v[i], c);
            //cout << color[i] << ' ' << sq_dist << endl;
            if (min_sq_dist > sq_dist) {
                min_sq_dist = sq_dist;
                min_dist_color_name = color[i];
            }
        }
        cout << min_dist_color_name << endl;
    }
    return 0;
}