gets t=i=0 p$<.map(&:split).transpose.one?{|s|i+=1;s*''=~/^[nyaps-]+$/&&t=i}?t:-1