n=read_line.to_i yes=(0..9).map{|i|i} no=[] of Int32 n.times{ a,b,c,d,r=read_line.split p=[a,b,c,d].map(&.to_i) if r=="YES" yes=yes&p else no=no+p end } yes.each{|i|puts i unless no.includes?(i)}