#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
char str[201];
long long dp[101][2501];
int len;
int main() {
  dp[0][0] = 1;
  int i, j, k;
  for (i = 1; i <= 100; ++i) {
    dp[i][0] = 1;
    for (j = 1; j <= i * 25; ++j) {
      for (k = max(0, j - 25 * (i - 1)); k <= 25 && k <= j; ++k) {
        dp[i][j] += dp[i - 1][j - k];
        dp[i][j] %= mod;
      }
    }
  }
  int t;
  scanf("%d", &t);
  while (t--) {
    int total = 0;
    scanf("%s", str);
    len = strlen(str);
    int i;
    for (i = 0; str[i]; ++i) total += str[i] - 'a';
    printf("%I64d\n", (dp[len][total] + mod - 1) % mod);
  }
  return 0;
}
