Magic Square#5300

Magic Square

1 segundo
64 megabytes
Media (≈1350)

A magic square is a grid where the sum of the numbers in each row and each column is identical; there are no requirements for the sums of the diagonals.

Your task is to construct such a square using a given set of numbers.

Entrada

The input file provides distinct integers, each ranging from to .

Salida

The output file should display the numbers arranged to form a 4 \times 4 magic square, with each number appearing exactly once, arranged in four rows of four numbers each. If it is not possible to construct such a square, output the line NO SOLUTION.

Ejemplos

Ejemplo 1

Loading
Loading