#include <bits/stdc++.h>
using namespace std;
const int mod = (int)1e9 + 7;
int dp[105][2505];
void init() {
  dp[0][0] = 1;
  for (int i = 1; i < 105; i++)
    for (int(j) = 0; (j) < (int)(2505); (j)++)
      for (int(c) = 0; (c) < (int)(26); (c)++)
        if (j >= c) dp[i][j] = (dp[i][j] + dp[i - 1][j - c]) % mod;
}
int main() {
  init();
  int tt;
  char s[105];
  scanf("%d", &tt);
  while (tt--) {
    scanf("%s", s);
    int sum = 0;
    for (int i = 0; s[i]; i++) sum += s[i] - 'a';
    printf("%d\n", (dp[strlen(s)][sum] + mod - 1) % mod);
  }
  return 0;
}
