#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <sstream>
#include <cassert>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;
typedef pair<int,int> PI;
typedef vector<int> vi;
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#define pb push_back
#define f first
#define s second

main(){
  char c;
  while(~scanf(" %c ",&c)){
    if(c=='0')break;

    int r,g,b;
    scanf("%2x%2x%2x",&r,&g,&b);
    int R[8],G[8],B[8];
    rep(i,8){
      R[i]=i/4*0xff;
      G[i]=i/2%2*0xff;
      B[i]=i%2*0xff;
    }
    string str[]={"black","blue","lime","aqua","red","fuchsia",
      "yellow","white"};

    double mind=sqrt(256*256*3)+1;
    int mini;
    rep(i,8){
      double td=sqrt((r-R[i])*(r-R[i])+(g-G[i])*(g-G[i])+(b-B[i])*(b-B[i]));
      if(td<mind){
        mind=td;
        mini=i;
      }
    }
    cout<<str[mini]<<endl;
  }
}