#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using pii = pair<int, int>;

vector<vector<int>> rgb = {
  {0, 0, 0},
  {0, 0, 255},
  {0, 255, 0},
  {0, 255, 255},
  {255, 0, 0},
  {255, 0, 255},
  {255, 255, 0},
  {255, 255, 255}
};
vector<string> name = {"black", "blue", "lime", "aqua", "red", "fuchsia", "yellow", "white"};

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  auto f = [&](string s) { return (isdigit(s[0]) ? s[0] - '0' : s[0] - 'a' + 10) * 16 + (isdigit(s[1]) ? s[1] - '0' : s[1] - 'a' + 10); };
  string s;
  while (cin >> s, s != "0") {
    int r = f(s.substr(1, 2)), g = f(s.substr(3, 2)), b = f(s.substr(5, 2));
    double d_min = 1e9;
    string ans = "";
    for (int i = 0; i < 8; i++) {
      double d = sqrt(pow(r - rgb[i][0], 2.0) + pow(g - rgb[i][1], 2.0) + pow(b - rgb[i][2], 2.0));
      if (d < d_min) {
        d_min = d;
        ans = name[i];
      }
    }
    cout << ans << endl;
  }

  return 0;
}
