#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <cstring>
#include <deque>
#include <cstdio>
#include <cmath>
#include <complex>
#include <iostream>
#include <iterator>

using namespace std;

#define reep(i,f,t) for(int i=f ; i<int(t) ; ++i)
#define rep(i,n) reep(i, 0, n) 
#define sq(a) ((a)*(a))

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int main()
{
	char str[8];
	while(scanf("%s", str), str[0]!='0'){
		int v;
		sscanf(str+1, "%x", &v);
		int r = v / 0x10000;
		int g = (v % 0x10000) / 0x100;
		int b =  v % 0x100;
		
		const int rs[] = {0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff};
		const int gs[] = {0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff};
		const int bs[] = {0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff};
		
		int bestid = 0;
		int best = 1<<29;
		rep(i, 8){
			int d = sq(r-rs[i])+sq(g-gs[i])+sq(b-bs[i]);
			if(d < best){
				best = d;
				bestid = i;
			}
		}
		
		const char* name[] = {"black", "blue", "lime", "aqua", "red", "fuchsia", "yellow", "white"};
		puts(name[bestid]);
	}
	
	return 0;
}