#include <bits/stdc++.h>
const int L = 101;
const int A = 26;
const int mdl = 1e9 + 7;
int ans[L + 1][A * L + 1], t;
char s[L + 1];
int main() {
  ans[0][0] = 1;
  for (int i = 1; i <= L; ++i)
    for (int j = 0; j <= A * L; ++j) {
      ans[i][j] = 0;
      for (int k = 0; (k < A) && (k <= j); ++k)
        ans[i][j] = (ans[i][j] + ans[i - 1][j - k]) % mdl;
    }
  scanf("%d", &t);
  for (int i = 0; i < t; ++i) {
    scanf("%s", s);
    int n = strlen(s), sum = 0;
    for (int j = 0; j < n; ++j) sum += s[j] - 'a';
    printf("%d\n", (ans[n][sum] + mdl - 1) % mdl);
  }
}
