map{$v+=1<<$_ for/. /g;$k|=$v^-/Y/;$v=0}<>;$_++while$k>>$_&1;print