#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <string>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<21

using namespace std;

int change(char c)
{
	if('a' <= c && c <= 'f') return int(c-'a') + 10;
	else return int(c-'0');
}

int main()
{
	string N[8] = {"black","blue","lime","aqua","red","fuchsia","yellow","white"};

	int c[8][3] = {{0,0,0},{0,0,255},{0,255,0},{0,255,255},{255,0,0},{255,0,255},{255,255,0,},{255,255,255}};

	string s;
	while(cin >> s)
	{
		if(s == "0") break;
		
		int r = 0,g = 0,b = 0;

		r += change(s[1])*16 + change(s[2]);
		g += change(s[3])*16 + change(s[4]);
		b += change(s[5])*16 + change(s[6]);
		
		double ans = INF;
		rep(i,8)
		{
			double temp = sqrt(	(c[i][0]-r)*(c[i][0]-r) + (c[i][1]-g)*(c[i][1]-g) + (c[i][2]-b)*(c[i][2]-b));
			ans = min(ans,temp);
		}

		rep(i,8)
		{
			double temp = sqrt(	(c[i][0]-r)*(c[i][0]-r) + (c[i][1]-g)*(c[i][1]-g) + (c[i][2]-b)*(c[i][2]-b));
			if(temp == ans)
			{
				cout << N[i] << endl;
			}
		}
	}
	return 0;
}