#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>

#define REP(i,n) for(long long i=0;i<n;++i)
#define REPR(i,n) for(long long i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(long long i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define INF 999999999
#define MOD 1000000007
#define pb push_back
#define pf push_front
#define MP make_pair
#define SV(v) {for(long long sitr=0;sitr<v.size();++sitr){cin>>v[sitr];}}

int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};

using namespace std;

typedef pair<int,int> pii;

int R[8], G[8], B[8];
string color[8] = {"black", "blue", "lime", "aqua", "red", "fuchsia", "yellow", "white"};

int calc_d(int r, int g, int b, int i){
  return (r - R[i]) * (r - R[i]) + (g - G[i]) * (g - G[i]) + (b - B[i]) * (b - B[i]);
}

int main(){

  REP(i,8){
    if(i % 2 == 1){
      B[i] = 255;
    }
    if(i % 4 >= 2){
      G[i] = 255;
    }
    if(i >= 4){
      R[i] = 255;
    }
  }

  while(true){
    string s;
    cin >> s;

    if(s == "0") break;

    int r, g, b;
    r = stoi(s.substr(1,2), nullptr, 16);
    g = stoi(s.substr(3,2), nullptr, 16);
    b = stoi(s.substr(5,2), nullptr, 16);

    int ans = 0;
    int d = INF;
    REP(i,8){
      int tmp = calc_d(r, g, b, i);
      if(tmp < d){
        d = tmp;
        ans = i;
      }
    }
    cout << color[ans] << endl;
  }
  return 0;
}


