#include <bits/stdc++.h>
#pragma GCC optimize("O3")
const double PI = acos(-1);
using namespace std;
const int MAX = 111, mod = 1000 * 1000 * 1000 + 7;
char input[MAX];
int dp[MAX][MAX * 26], vis[MAX][MAX * 26];
int visID = 1, len;
inline int add(int x, int y) {
  x += y;
  if (x >= mod) x -= mod;
  if (x < 0) x += mod;
  return x;
}
int solve(int pos, int palance) {
  if (pos == len) return (palance == 0) ? 1 : 0;
  if (vis[pos][palance] == visID) return dp[pos][palance];
  vis[pos][palance] = visID;
  dp[pos][palance] = 0;
  for (int i = 0; i < 26 && i <= palance; i++)
    dp[pos][palance] = add(dp[pos][palance], solve(pos + 1, palance - i));
  return dp[pos][palance];
}
int main() {
  dp[0][0] = 1;
  for (int i = 1; i < MAX; i++)
    for (int j = 0; j < MAX * 26; j++) {
      for (int k = 0; k < 26 && k <= j; k++)
        dp[i][j] = add(dp[i][j], dp[i - 1][j - k]);
    }
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%s", input);
    int tot = 0;
    len = strlen(input);
    for (int i = 0; i < (len); i++) tot += input[i] - 'a';
    printf("%d\n", add(dp[len][tot], -1));
  }
  return 0;
}
