T = [
  ['black', 0x00, 0x00, 0x00],
  ['blue', 0x00, 0x00, 0xff],
  ['lime', 0x00, 0xff, 0x00],
  ['aqua', 0x00, 0xff, 0xff],
  ['red', 0xff, 0x00, 0x00],
  ['fuchsia', 0xff, 0x00, 0xff],
  ['yellow', 0xff, 0xff, 0x00],
  ['white', 0xff, 0xff, 0xff]
]
loop do
  s = gets.chomp
  break if s == ?0
  cs = s.each_char.drop(1).each_slice(2).map {|as| as.join.to_i 16 }
  puts T.min_by {|_, *ds| cs.zip(ds).map {|c, d| (c - d)**2 }.reduce(0, :+) }[0]
end