#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;

using T = tuple<double, double, double>;

int f(char c) {
    if (c < 'A') return (c - '0');
    else return (c - 'a') + 10;
}

int main() {
    string name[8] = { "black", "blue", "lime", "aqua", "red", "fuchsia", "yellow", "white" };
    T color[8];
    color[0] = T(0, 0, 0);
    color[1] = T(0, 0, 255);
    color[2] = T(0, 255, 0);
    color[3] = T(0, 255, 255);
    color[4] = T(255, 0, 0);
    color[5] = T(255, 0, 255);
    color[6] = T(255, 255, 0);
    color[7] = T(255, 255, 255);
    string s;
    while (cin >> s && s != "0") {
        double r = 0, g = 0, b = 0;
        r = 16 * f(s[1]) + f(s[2]);
        g = 16 * f(s[3]) + f(s[4]);
        b = 16 * f(s[5]) + f(s[6]);

        string ans;
        double mind = 1001001;
        for (int i = 0; i < 8; i++) {
            double t = pow(get<0>(color[i]) - r, 2) + pow(get<1>(color[i]) - g, 2) + pow(get<2>(color[i]) - b, 2);
            double diff = sqrt(t);
            if (mind > diff) {
                mind = diff;
                ans = name[i];
            }
        }
        cout << ans << endl;
    }
}
