#K34912. Palindrome Checker

    ID: 25415 Type: Default 1000ms 256MiB

Palindrome Checker

Palindrome Checker

Given a number of test cases T and T strings, your task is to determine for each string whether it is a palindrome.

A string is a palindrome if it reads the same forward and backward. Note that the check is case-sensitive and spaces or special characters are treated as regular characters.

Example:

Input:
3
racecar
hello
madam

Output: YES NO YES

</p>

Your program should read input from standard input and print the result to standard output.

inputFormat

The input begins with an integer T on the first line, representing the number of test cases. Each of the following T lines contains a single string to be checked.

For example:

3
racecar
hello
madam

outputFormat

For each test case, output a single line containing YES if the associated string is a palindrome, or NO otherwise.

For the above example, the output should be:

YES
NO
YES
## sample
3
racecar
hello
madam
YES

NO YES

</p>