#include<iostream>
#include<vector>
#include<string>
#include<unordered_map>
#include<cmath>
using namespace std;
typedef long long int lli;
unordered_map<char, int> h;

lli calc(char a, char b){
  return h[a]*16 + h[b];
}

lli calc(string s){
  lli res = 0;
  for (lli i = 0; i < 3; i++) {
    res *= (16*16);
    res += calc(s[2*i + 1], s[2*i + 2]);
  }
  return res;
}

int main(){
  string s;
  h['0'] = 0;
  h['1'] = 1;
  h['2'] = 2;
  h['3'] = 3;
  h['4'] = 4;
  h['5'] = 5;
  h['6'] = 6;
  h['7'] = 7;
  h['8'] = 8;
  h['9'] = 9;
  h['a'] = 10;
  h['b'] = 11;
  h['c'] = 12;
  h['d'] = 13;
  h['e'] = 14;
  h['f'] = 15;
  vector<lli> val(8);
  string color[] = {"#000000",
                    "#0000ff",
                    "#00ff00",
                    "#00ffff",
                    "#ff0000",
                    "#ff00ff",
                    "#ffff00",
                    "#ffffff"};
  string name[] = {"black",
                   "blue",
                   "lime",
                   "aqua",
                   "red",
                   "fuchsia",
                   "yellow",
                   "white"};
  for (int i = 0; i < 8; i++) {
    val[i] = calc(color[i]);
  }
  while(std::cin >> s, s != "0"){
    lli diff = 1e18, ans = -1;
    for (int i = 0; i < 8; i++) {
      lli hoge = 0;
      for (int j = 0; j < 3; j++) {
        int tmp = 0;
        tmp = calc(s[2*j + 1], s[2*j + 2]) -
          calc(color[i][2*j + 1], color[i][2*j + 2]);
        tmp *= tmp;
        hoge += tmp;
      }
      if(diff > hoge){
        diff = hoge;
        ans = i;
      }
    }
    std::cout << name[ans] << std::endl;
  }
  return 0;
}