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