#C6865. The Enchanted Forest

    ID: 50672 Type: Default 1000ms 256MiB

The Enchanted Forest

The Enchanted Forest

In the Enchanted Forest, each magical plant exhibits a mysterious property related to its growth potentials. A plant is considered MAGICAL if it contains at least one even number among its growth potentials; otherwise, it is NOT MAGICAL. Although the legend speaks of contiguous subarrays and secret formulas, the true test is simple: if there exists at least one growth potential that is even, the plant carries magic.

Given a list of plants with their respective growth potentials, determine the status of each plant based on the above criterion.

Note: Even though some may think that sums of contiguous segments could be considered, the magic here is defined solely by the presence of an even number.

inputFormat

The first line of input contains a single integer \(n\) representing the number of plants.

Each of the following \(n\) lines begins with an integer \(m\) (the number of growth potentials for that plant), followed by \(m\) space-separated integers representing the growth potentials.

Example:

3
3 1 2 3
4 1 3 5 7
2 6 -2

outputFormat

Output \(n\) lines. For each plant, print MAGICAL if the plant is magical (i.e. contains at least one even number), otherwise print NOT MAGICAL.

Example:

MAGICAL
NOT MAGICAL
MAGICAL
## sample
3
3 1 2 3
4 1 3 5 7
2 6 -2
MAGICAL

NOT MAGICAL MAGICAL

</p>