Solve multiple grid in one run (one per STDIN line)