#include <iostream>
#include <cctype>

using namespace std;

string Strength[8] = {"000000","0000ff","00ff00","00ffff",
		      "ff0000","ff00ff","ffff00","ffffff"};

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

int x_t(char c){
  if(islower(c)) return 10 + (c - 'a');
  return c - '0';
}

int change(string s){
  return x_t(s[0])*16 + x_t(s[1]);
}

string solve(string R,string G,string B){
  int pos,Min = (1<<29),d;
  int r = change(R),g = change(G),b = change(B);
  string rr,gg,bb;

  for(int i = 0 ; i < 8 ; i++){
    rr = Strength[i].substr(0,2);
    gg = Strength[i].substr(2,2);
    bb = Strength[i].substr(4,2);
 
    int rk = change(rr) ,gk = change(gg) ,bk = change(bb);    
    d = (r-rk)*(r-rk) + (g-gk)*(g-gk) + (b-bk)*(b-bk);

    if(d < Min){
      Min = d;
      pos = i;
    }
  }

  return Color[pos];
}

int main(){
  string str;

  while(cin >> str ,str != "0"){
    string R,G,B;

    R = str.substr(1,2);
    G = str.substr(3,2);
    B = str.substr(5,2);

    cout << solve(R,G,B) << endl;
  }

  return 0;
}