#include <bits/stdc++.h>
using namespace std;
int mod = 1000000007;
int add(int x, int y) {
  if ((x += y) >= mod) x -= mod;
  return x;
}
int T, L;
int dp[105][2505];
int main() {
  char s[110];
  int sum;
  for (int i = 0; i <= 100; i++) dp[i][0] = 1;
  for (int i = 1; i <= 100; i++) {
    int lin = i * 25;
    for (int j = 1; (j <= lin); j++) {
      dp[i][j] = 0;
      for (int k = j; (k >= 0) && (k >= (j - 25)); k--) {
        dp[i][j] = add(dp[i][j], dp[i - 1][k]);
      }
    }
  }
  cin >> T;
  while (T--) {
    scanf("%s", s);
    L = strlen(s);
    sum = 0;
    for (int i = 0; i < L; i++) {
      sum += ((int)(s[i] - 'a'));
    }
    if (dp[L][sum] > 0)
      printf("%d\n", dp[L][sum] - 1);
    else
      printf("%d\n", mod - 1);
  }
  return 0;
}
