#include <bits/stdc++.h>
const int INT_INF = 0x3f3f3f3f;
const int INT_M_INF = 0x7f7f7f7f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
const long long LL_M_INF = 0x7f7f7f7f7f7f7f7f;
const double pi = acos(-1.0);
using namespace std;
inline void debug(char ch) {
  for (int __ii = 0; __ii < 20; ++__ii) putchar(ch);
  printf("\n");
}
const double eps = 1e-8;
inline int dcmp(double a, double b) {
  if (fabs(a - b) < eps) return 0;
  return a < b ? -1 : 1;
}
const int dr[] = {0, 0, -1, 1, -1, -1, 1, 1};
const int dc[] = {-1, 1, 0, 0, -1, 1, -1, 1};
const int MAXN = 100 + 10;
const int MAXT = 10000 + 10;
const int MOD = 1e9 + 7;
int d[MAXN][MAXN * 26];
void init() {
  memset(d, 0, sizeof d);
  d[0][0] = 1;
  for (int i = 1; i < MAXN; ++i)
    for (int j = 0; j < MAXN * 26; ++j)
      for (int k = 0; k < 26 && k <= j; ++k)
        (d[i][j] += d[i - 1][j - k]) %= MOD;
}
char s[MAXN];
int main() {
  init();
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%s", s);
    int len = 0, sum = 0;
    for (len = 0; s[len]; ++len) sum += s[len] - 'a';
    printf("%d\n", (d[len][sum] - 1 + MOD) % MOD);
  }
  return 0;
}
