#include <iostream>
#include <string>
#include <cctype>

using namespace std;

int pow(int x, int n) {
  int ans = 1;
  for(int i = 0; i < n; i++) {
    ans *= x;
  }
  return ans;
}

int charToInt(char c) {
  return (int)c - (int)'0';
}

int _16to10(char c) {
  int ans = charToInt(c);
  if(ans >= 0 && ans <= 9) return ans;
  else return (int)tolower(c) - (int)'a' + 10;
}

int _16to10(string str) {
  int ans = 0;
  for(int i = 0; i < str.length(); i++) {
    ans += _16to10(str[i])*pow(16, str.length()-i-1);
  }
  return ans;
}

int d2(string a, string b) {
  int ans = 0;
  for(int i = 0; i < 3; i++) {
    int p = i*2;
    ans += pow(_16to10(a.substr(p,2))-_16to10(b.substr(p,2)), 2);
  }
  return ans;
}

int main() {
  string colors[8][2] = {{"black", "000000"},
			 {"blue", "0000ff"},
			 {"lime", "00ff00"},
			 {"aqua", "00ffff"},
			 {"red", "ff0000"},
			 {"fuchsia", "ff00ff"},
			 {"yellow", "ffff00"},
			 {"white", "ffffff"}};
  while(1) {
    string str;
    cin >> str;
    if(str == "0") break;

    int min = 999999;
    int k;
    for(int i = 0; i < 8; i++) {
      int temp = d2(str.substr(1, 6), colors[i][1]);
      if(temp < min) {
	min = temp;
	k = i;
      }
    }
    cout << colors[k][0] << endl;
  }
  return 0;
}