require 'matrix'

colors = [0, 255].repeated_permutation(3).map{|a| Vector[*a]}
names = %w(
    black   
    blue    
    lime    
    aqua    
    red 
    fuchsia 
    yellow  
    white   
)
color_name = Hash[*colors.zip(names).flatten]

loop do
    s = gets[1..-2]
    break if s == ''
    u = Vector[*s.scan(/../).map{|x| x.hex}]
    puts color_name[colors.min_by{|v| (v - u).r}]
end