P15519 [CCC 2016 J2] Magic Squares

Description

Magic Squares are square arrays of numbers that have the interesting property that the numbers in each column, and in each row, all add up to the same total. Given a $4 \times 4$ square of numbers, determine if it is a magic square.

Input Format

The input consists of four lines, each line having $4$ space-separated integers.

Output Format

Output either **magic** if the input is a magic square, or **not magic** if the input is not a magic square.

Explanation/Hint

**Explanation for Output for Sample Input 1** Notice that each row adds up to $34$, and each column also adds up to $34$. **Explanation for Output for Sample Input 2** Notice that the top row adds up to $19$, but the rightmost column adds up to $11$.