#include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back


string color[8]={"black","blue","lime","aqua","red","fuchsia","yellow","white"};
string col[8]={"000000","0000ff","00ff00","00ffff","ff0000","ff00ff","ffff00","ffffff"};

int to(char ch){
    if('0'<=ch && ch<='9')return ch-'0';
    else return ch-'a'+10;
}

int solve(string s,int n){
    string t=col[n];
    
    string a[3],b[3];
    rep(i,3){
        a[i]=s.substr(i*2,2);
        b[i]=t.substr(i*2,2);
    }
    int x[3];
    rep(i,3){
        
        x[i]=abs(  ( to(a[i][0])*16 + to(a[i][1]) ) -( to(b[i][0])*16 + to(b[i][1]) )  );
    }
    
    return sqrt( pow(x[0],2)+pow(x[1],2)+pow(x[2],2) );
}


int main() {
    string s;
    while(cin>>s){
        if(s=="0")break;
        
        s=s.substr(1,6);
        
        int mini=999999999;
        int num=-1;
        
        
        rep(i,8){
            
            if(mini>solve(s,i)){
                num=i;
                mini=solve(s,i);
            }
        }
        
        
        
        cout<<color[num]<<endl;
    }
    return 0;
}