#include<bits/stdc++.h>
using namespace std;
typedef long long int lld;
typedef pair<int,string> P;
#define INF (1<<20)

typedef struct {
  string name; // ??????
  string R; // ???
  string G; // ???
  string B; // ???
} color; // ???????§???????

color data[8]=
  {{"black","00","00","00"},
   {"blue","00","00","ff"},
   {"lime","00","ff","00"},
   {"aqua","00","ff","ff"},
   {"red","ff","00","00"},
   {"fuchsia","ff","00","ff"},
   {"yellow","ff","ff","00"},
   {"white","ff","ff","ff"}
  };

int trans(string num){
  int sum = 0;
  if(num[0] >= 'a' && num[0] <= 'f') sum = (num[0] - 'a' + 10)*16;
  else sum = (num[0] - '0')*16;
  if(num[1] >= 'a' && num[1] <= 'f') sum += (num[1] - 'a' + 10);
  else sum += (num[1] - '0');
  return sum;
}

int main(){
  string str;
  int RGB[8][3];
  for(int i=0;i<8;i++){
    RGB[i][0] = trans(data[i].R);
    RGB[i][1] = trans(data[i].G);
    RGB[i][2] = trans(data[i].B);
  }
  while(cin >> str , str!="0"){
    string red = str.substr(1,2);
    string green = str.substr(3,2);
    string blue = str.substr(5,2);
    int r = trans(red);
    int g = trans(green);
    int b = trans(blue);
    double ans = INF;
    int pos = 0;
    for(int i=0;i<8;i++){
      double tr = (r-RGB[i][0])*(r-RGB[i][0]);
      double tg = (g-RGB[i][1])*(g-RGB[i][1]);
      double tb = (b-RGB[i][2])*(b-RGB[i][2]);
      double tmp = sqrt(tr+tg+tb);
      if(ans > tmp){
	ans = tmp;
	pos = i;
      }
    }
    cout << data[pos].name << endl;
  }
}