#include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

int a[6],c[3],d[8][3];
string s,na[]={"black","blue","lime","aqua","red","fuchsia","yellow","white"};

int main(){
	for(int i=0;i<8;i++){
		d[i][0]=i/4*255;
		d[i][1]=(i/2)%2*255;
		d[i][2]=i%2*255;
	}
	while(cin>>s){
		if(s=="0")return 0;
		for(int i=1;i<7;i++){
			if(isdigit(s[i]))a[i-1]=s[i]-'0';
			else a[i-1]=s[i]-'a'+10;
			if(!(i%2))c[i/2-1]=a[i-1]+a[i-2]*16;
		}
		int df=999999,no;
		for(int i=0;i<8;i++){
			int sum=0;
			for(int j=0;j<3;j++)sum+=(c[j]-d[i][j])*(c[j]-d[i][j]);
			if(sum<df){no=i;df=sum;}
		}
		cout<<na[no]<<endl;
	}
}