Problem W: CCC16J2 MagicSquares

Problem W: CCC16J2 MagicSquares

Time Limit: 2000 Sec  Memory Limit: 1 MB
Submit: 16  Solved: 9
[Submit] [Status] [Web Board] [Creator:]

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×4 square of numbers, determine if it is magic square.

Input

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




Output

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

Sample Input Copy

16 3 2 13 
5 10 11 8 
9 6 7 12 
4 15 14 1

Sample Output Copy

magic