#include <bits/stdc++.h>
using namespace std;
int test, tot, n;
char s[105];
long long f[105][2605];
void work() {
  int i, j, k;
  f[0][0] = 1;
  for (i = 1; i <= 100; i++) {
    for (j = i; j <= 26 * i; j++)
      for (k = 1; k <= 26; k++)
        if (j - k < 0)
          break;
        else
          f[i][j] = (f[i][j] + f[i - 1][j - k]) % 1000000007LL;
  }
  scanf("%d\n", &test);
  while (test--) {
    gets(s);
    n = strlen(s);
    tot = 0;
    for (i = 0; i < n; i++) tot += s[i] - 'a' + 1;
    printf("%I64d\n", (f[n][tot] - 1 + 1000000007LL) % 1000000007LL);
  }
}
int main() {
  work();
  return 0;
}
