Sereja has a string A consisting of n lower case English letters. 

Sereja calls two strings X and Y each of length n similar if they can be made equal by applying the following operation at most once in each of them.

- Chose any two position i, j in the string (i can be equal to j too). Swap the characters at position i with character at position j.

For example strings "abcd" and "acbd" are similar, strings "ab" and "ab" are similar, but strings "abcde" and "bcdea" are not similar. Note that strings  "abc" and "cab" are also similar, as you can swap 'a' and 'c' in the first string to get "cba" and 'a' and 'b' in the second string to get "cba". 

Now Sereja is interested in finding number of ordered pairs of non similar strings X and Y such that they can be constructed from a given string A by permutation of its characters. As answer could be large, please output your answer modulo  (109 + 7).

Note 

A string s (of size n) is said to be constructed from string t (also of size n) by permutation of its characters if there exists a permutation P (of length n), such that s[i] = t[P[i]] for each i from 1 to n.

-----Input-----
- First line contain integer T - number of test cases. 
- For each of the next T lines: 
	
- Each line contains a string A as defined in the problem.

-----Output-----
For each test case, output answer modulo 1000000007 (109 + 7) in separate line. 

-----Constraints-----
- 1 ≤ T ≤  10 
- 1 ≤ n ≤  10^5 

-----Constraints-----
- Subtask #1: 1 ≤ n ≤  10  (25 points)
- Subtask #2: 1 ≤ n ≤  100  (25 points)
- Subtask #3: 1 ≤ n ≤  1000  (25 points)
- Subtask #4: original constraints (25 points)

-----Example-----
Input:
2
z
abcd

Output:
0
144

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'import math\nMAX=((10**9)+7)\nt=int(input())\nwhile t>0:\n    x=input()\n    d={};count=0\n    l=len(x)\n    for item in range(l):\n        flag=0\n        for i in d:\n            if i==x[item]:\n                flag=1\n                d[i]+=1\n                break\n        if flag==0:\n            d.fromkeys(x[item])\n            d[x[item]]=1\n    y=[]\n    for item in d:\n        y.append(d[item])\n    prod=1\n    q=len(y)\n    for item in range(q):\n        prod*=math.factorial(y[item])        \n        if y[item]>1:\n            count+=1\n    def bruce():\n        Sum2=0;Sum3=0;Sum4=0;Sum5=0;Sum6=0\n        for i in range(q):\n            temp3=0\n            if y[i]>1:\n                temp3=y[i]*((y[i]-1)/2)\n            for j in range(i+1,q):\n                temp1=0;temp2=0\n                Sum2+=y[i]*y[j]\n                if y[i]>1:\n                    temp1=y[i]*(y[i]-1)/2\n                if y[j]>1:\n                    temp2=y[j]*(y[j]-1)/2\n                Sum5+=temp1*temp2\n                for k in range(j+1,q):\n                    Sum3+=y[i]*y[j]*y[k]\n                    #print y[i],y[j],y[k]\n                    if y[i]>1:\n                        Sum6+=(y[i]*(y[i]-1))/2*y[j]*y[k]\n                        #print Sum6\n                    if y[j]>1:\n                        Sum6+=y[i]*(y[j]*(y[j]-1))/2*y[k]\n                    #print Sum6\n                    if y[k]>1:\n                        Sum6+=y[i]*y[j]*(y[k]*(y[k]-1))/2\n                    #print Sum6\n                    for z in range(k+1,q):\n                        Sum4+=y[i]*y[j]*y[k]*y[z]\n        #print "Sum2=%d,Sum3=%d,Sum4=%d,Sum5=%d,Sum6=%d"%(Sum2,Sum3,Sum4,Sum5,Sum6)\n        return ((Sum2%MAX+(Sum3*2)%MAX+(Sum4*3)%MAX+Sum5%MAX+(Sum6*2)%MAX))\n    ans1=bruce()\n    fact=math.factorial(l)\n    #print "fact=%d,prod=%d"%(fact,prod)\n    ast=fact/prod\n    #print ast\n    temp=(((ast)%MAX)*((ast-1)%MAX))%MAX\n    RRR=((ast%MAX)*(ans1%MAX))%MAX\n    ans=(temp-RRR+MAX)%MAX\n    print(ans)\n    t-=1\n'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13439