#include <bits/stdc++.h>
int aa, bb, t, n, SS;
int A[104][10004];
char S[200];
int main() {
  scanf("%d", &n);
  for (int i = 0; i <= 25; i++) A[1][i] = 1;
  for (int i = 1; i <= 100; i++) {
    for (int ii = 0; ii <= 2500; ii++) {
      for (int j = 0; j <= 25 && j <= ii; j++) {
        A[i][ii] += A[i - 1][ii - j];
        A[i][ii] = A[i][ii] % 1000000007;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    scanf("%s", &S);
    int L = strlen(S);
    aa = 0;
    for (int i = 0; i < L; i++) {
      aa += int(S[i]) - int('a');
    }
    printf("%d\n", A[strlen(S)][aa] - 1);
  }
}
