Palette = [[0,0,0],[0,0,255],[0,255,0],[0,255,255],[255,0,0],[255,0,255],[255,255,0],[255,255,255]]
Color = ["black","blue","lime","aqua","red","fuchsia","yellow","white"]

def solve hex
  rgb = hex.split("")
  r = (rgb[0] + rgb[1]).hex.to_i
  g = (rgb[2] + rgb[3]).hex.to_i
  b = (rgb[4] + rgb[5]).hex.to_i
  similar = -1
  diff = 10000
  Palette.size.times do |k|
    dk = Math.sqrt((r - Palette[k][0]) ** 2 + (g - Palette[k][1]) ** 2 + (b - Palette[k][2]) ** 2)
    if dk < diff
      diff = dk
      similar = k
    end
  end
  Color[similar]
end

while (input = $stdin.gets.chomp) != "0" do
  printf "%s\n", solve(input.delete("#"))
end