NQueen problem extra matrix is being printed

I am performing the NQueen problems but a lot of unnecessary matrix are being printed after the two correct matrix.

By default i have set the values for a 4x4 matrix