open List;;let rec d=function|[]->false|h::t when mem h t->true|_::t->d t and e s=let rec($)i a=if i=String.length s-1then rev a else if String.contains"aeiou"s.[i]then(i+1)$(s.[i+1]::a)else(i+1)$a in 0$[s.[0]]and s n=let rec($)i a=if i=n then rev a else(i+1)$(e(read_line())::a)in let z=sort compare(0$[])in if d z then -1else let rec g k=function|([],_)->k|(_,[])->k|(x::_,y::_)when x<>y->k|(_::x,_::y)->g(k+1)(x,y) and f k=function|[]->k|[_]->k|x::(y::_ as t)->f(max k(g 0(x,y)))t in 1+f 0z let rec q()=let n=read_int()in if n<>0then q(Printf.printf"%d
"(s n));;q()