#include <bits/stdc++.h>
using namespace std;
int f[128][4096];
char s[128];
int n, r;
int main() {
  f[0][0] = 1;
  for (int l = 1, to = 101; l < to; ++l) {
    for (int s = 0, to = 2605; s < to; ++s) {
      for (int k = 0, to = min(25, s) + 1; k < to; ++k)
        f[l][s] += f[l - 1][s - k], f[l][s] %= 1000000007;
    }
  }
  int t;
  scanf("%d", &t);
  while (t--) {
    scanf("%s", s);
    n = strlen(s);
    r = 0;
    for (int i = 0, to = n; i < to; ++i) r += s[i] - 'a';
    printf("%d\n", (f[n][r] + 1000000007 - 1) % 1000000007);
  }
  return 0;
}
