require 'set' ans=[] n=gets.to_i ss=Set.new(gets.split(" ").map{|e| e.to_i}) 12.times{|e| ss2=Set[] [0,2,4,5,7,9,11].each{|e2| ss2<<(e+e2)%12 } if ss.size==(ss&ss2).size then ans<