#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#define mod 1000000007
typedef long long ll;
using namespace std;
int d[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 ans[8]={
  "black",
  "blue",
  "lime",
  "aqua",
  "red",
  "fuchsia",
  "yellow",
  "white"
};
int F(char z){
  if('0'<=z&&z<='9')return z-'0';
  return 10+z-'a';
}
int main(){
  string s;
  while(cin>>s&&s!="0"){
    int a=F(s[1])*16+F(s[2]);
    int b=F(s[3])*16+F(s[4]);
    int c=F(s[5])*16+F(s[6]);
    int mini=mod,pnt;
    for(int i=0;i<8;i++){
      int dis=(d[i][0]-a)*(d[i][0]-a);
      dis+=(d[i][1]-b)*(d[i][1]-b);
      dis+=(d[i][2]-c)*(d[i][2]-c);
      if(dis<mini)mini=dis,pnt=i;
    }
    cout<<ans[pnt]<<endl;
  }
  return 0;
}