#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 10;
const int p = 1e9 + 7;
char s[maxn];
int t, n, dp[maxn][maxn * 27];
int main() {
  dp[0][0] = 1;
  for (int i = 1; i <= 100; i++)
    for (int j = 0; j <= i * 25; j++)
      for (int k = 0; k <= 25; k++)
        if (j - k >= 0) dp[i][j] = (dp[i][j] + dp[i - 1][j - k]) % p;
  cin >> t;
  while (t--) {
    scanf("%s", s);
    n = strlen(s);
    int sum = 0;
    for (int i = 0; i < n; i++) sum += s[i] - 'a';
    printf("%d\n", dp[n][sum] - 1);
  }
  return 0;
}
