#include <iostream>
#include <string>
using namespace std;
int m[8][3] = {
  {0,0,0}, {0,0,0xff}, {0,0xff,0}, {0,0xff,0xff},
  {0xff,0,0}, {0xff,0,0xff}, {0xff,0xff,0}, {0xff,0xff,0xff},
};
string s[8] = {
  "black", "blue", "lime", "aqua", "red", "fuchsia", "yellow", "white",
};
int conv(string s)
{
  int n=0,i;
  for(i=0;i<2;i++){
    n *= 16;
    if('0' <= s[i] && s[i] <= '9') n += s[i] - '0';
    else n += s[i] - 'a' + 10;
  }
  return n;
}
int main()
{
  string i;
  for(;;){
    cin >> i;
    if(i=="0") break;
    int r,g,b;
    r = conv(i.substr(1,2));
    g = conv(i.substr(3,2));
    b = conv(i.substr(5,2));
    int d,e=0x1fffffff,j,k;
    for(j=0;j<8;j++){
      d = (r-m[j][0])*(r-m[j][0])+(g-m[j][1])*(g-m[j][1])+(b-m[j][2])*(b-m[j][2]);
      if(e>d) {
	e = d;
	k = j;
      }
    }
    cout << s[k] << endl;
  }
  return 0;
}