
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  int i,j;
  char str[8][10]={"black","blue","lime","aqua",
		   "red","fuchsia","yellow","white"};
  int col[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}};
  while(1){
    string s;
    cin>>s;
    if(s=="0")break;
    vi v(3,0);
    rep(i,3){
      if('a'<=s[i*2+1] && s[i*2+1]<='f')v[i]+=10+(s[i*2+1]-'a');
      else v[i]+=s[i*2+1]-'0';
      v[i]*=16;
      if('a'<=s[i*2+2] && s[i*2+2]<='f')v[i]+=10+(s[i*2+2]-'a');
      else v[i]+=s[i*2+2]-'0';
    }
    int ans=INF;
    rep(i,8){
      int tmp=0;
      rep(j,3)tmp+=(col[i][j]-v[j])*(col[i][j]-v[j]);
      ans=min(ans,tmp);
    }
    rep(i,8){
      int tmp=0;
      rep(j,3)tmp+=(col[i][j]-v[j])*(col[i][j]-v[j]);
      if(tmp==ans){
	cout<<str[i]<<endl;
	break;
      }
    }

  }
}