#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(T p, T e, T M) {
  if (e == 0) return 1;
  if (e % 2 == 0) {
    T t = bigmod(p, e / 2, M);
    return (t * t) % M;
  }
  return (bigmod(p, e - 1, M) * p) % 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 modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
template <class T>
inline T multimod(T a, T b, T m) {
  T ans = 0ll;
  a %= m, b %= m;
  while (b) {
    if (b & 1ll) ans = m - ans > a ? (ans + a) : (ans + a - m);
    b >>= 1ll;
    a = (m - a) > a ? a + a : a + a - m;
  }
  return (T)ans;
}
long long dp[102][2688];
char str[102];
long long solve(int ind, int s) {
  if (ind < 0) return 0ll;
  if (s < 0) return 0ll;
  if (ind <= 0 && s != 0) return 0;
  if (ind <= 0 && s == 0) return 1ll;
  long long &ret = dp[ind][s];
  if (ret + 1) return ret;
  ret = 0;
  for (int i = 1; i <= min(s, 26); i++)
    ret = (ret + solve(ind - 1, s - i)) % 1000000007;
  return ret;
}
int main() {
  int i, j, x, y, k;
  int u, v, m, q, t, n, w;
  memset(dp, -1ll, sizeof dp);
  scanf("%d", &t);
  while (t--) {
    scanf("%s", str);
    int len = strlen(str);
    int tot = 0;
    for (i = 0; i < len; i++) tot += str[i] - 'a' + 1;
    long long res = (solve(len, tot) - 1ll + 1000000007) % 1000000007;
    cout << res << endl;
  }
  return 0;
}
