
#include<iostream>
#include<vector>
#include<climits>
#include<string>
using namespace std;

int main()
{
  vector< vector<int> > table( 8, vector<int>(3) );
  vector<string> name(8);
  vector<int> color(3);
  char c;
  int i, near, dist, t;
  table[0][0] = 0; table[0][1] = 0; table[0][2] = 0;
  table[1][0] = 0; table[1][1] = 0; table[1][2] = 255;
  table[2][0] = 0; table[2][1] = 255; table[2][2] = 0;
  table[3][0] = 0; table[3][1] = 255; table[3][2] = 255;
  table[4][0] = 255; table[4][1] = 0; table[4][2] = 0;
  table[5][0] = 255; table[5][1] = 0; table[5][2] = 255;
  table[6][0] = 255; table[6][1] = 255; table[6][2] = 0;
  table[7][0] = 255; table[7][1] = 255; table[7][2] = 255;
  name[0] = "black";
  name[1] = "blue";
  name[2] = "lime";
  name[3] = "aqua";
  name[4] = "red";
  name[5] = "fuchsia";
  name[6] = "yellow";
  name[7] = "white";

  while (cin>>c, c!='0') {
    color.clear();
    for (i = 0; i < 3; i++) {
      cin>>c;
      if ('a' <= c) color[i] = c-'a'+10;
      else color[i] = c-'0';
      color[i] *= 16;
      cin>>c;
      if ('a' <= c) color[i] += c-'a'+10;
      else color[i] += c-'0';
    }
    dist = INT_MAX;
    near = 0;
    for (i = 0; i < 8; i++) {
      t = (table[i][0]-color[0])*(table[i][0]-color[0]) + (table[i][1]-color[1])*(table[i][1]-color[1]) + (table[i][2]-color[2])*(table[i][2]-color[2]);
      if (t < dist) {
	near = i;
	dist = t;
      }
    }
    cout<<name[near]<<endl;
  }
  return 0;
}