#include <bits/stdc++.h>
using namespace std;
const int MAXN = 105, MODULO = 1000000007;
char buf[MAXN];
int memo[MAXN][26 * MAXN];
int solve(int n, int sum) {
  if (sum < 0) return 0;
  if (n < 0) return (sum == 0);
  int& r = memo[n][sum];
  if (r != -1) return r;
  r = 0;
  for (int i = 0; i < 26; ++i) r = (r + solve(n - 1, sum - i)) % MODULO;
  return r;
}
int main() {
  memset(memo, -1, sizeof(memo));
  int T;
  for (scanf("%d", &T); T--;) {
    scanf("%s", &buf);
    int sum = 0;
    for (int i = 0; buf[i]; ++i) sum += buf[i] - 'a';
    int r = (solve(strlen(buf) - 1, sum) - 1 + MODULO) % MODULO;
    printf("%d\n", r);
  }
  return 0;
}
