#include <bits/stdc++.h>
using namespace std;
int T, dp[301][5210], n;
char S[10010];
const int MOD = 1e9 + 7;
int main() {
  dp[0][0] = 1;
  for (int i = 1; i <= 100; i++) {
    for (int j = 0; j <= 2800; j++) {
      for (int k = 1; k <= 26; k++) {
        dp[i][j + k] += dp[i - 1][j];
        dp[i][j + k] %= MOD;
      }
    }
  }
  scanf("%d", &T);
  while (T--) {
    scanf("%s", S + 1);
    int sum = 0, n = strlen(S + 1);
    for (int i = 1; i <= n; i++) sum += S[i] - 'a' + 1;
    printf("%d\n", (dp[n][sum] - 1 + MOD) % MOD);
  }
  return 0;
}
