#include<cstdio>
#include<algorithm>
#include<cmath>
#include<iostream>
using namespace std;
int main(){
	string str;
	string ans[10];
	ans[0]="black";ans[1]="blue";ans[2]="lime";ans[3]="aqua";ans[4]="red";
	ans[5]="fuchsia";ans[6]="yellow";ans[7]="white";
	while(true){
		cin >> str;
		if(str[0] == '0')break;
		int r[]={0,0,0,0,255,255,255,255};
		int g[]={0,0,255,255,0,0,255,255};
		int b[]={0,255,0,255,0,255,0,255};
		char ch[]={"0123456789abcdef"};
		int best = -1;
		int x=10000000;
		int R=0,G=0,B=0;
		
		for(int i = 0; i < 16; i++){
			if(str[1] == ch[i])R += i*16;
			if(str[2] == ch[i])R += i;
		}
		for(int i = 0; i < 16; i++){
			if(str[3] == ch[i])G += i*16;
			if(str[4] == ch[i])G += i;
		}
		for(int i = 0; i < 16; i++){
			if(str[5] == ch[i])B += i*16;
			if(str[6] == ch[i])B += i;
		}
		//cout << R << ":"<< G <<":"<< B << endl;
		for(int i = 0; i < 8; i++){
			int k = (R-r[i])*(R-r[i])+(G-g[i])*(G-g[i])+(B-b[i])*(B-b[i]);
			if(k < x){
				best = i;
				x = k;
			}
		}
		cout << ans[best] << endl;
	}
	return 0;
}