I think in some test was error.
in string where must only 1 or more '_'
as state in problem: each grid is terminated by a separation line full of underscores `_'.
judge (if see carefull test file for 785 ) may wotch
that situeted ' '(I think on end of string full of underscores `_' )
base on that some good sol get wa
then piple chit and think that '_' can't be the marking characters
and 'X' to can't be the marking characters
pls add test where contours is other than 'X'
and '_' and 'X' is marking characters
and DELETE all but '_' chars from string witch end evry grid

