A magic square is an arrangement of integers in a square grid where the sum of each row, each column, and both main diagonals is the same. The grid has equal numbers of rows and columns. Let m denote the side length, so the square contains m2 integers. The figure below shows a magic square with m=3.

The first line contains a positive integer n, the number of test cases. Each test case begins with an integer m, the side length of the square. The next m lines each contain m integers separated by one or more spaces.
For each test case, if the square is a magic square, print Magic square of size m, where m is the number of rows. Otherwise print Not a magic square.