Magic Squares

Given a 4x4 grid, check whether all four row sums and all four column sums are equal, then print whether it is magic.

Easy2ImplementationMatrixNo attempts yetTime limit2sMemory limit512 MB

Problem

A magic square is a square array of numbers in which every row sums to the same total and every column sums to that same total.

A 4×44 \times 4 array of integers is given. Decide whether it is a magic square. This problem compares the four row sums and the four column sums only, and does not look at the diagonals.

Input

The input consists of four lines. Each line holds 4 space-separated integers.

Output

Print magic if the input is a magic square, or not magic if it is not.