#include <bits/stdc++.h>
using namespace std;
char s[101];
int dp[101][2501];
int main() {
  memset(dp, 0, sizeof dp);
  dp[0][0] = 1;
  for (int l = 0; l < 100; ++l) {
    for (int s = 0; s <= 2500; ++s) {
      for (int i = 0; i < 26 && i + s <= 2500; ++i) {
        dp[l + 1][s + i] += dp[l][s];
        if (dp[l + 1][s + i] >= 1000000007) dp[l + 1][s + i] -= 1000000007;
      }
    }
  }
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%s", s);
    int L = strlen(s), sum = 0;
    for (int i = 0; i < L; ++i) sum += s[i] - 'a';
    int ans = dp[L][sum] - 1;
    if (ans < 0) ans += 1000000007;
    printf("%d\n", ans);
  }
  return 0;
}
