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 = "from math import factorial as ff\nfrom itertools import permutations as p\nfrom itertools import combinations as cc\na=ff(4)%10\nauthor='biggy_bs'\ndef egcd(a, b):\n    if a == 0:\n        return (b, 0, 1)\n    else:\n        g, y, x = egcd(b % a, a)\n        return (g, x - (b // a) * y, y)\n\ndef modinv(a, m):\n    g, x, y = egcd(a, m)\n    if g != 1:\n        raise Exception('modular inverse does not exist')\n    else:\n        return x % m\ndef factorialMod(n, modulus):\n    ans=1\n    if n <= modulus//2:\n        #calculate the factorial normally (right argument of range() is exclusive)\n        for i in range(1,n+1):\n            ans = (ans * i) % modulus   \n    else:\n        #Fancypants method for large n\n        for i in range(1,modulus-n):\n            ans = (ans * i) % modulus\n        ans = modinv(ans, modulus)\n \n        #Since m is an odd-prime, (-1)^(m-n) = -1 if n is even, +1 if n is odd\n        if n % 2 == 0:\n            ans = -1*ans + modulus\n    return ans % modulus\nmod=10**9+7\n\nt=eval(input());dic={}\nwhile t>0:\n    t-=1\n    s=input()\n    if len(s)<=10:\n        uy=''\n        for i in range(len(s)):\n            uy+=str(i)\n        #xxx=p(s,len(s))\n        xxc=cc(uy,2)\n        rtt=[]\n        for i in xxc:\n            rtt.append(i)\n        a=[]\n        #for i in xxx:\n        #    a.append(''.join(i))\n        #a=set(a)\n        #a=list(a)\n        ans_ct=0\n        s=list(s)\n        flag=0\n        lul=[]\n        for ii in rtt:\n            temp1=s[:]\n            temp1[int(ii[0])],temp1[int(ii[1])]=temp1[int(ii[1])],temp1[int(ii[0])]\n            lul.append(''.join(temp1))\n            for jj in rtt:\n                temp2=temp1[:]\n                temp2[int(jj[0])],temp2[int(jj[1])]=temp2[int(jj[1])],temp2[int(jj[0])]\n                lul.append(''.join(temp2))\n        #print ans_ct\n        ans_ct=len(set(lul))\n        dic={}\n        for i in s:\n            try:\n                dic[i]+=1\n            except:\n                dic[i]=1\n        xxx=factorialMod(len(s),mod)\n        for i in dic:\n            xxx=(xxx%mod * modinv(factorialMod(dic[i],mod),mod))%mod\n        ans=(xxx*xxx)%mod\n        ct=0\n        if len(s)<=3:\n            print(0)\n        else:\n            print((ans-(ans_ct*xxx)%mod)  % mod)  \n"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 18174