t=int(input())
for i in range(t):
    s=input()
    x=""
    for j in s:
        if(j>="a" and j<="z"):
            x=x+chr(ord(j)-32)
        elif(j>="A" and j<="Z"):
            x=x+j
    if(x==x[::-1]):
        print("YES")
    else:
        print("NO")                

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: