#include<vector>
#include<list>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#define c(a,b,c,d,e,f) (a-d)*(a-d)+(b-e)*(b-e)+(c-f)*(c-f)
using namespace std;
int f(string s){
  int n=0;
  if('a'<=s[0]&&s[0]<='f')
    n+=(s[0]-'a'+10)*16;
  else
    n+=(s[0]-'0')*16;
  if('a'<=s[1]&&s[1]<='f')
    n+=s[1]-'a'+10;
  else
    n+=s[1]-'0';
  return n;
}
int main(){
  int i;
  int r[8]={0,0,0,0,0xff,0xff,0xff,0xff},g[8]={0,0,0xff,0xff,0,0,0xff,0xff},b[8]={0,0xff,0,0xff,0,0xff,0,0xff};
  int d,e;
  string s[]={"black","blue","lime","aqua","red","fuchsia","yellow","white"},t;
  for(;;){
    cin>>t;
    if(t=="0")
      break;
    d=255*255*3;
    for(i=0;i<8;i++){
      if(d>c(f(t.substr(1,2)),f(t.substr(3,2)),f(t.substr(5,2)),r[i],g[i],b[i])){
	e=i;
	d=c(f(t.substr(1,2)),f(t.substr(3,2)),f(t.substr(5,2)),r[i],g[i],b[i]);
      }
    }
    cout<<s[e]<<endl;
  }
  return 0;
}