#include <cstdio>
#include <cstring>
#include <cmath>
struct Color {char s[8]; int R, G, B; double d;};
Color t[8] = {{"black", 0, 0, 0}, {"blue", 0, 0, 255}, {"lime", 0, 255, 0}, {"aqua", 0, 255, 255}, {"red", 255, 0, 0}, {"fuchsia", 255, 0, 255}, {"yellow", 255, 255, 0}, {"white", 255, 255, 255}};
int main()
{
	char s[8];
	int R, G, B, i, r;
	double rd;
	while (scanf("%8s", s))
	{
		if (strcmp(s, "0") == 0) break;
		sscanf(s, "#%2x%2x%2x", &R, &G, &B);
		rd = 500.0;
		for (i = 0; i < 8; i++)
		{
			t[i].d = sqrt((double)(R - t[i].R)*(R - t[i].R) + (double)(G - t[i].G)*(G - t[i].G) + (double)(B - t[i].B)*(B - t[i].B));
			if (rd >= t[i].d)
				rd = t[i].d, r = i;
		}
		printf("%s\n", t[r].s);
	}
	return 0;
}