A sequence of five words is called magical if the i-th word is a substring of the (i + 1)-th word for every i in the range 1 <= i < 5.
Note that str_1 is a substring of str_2 if and only if str_1 is present as a sequence of consecutive characters in str_2.
Input
Five lines, one word on each line.
Output
A single line: magical if the sequence is magical, non-magical otherwise.
Example
Input:
a
ab
abc
abcd
abcde
Output:
magical
Write a complete program: read the input with input() and print the result with print().
Input
a
ab
abc
abcd
abcde
Output
magical