Extract your nested loops into a function and then you can use return to get out of the loop from anywhere, rather than break.
Extract your nested loops into a function and then you can use return to get out of the loop from anywhere, rather than break.