import scala.annotation.tailrec
import scala.collection.mutable

object Main extends App {

  import scala.io.StdIn._

  solve
  @tailrec
  def solve: Unit = {
    val record = readLine.trim
    if (record == "0") return
    val color = Color(record.drop(1))
    val colorName = Array("black", "blue", "lime", "aqua", "red", "fuchsia", "yellow", "white")
    val colors = Array("000000", "0000ff", "00ff00", "00ffff", "ff0000", "ff00ff", "ffff00", "ffffff").map(Color(_))
    println(colors.indices.minBy(i ⇒ colors(i).distance(color)).let(colorName(_)))
    solve
  }
  object Color{
    def apply(expression: String): Color = Color(Integer.parseInt(expression.take(2), 16), Integer.parseInt(expression.drop(2).take(2), 16), Integer.parseInt(expression.drop(4), 16))
  }
  case class Color(red: Int, green: Int, blue: Int) {
    def distance(that: Color): Double = math.sqrt((red - that.red).let{it ⇒ it * it} + (green - that.green).let{it ⇒ it * it} + (blue - that.blue).let{it ⇒ it * it})
  }

  implicit class Extension[T](value :T){
    @inline
    def let[A](@inline func: T ⇒ A): A = func(value)
    @inline
    def also(@inline func: T ⇒ Unit): T = {func(value); value}
  }
}
