判斷二維字元串是否滿足下面條件:
on both diagonals of the square paper all letters are the same;
all other squares of the paper (they are not on the diagonals) contain the same letter that is different from the letters on the diagonals.
Help Valera, write the program that completes the described task for him.
Input
The first line contains integer n (3?≤?n?<?300; n is
odd). Each of the next n lines contains nsmall
English letters — the description of Valera‘s paper.
Output
Print string "YES", if the letters on the paper form letter "X".
Otherwise, print string "NO". Print the strings without quotes.
Sample test(s)
input
output
唯一一個陷阱:
特殊情況:
3
aaa