#include <iostream>
#include <string>
#include <cstdio>
#include <cmath>
using namespace std;

struct set{
  string val;
  double rgb[3];
};

set temp[8];

string name[8] = {"black","blue","lime","aqua","red","fuchsia","yellow","white"};
void make_temp(){
  for(int i=0;i<8;i++){
    temp[i].val = name[i];
    temp[i].rgb[0] = (i >> 2 & 1 ? 255 : 0);
    temp[i].rgb[1] = (i >> 1 & 1 ? 255 : 0);
    temp[i].rgb[2] = (i & 1 ? 255 : 0);
  }
}

int main(){
  make_temp();

  while(true){
    double num[3];
    double ans = (2 << 10);
    string s,spt[3];
    cin >> s;
    if(s == "0") break;

    s.erase(0,1);
    for(int i=0;i<3;i++){
      for(int j=0;j<2;j++){
	spt[i] += s[0]; s.erase(0,1);
      }

      int a;
      sscanf(spt[i].c_str(),"%x",&a);
      num[i] = a;
    }
    
    string a;
    for(int i=0;i<8;i++){
      double d = sqrt(pow(num[0] - temp[i].rgb[0],2) + pow(num[1] - temp[i].rgb[1],2) + pow(num[2] - temp[i].rgb[2],2));

      if(ans > d){
	a = temp[i].val; ans = d;
      }
    }
    cout << a << endl;
  }

}