#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
#pragma warning(default : 4)
using namespace std;
int t, n;
char s[101];
int f[101][101 * 26];
int main() {
  scanf("%d\n", &t);
  for (int i = 0; i < 26; i++) f[0][i] = 1;
  for (int i = 1; i < 101; i++) {
    int l = 1 + (i + 1) * 25;
    for (int j = 0; j < l; j++)
      for (int p = 0, mx = min(j + 1, 26); p < mx; p++) {
        f[i][j] += f[i - 1][j - p];
        if (f[i][j] >= 1000000007) f[i][j] -= 1000000007;
      }
  }
  while (t--) {
    gets(s);
    n = strlen(s);
    int k = 0;
    for (int i = 0; i < n; i++) k += s[i] - 'a';
    printf("%d\n", f[n - 1][k] - 1);
  }
  return 0;
}
