#include<iostream>
#include<cstdio>
#include<vector>
using namespace std;

int main(){
  string s;
  int color[][3] = {
                    {0, 0, 0}, //black
                    {0, 0, 0xff}, //blue
                    {0, 0xff, 0}, //lime
                    {0, 0xff, 0xff}, //aqua
                    {0xff, 0, 0}, //red
                    {0xff, 0, 0xff}, //fuchsia
                    {0xff, 0xff, 0}, //yellow
                    {0xff, 0xff, 0xff} //white
  };
  string ans[] = {"black", "blue", "lime", "aqua", "red", "fuchsia", "yellow", "white"};
  while(std::cin >> s, s != "0"){
    double min_val = 1e9;
    int num = -1;
    for (int i = 0; i < 8; i++) {
      double val = 0;
      unsigned int tmp;
      string type;
      // type = "0x" + s.substr(1, 2);
      type = s.substr(1, 2);
      // std::cout << type << std::endl;
      // sscanf("0x" + s.substr(), "%x", tmp);
      sscanf(type.c_str(), "%x", &tmp);
      // std::cout << type << std::endl;
      val += (color[i][0] - tmp)*(color[i][0] - tmp);
      
      type = "0x" + s.substr(3, 2);
      sscanf(type.c_str(), "%x", &tmp);
      val += (color[i][1] - tmp)*(color[i][1] - tmp);
      
      type = "0x" + s.substr(5, 2);
      sscanf(type.c_str(), "%x", &tmp);
      val += (color[i][2] - tmp)*(color[i][2] - tmp);
      if(min_val > val){
        min_val = val;
        num = i;
      }
    }
    std::cout << ans[num] << std::endl;
  }
  return 0;
}

