n,*a=$<.map &:split p (0..99).one?{|i|a.one?{|e|e[i].size!=8}&&n=i}?n+1:-1