#include <bits/stdc++.h>
const double pi = acos(-1);
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
const int MAXN = 1e2 + 5;
const double eps = 1e-9;
using namespace std;
char str[MAXN];
int dp[MAXN][MAXN * MAXN];
void solve() {
  scanf("%s", str);
  int n = strlen(str);
  int ans = 0;
  for (int i = 0; i < n; i++) ans += str[i] - 'a';
  printf("%d\n", (dp[n - 1][ans] - 1));
}
int main() {
  for (int i = 0; i < 26; i++) dp[0][i] = 1;
  for (int i = 1; i < MAXN; i++)
    for (int j = 0; j <= 25 * (i + 1); j++)
      for (int k = 0; k <= min(j, 25); k++)
        dp[i][j] = (dp[i][j] + dp[i - 1][j - k]) % MOD;
  int t;
  scanf("%d", &(t));
  while (t--) solve();
  return 0;
}
