Emily and Mia are friends. Emily got Mia’s essay paper, but since she is a prankster, she decided to meddle with the words present in the paper. She changes all the words in the paper into palindromes. To do this, she follows two rules: 
- In one operation she can only reduce the value of an alphabet by 1, i.e.  she can change ‘d’ to ‘c’, but she cannot change ‘c’ to ‘d’ or ‘d’ to ‘b’. 
- The alphabet ‘a’ will not be reduced any further. 
Each reduction in the value of any alphabet is counted as a single operation. Find the minimum number of operations required to convert a given string into a palindrome.
-----Input:-----
- The first line contains an integer $T$, denoting the number of test cases. 
- Each test case consists of a string $S$ containing only lowercase characters with no spaces.
-----Output:-----
For each test case on a new line, print the minimum number of operations for the corresponding test case.
-----Constraints-----
- $1<=T<=10$
- $1<=|S|<=10^7$, where $|S|$ denotes length of string S.
-----Sample Input:-----
4 
abc 
abcba 
abcd 
cba
-----Sample Output:-----
2 
0
4
2
-----EXPLANATION:-----
For the first test case string = “abc” 
c->b->a so the string become “aba” which is a palindrome. For this we perform 2 operations
t = int(input())
lst = ["0","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
for i in range(t):
    s = list(input().strip())
    count=0
    s.insert(0,"temp")
    for i in range(1,len(s)):
        #print(s[-i])
        if i > len(s)//2  :
            break
        if s[i] != s[-i] :
            count+=abs(lst.index(s[i])-lst.index(s[-i]))
    print(count)
t = int(input())
lst = ["0","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
for i in range(t):
    s = list(input().strip())
    count=0
    s.insert(0,"temp")
    for i in range(1,len(s)):
        #print(s[-i])
        if i > len(s)//2  :
            break
        if s[i] != s[-i] :
            count+=abs(lst.index(s[i])-lst.index(s[-i]))
    print(count)