Sally loves palindromes and has made it her goal to memorize every palidrome in existence. A palindrome is a string that is the same whether it is read forwards or backwards. For example, the following strings are all palindromes:
Dad
Racecar
A man, a plan, a canal, panama!
(If we ignore punctuation)
Sally wants to read the dictionary and memorize every palindrome. Help her figure out whether certain words are palindromes.
Input Specification
The first line of input provides the number of test cases, . test cases follow. Each test case consists of one word containing exclusively uppercase letters.
Output Specification
For each test case, your program should output one line containing YAY
if the word is
a palindrome, or NAY
otherwise.
Sample Input
4
DAD
TOOT
DOORKNOB
RACECAR
Sample Output
YAY
YAY
NAY
YAY
Comments
TACOCAT