#include <bits/stdc++.h>
using namespace std;
int t, n, sum;
char v[110];
int d[110][2610];
int main() {
  scanf("%d", &t);
  d[0][0] = 1;
  for (int i = 1; i <= 100; ++i) {
    for (int j = 0; j < 2600; ++j) {
      for (int x = 0; x < 26 && j - x >= 0; ++x)
        d[i][j] = (d[i][j] + d[i - 1][j - x]) % 1000000007;
    }
  }
  while (t--) {
    memset(v, 0, sizeof(v));
    scanf("%s", v + 1);
    n = strlen(v + 1);
    sum = 0;
    for (int i = 1; i <= n; ++i) sum += v[i] - 'a';
    printf("%d\n", (d[n][sum] + 1000000007 - 1) % 1000000007);
  }
  return 0;
}
