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

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

int main() {

  string s;

  int coltabel[8][3] = { { 0, 0, 0 }, { 0, 0, 256 }, { 0, 256, 0 },
			 { 0, 256, 256 }, { 256, 0, 0 }, { 256, 0, 256 },
			 { 256, 256, 0 }, { 256, 256, 256 } };

  string nametable[8] = { "black", "blue", "lime", "aqua",
			 "red", "fuchsia", "yellow", "white" };

  while(true) {

    cin>>s;
    if( s=="0" ) break;

    int r,g,b;
    r = base16(s[1])*16+base16(s[2]);
    g = base16(s[3])*16+base16(s[4]);
    b = base16(s[5])*16+base16(s[6]);

    int res,tmp=256*256*3,t;

    for(int i=0; i<8; i++) {
      if( ( t = (r-coltabel[i][0])*(r-coltabel[i][0])
	  + (g-coltabel[i][1])*(g-coltabel[i][1])
	  + (b-coltabel[i][2])*(b-coltabel[i][2]) )
	  < tmp ) {
	//cout<<t<<" "<<i<<endl;
	res = i;
	tmp = t;
      }
    }

    cout<<nametable[res]<<endl;
  }
}