#include <bits/stdc++.h>
using namespace std;
int n, m, ans, dp[100][2561], t;
char s[100];
int const M = 1e9 + 7;
int main() {
  scanf("%d", &t);
  for (int i = 0; i < 26; ++i) dp[0][i] = 1;
  for (int i = 0; i < 99; ++i)
    for (int j = 0; j < 2501; ++j)
      for (int k = 0; k < 26; ++k)
        dp[i + 1][j + k] = (dp[i][j] % M + dp[i + 1][j + k] % M) % M;
  for (int q = 0; q < t; ++q) {
    scanf("%s", &s);
    n = strlen(s);
    int f = 0;
    for (int i = 0; i < n; ++i) f += (int)s[i] - 97;
    printf("%d\n", dp[n - 1][f] - 1);
  }
  return 0;
}
