#include <bits/stdc++.h>
const int mod = 1000000007;
int dp[111][111 * 26];
char A[222];
int f(int len, int sum) {
  if (sum < 0) return 0;
  if (len == 0) return sum == 0;
  if (dp[len][sum] == -1) {
    dp[len][sum] = 0;
    for (int i = 1; i <= 26; i++)
      dp[len][sum] = (dp[len][sum] + f(len - 1, sum - i)) % mod;
  }
  return dp[len][sum];
}
int main() {
  memset(dp, -1, sizeof(dp));
  int tests;
  scanf("%d%*c", &tests);
  while (tests--) {
    gets(A);
    int sum = 0, len = 0;
    for (char *s = A; *s; s++) {
      sum += *s - 'a' + 1;
      len++;
    }
    printf("%d\n", (f(len, sum) - 1 + mod) % mod);
  }
}
