This content is archived!For the 2018-2019 school year, we have switched to using the WLMOJ judge for all MCPT related content. This is an archive of our old website and will not be updated.
Sally loves palindromes and has made it her goal to memorize every palindrome 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:
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.
The first line of input provides the number of test cases, T (1 \leq T \leq 100). T test cases follow. Each test case consists of one word containing exclusively uppercase letters.
For each test case, your program should output one line containing
YAY if the word is a palindrome, or
Read only if you are stuck or have already solved the problem.