colors ={:black =>{:r => 0,:g =>0,:b=>0},
  :blue =>{:r => 0,:g =>0,:b=>255},
  :lime =>{:r => 0,:g =>255,:b=>0},
  :aqua =>{:r => 0,:g =>255,:b=>255},
  :red =>{:r => 255,:g =>0,:b=>0},
  :fuchsia =>{:r => 255,:g =>0,:b=>255},
  :yellow =>{:r => 255,:g =>255,:b=>0},
  :white =>{:r => 255,:g =>255,:b=>255},
}
d = lambda do |r,g,b|
  min = 444
  ans =""
  colors.each do |color,value|
    dk = Math.sqrt((r-value[:r])**2+(g-value[:g])**2+(b-value[:b])**2)
    if min > dk
      min = dk
      ans = color
    end
  end
  ans
end
loop do
  c = gets.chomp
  break if c=='0'
  r,g,b =  c.delete('#').gsub(/(.)(.)/,'\1\2 ').split.map(&:hex)
  puts d.call(r,g,b)
end