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