#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int in[256]={0};
int han[3][8]={
  {  0,  0,  0,  0,256,256,256,256},
  {  0,  0,256,256,  0,  0,256,256},
  {  0,256,  0,256,  0,256,  0,256}
};
string ss[8]={"black","blue","lime","aqua","red","fuchsia","yellow","white"};
int main(){
  string s;
  loop(i,'0','9'+1)in[i]=i-'0';
  loop(i,'a','g')in[i]=i-'a'+10;
  while(cin>>s,s.size()!=1||s[0]!='0'){
    int a[3]={0};
    rep(i,3){
      a[i]=in[s[2*i+1]]*16+in[s[2*i+2]];
    }
    long long int mi=1000000000;
    int ms;
    rep(i,8){
      long long int sum=0;
      rep(j,3)sum+=(han[j][i]-a[j])*(han[j][i]-a[j]);
      if(mi>sum){
	ms=i;
	mi=sum;
      }
    }
    cout<<ss[ms]<<endl;
  }
}