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

double dis(int r1,int r2,int g1,int g2,int b1,int b2){
  return sqrt( (r1-r2)*(r1-r2) + (g1-g2)*(g1-g2) + (b1-b2)*(b1-b2) );
}

int main(){
  string color,ans;
  int r,g,b;
  double dmin,tmp;

  while(1){
    cin >> color;
    if(color=="0")break;

    r = 0;
    if(color[1]-'0' < 10)r += 16*(color[1]-'0');
    else r += 16 * (color[1]-'a'+10);
    if(color[2]-'0' < 10)r += color[2]-'0';
    else r += color[2]-'a'+10;
    g = 0;
    if(color[3]-'0' < 10)g += 16*(color[3]-'0');
    else g += 16 * (color[3]-'a'+10);
    if(color[4]-'0' < 10)g += color[4]-'0';
    else g += color[4]-'a'+10;
    b = 0;
    if(color[5]-'0' < 10)b += 16*(color[5]-'0');
    else b += 16 * (color[5]-'a'+10);
    if(color[6]-'0' < 10)b += color[6]-'0';
    else b += color[6]-'a'+10;

    dmin = 510;
    tmp = dis(r,0,g,0,b,0);
    if(tmp < dmin){
      dmin = tmp;
      ans = "black";
    }
    tmp = dis(r,0,g,0,b,255);
    if(tmp < dmin){
      dmin = tmp;
      ans = "blue";
    }
    tmp = dis(r,0,g,255,b,0);
    if(tmp < dmin){
      dmin = tmp;
      ans = "lime";
    }
    tmp = dis(r,0,g,255,b,255);
    if(tmp < dmin){
      dmin = tmp;
      ans = "aqua";
    }
    tmp = dis(r,255,g,0,b,0);
    if(tmp < dmin){
      dmin = tmp;
      ans = "red";
    }
    tmp = dis(r,255,g,0,b,255);
    if(tmp < dmin){
      dmin = tmp;
      ans = "fuchsia";
    }
    tmp = dis(r,255,g,255,b,0);
    if(tmp < dmin){
      dmin = tmp;
      ans = "yellow";
    }
    tmp = dis(r,255,g,255,b,255);
    if(tmp < dmin){
      dmin = tmp;
      ans = "white";
    }

    cout << ans << endl;
  }
}