#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
template <class T>
inline T bigMod(T p, T e, T M) {
  long long ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T modInverse(T a, T M) {
  return bigMod(a, M - 2, M);
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T lcm(T a, T b) {
  a = abs(a);
  b = abs(b);
  return (a / gcd(a, b)) * b;
}
template <class T>
inline string int2String(T a) {
  ostringstream str;
  str << a;
  return str.str();
}
template <class T>
inline T string2int(string a) {
  stringstream str(a);
  T b;
  str >> b;
  return b;
}
template <class T>
inline void read(T& r) {
  r = 0;
  int f = 1;
  char ch = getchar();
  while (ch < '0' or ch > '9') {
    f = (ch == '-' ? -1 : 1), ch = getchar();
  }
  while (ch >= '0' and ch <= '9') {
    r = r * 10 + ch - '0', ch = getchar();
  }
  r *= f;
}
const int dr[] = {0, 1, 0, -1, -1, 1, 1, -1, -2, -2, 2, 2, -1, -1, 1, 1};
const int dc[] = {1, 0, -1, 0, 1, 1, -1, -1, -1, 1, -1, 1, -2, 2, -2, 2};
int n;
string str;
long long dp[105][3005];
long long solve(int pos, int sum) {
  if (sum < 0) return 0LL;
  if (pos < 0) return 0LL;
  if (pos <= 0) {
    return (sum == 0);
  }
  long long& res = dp[pos][sum];
  if (res != -1) return res;
  res = 0;
  for (int i = int(0); i < int(min(sum, 25) + 1); i++) {
    res = (res + solve(pos - 1, sum - i)) % 1000000007;
  }
  return res;
}
int main() {
  cin >> n;
  memset(dp, -1, sizeof(dp));
  while (n--) {
    cin >> str;
    int sum = 0;
    for (int i = int(0); i < int(int(str.size())); i++) sum += str[i] - 'a';
    long long ans =
        (solve(int(str.size()), sum) - 1LL + 1000000007) % 1000000007;
    cout << ans << endl;
  }
  return 0;
}
