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\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 modin(a, m):\n    g, x, y = egcd(a, m)\n    return x % m\n# def gcdexten(a,b,x,y):\n# \tif a == 0:\n# \t\tx = 0\n# \t\ty = 1\n# \t\treturn b\n# \tx1 = y1 = 0\n# \tgcd = gcdexten(b%a,a,x1,y1)\n\n# \tx = y1 - (b/a) * x1\n# \ty = x1\n# \treturn gcd\n\n# def modin(a):\n# \tm = 10**9 + 7\n# \tx = y = 0\n# \tg = gcdexten(a,m,x,y)\n# \tres = (x%m + m)%m\n# \treturn res\n\n# void modInverse(int a, int m)\n# {\n#     int x, y;\n#     int g = gcdExtended(a, m, &x, &y);\n#     if (g != 1)\n#         cout << "Inverse doesn\'t exist";\n#     else\n#     {\n#         // m is added to handle negative x\n#         int res = (x%m + m) % m;\n#         cout << "Modular multiplicative inverse is " << res;\n#     }\n# }\n# int gcdExtended(int a, int b, int *x, int *y)\n# {\n#     // Base Case\n#     if (a == 0)\n#     {\n#         *x = 0, *y = 1;\n#         return b;\n#     }\n \n#     int x1, y1; // To store results of recursive call\n#     int gcd = gcdExtended(b%a, a, &x1, &y1);\n \n#     // Update x and y using results of recursive\n#     // call\n#     *x = y1 - (b/a) * x1;\n#     *y = x1;\n \n#     return gcd;\n# }\ndef combi(a,b):\n\tmod = 10**9 + 7\n\tif a < b:\n\t\treturn 0\n\tif a == 1:\n\t\treturn 1\n\tif b < a/2:\n\t\tb = a - b\n\ttemp = 1\n\tfor i in range(b + 1,a + 1):\n\t\ttemp = (temp * i%mod)%mod\n\tdenom = modin(math.factorial(a-b),mod)\n\t# print denom\n\treturn (temp%mod * denom%mod)%mod\nfor _ in range(eval(input())):\n\tmod = 10**9 + 7\n\tstring1 = input()\n\tn = len(string1)\n\tdict1 = {}\n\tcount = 0\n\talpha = set()\n\tfor ele in string1:\n\t\tif ele in dict1:\n\t\t\tdict1[ele] += 1\n\t\telse:\n\t\t\tdict1[ele] = 1\n\t\t\talpha.add(ele)\n\t\t\tcount += 1\n \n\tcount_list = []\n\ttotal = 1\n\trem = n\n\tfor ele in alpha:\n\t\ttotal = (total % mod) * (combi(rem,dict1[ele]) % mod)%mod\n\t\trem -= dict1[ele]\n\t\tcount_list.append(dict1[ele])\n \n\tsum_list = [n - count_list[0]]\n\tfor i in range(1,count):\n\t\tsum_list.append(sum_list[i - 1] - count_list[i])\n \n\tsub_2 = 0\n\tsub = 0\n\tfor i in count_list:\n\t\tsub_2 += (n - i) * i\n\tsub_2 /= 2\n\t# print sub_2\n \n\tsub_3 = 0\n\tfor i in range(count):\n\t\tfor j in range(i + 1,count):\n\t\t\tsub_3 += count_list[i] * count_list[j] * sum_list[j]\n \n\tsub_3 = 2 * sub_3\n \n\tsub_4_4 = 0\n\tfor i in range(count):\n\t\tfor j in range(i + 1,count):\n\t\t\tfor k in range(j + 1,count):\n\t\t\t\tsub_4_4 += count_list[i] * count_list[j] * count_list[k] * sum_list[k]\n \n\tsub_4_4 *= 3\n\tsub_4_2 = 0\n\tfor i in range(count):\n\t\tfor j in range(i + 1,count):\n\t\t\tsub_4_2 += (count_list[i] * (count_list[i] - 1) * count_list[j] * (count_list[j] - 1))/4\n \n\tsub_4_3 = 0\n\tfor i in range(count):\n\t\ttemp = 0\n\t\tfor j in range(count):\n\t\t\tif j != i:\n\t\t\t\ttemp += count_list[j] * (n - count_list[i] - count_list[j])\n\t\ttemp /= 2\n\t\tsub_4_3 += ((count_list[i] * (count_list[i] - 1)) * temp)/2\n\t\t# print sub_4_3\n\tsub_4_3 *= 2\n\t# sub_4 = ((sub_4_2%mod + sub_4_3%mod) + sub_4_4%mod)%mod\n\t# sub_tot = ((sub_2%mod + sub_3%mod)%mod + sub_4%mod)%mod\n\tsub_4 = sub_4_3 + sub_4_4 + sub_4_2\n\tsub_tot = sub_2 + sub_3 + sub_4\n\n\t# print((total * (total - 1)) - (total * sub_tot%mod))%mod\n\t# print ((total)* (total - 1 - (((sub_3 + sub_2)%mod + (sub_4_4 +sub_4_3)%mod)%mod + sub_4_2%mod)))% mod \n\tprint((total * (total - (sub_tot + 1)%mod)%mod)%mod)'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 18246