#include <bits/stdc++.h>
const double eps = 1e-9;
const int inf = 2000000000;
const double pi = acos(-1.0);
const long long mod = 1000000007;
using namespace std;
char s[150];
int t;
long long d[26 * 100 + 200][130];
int main() {
  scanf("%d\n", &t);
  memset(d, 0, sizeof(d));
  for (int num = 0; num <= 120; num++)
    for (int sum = 0; sum <= 26 * 100 + 100; sum++) {
      if (num == 0) {
        if (sum == 0)
          d[sum][num] = 1;
        else
          break;
      } else
        for (int last = 0; last < 26; last++)
          if (sum - last >= 0)
            d[sum][num] = (d[sum][num] + d[sum - last][num - 1]) % mod;
    }
  for (int it = 0; it < (int)t; it++) {
    gets(s);
    int n = (int)strlen(s);
    int sum = 0;
    for (int i = 0; i < (int)n; i++) sum += s[i] - 'a';
    printf("%I64d\n", (d[sum][n] == 0) ? 1000000006 : (d[sum][n] - 1));
  }
  return 0;
}
