#include<iostream>
#include<string>
using namespace std;
 
const int INF = 10000000;
 
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, 255 }, { 0, 255, 0 },
             { 0, 255, 255 }, { 255, 0, 0 }, { 255, 0, 255 },
             { 255, 255, 0 }, { 255, 255, 255 } };
 
  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=INF,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;
  }
}