clr=["black","blue","lime","aqua","red","fuchsia","yellow","white"]

hex=["000000","0000ff","00ff00","00ffff","ff0000","ff00ff","ffff00","ffffff"]

def L(s1,s2):

	return ((int(s1[:2],16)-int(s2[:2],16))**2+(int(s1[2:4],16)-int(s2[2:4],16))**2+(int(s1[4:],16)-int(s2[4:],16))**2)**0.5



def nn(s):

	mn=mni=99999

	for i in range(8):

		if mn>L(hex[i],s):

			mn=L(hex[i],s);mni=i

	return mni



while 1:

	rgb=input()

	if rgb=="0":break

	print(clr[nn(rgb[1:])])
ff=255

clr=["black","blue","lime","aqua","red","fuchsia","yellow","white"]

val=[[0,0,0],[0,0,ff],[0,ff,0],[0,ff,ff],[ff,0,0],[ff,0,ff],[ff,ff,0],[ff,ff,ff]]



def L(s1,s2):

	return ((s1[0]-s2[0])**2+(s1[1]-s2[1])**2+(s1[2]-s2[2])**2)**0.5

	

while 1:

	rgb=input()

	if rgb=="0":break

	rgb=[int(rgb[1:3],16),int(rgb[3:5],16),int(rgb[5:],16)]

	print(clr[min([[L(rgb,val[i]),i] for i in range(8)])[1]])
clr = ["black", "blue", "lime", "aqua", "red", "fuchsia", "yellow", "white"]
hex = ["000000", "0000ff", "00ff00", "00ffff", "ff0000", "ff00ff", "ffff00", "ffffff"]


def L(s1, s2):
    return (
        (int(s1[:2], 16) - int(s2[:2], 16)) ** 2
        + (int(s1[2:4], 16) - int(s2[2:4], 16)) ** 2
        + (int(s1[4:], 16) - int(s2[4:], 16)) ** 2
    ) ** 0.5


def nn(s):
    mn = mni = 99999
    for i in range(8):
        if mn > L(hex[i], s):
            mn = L(hex[i], s)
            mni = i
    return mni


while 1:
    rgb = input()
    if rgb == "0":
        break
    print(clr[nn(rgb[1:])])

ff = 255
clr = ["black", "blue", "lime", "aqua", "red", "fuchsia", "yellow", "white"]
val = [
    [0, 0, 0],
    [0, 0, ff],
    [0, ff, 0],
    [0, ff, ff],
    [ff, 0, 0],
    [ff, 0, ff],
    [ff, ff, 0],
    [ff, ff, ff],
]


def L(s1, s2):
    return ((s1[0] - s2[0]) ** 2 + (s1[1] - s2[1]) ** 2 + (s1[2] - s2[2]) ** 2) ** 0.5


while 1:
    rgb = input()
    if rgb == "0":
        break
    rgb = [int(rgb[1:3], 16), int(rgb[3:5], 16), int(rgb[5:], 16)]
    print(clr[min([[L(rgb, val[i]), i] for i in range(8)])[1]])

+ff = 255 -hex = ["000000", "0000ff", "00ff00", "00ffff", "ff0000", "ff00ff", "ffff00", "ffffff"] +val = [ +    [0, 0, 0], +    [0, 0, ff], +    [0, ff, 0], +    [0, ff, ff], +    [ff, 0, 0], +    [ff, 0, ff], +    [ff, ff, 0], +    [ff, ff, ff], +] -    return ( -        (int(s1[:2], 16) - int(s2[:2], 16)) ** 2 -        + (int(s1[2:4], 16) - int(s2[2:4], 16)) ** 2 -        + (int(s1[4:], 16) - int(s2[4:], 16)) ** 2 -    ) ** 0.5 - - -def nn(s): -    mn = mni = 99999 -    for i in range(8): -        if mn > L(hex[i], s): -            mn = L(hex[i], s) -            mni = i -    return mni +    return ((s1[0] - s2[0]) ** 2 + (s1[1] - s2[1]) ** 2 + (s1[2] - s2[2]) ** 2) ** 0.5 -    print(clr[nn(rgb[1:])]) +    rgb = [int(rgb[1:3], 16), int(rgb[3:5], 16), int(rgb[5:], 16)] +    print(clr[min([[L(rgb, val[i]), i] for i in range(8)])[1]])