text compose(text x, text y, text z)
  array colors = array(x, y, y)
  boolean b = "white" in colors
  boolean r = "red" in colors
  boolean a = "amber" in colors
  boolean v = "green" in colors
  boolean o = "orange" in colors

  if a and not b return "false"
  if v and not o return "false"    
  if o and not v return "false"
return "true"

print compose("amber", "white", "red")
print compose ("green", "white", "red")
print compose("orange", "green", "red")