#include <bits/stdc++.h>
using namespace std;
int t, n, dp[107][(107 * ('z' - 'a' + 1))];
char c[107];
int main() {
  dp[0][0] = 1;
  for (int i = 0; i < (('z' - 'a' + 1)); i++) dp[1][i] = 1;
  for (int n = (2); n <= (107 - 1); n++)
    for (int s = 0; s < ((107 * ('z' - 'a' + 1))); s++)
      for (int i = 0; i < (min(s + 1, ('z' - 'a' + 1))); i++) {
        dp[n][s] += dp[n - 1][s - i];
        dp[n][s] %= 1000000007;
      }
  scanf("%d", &t);
  while (t--) {
    scanf("%s", c);
    n = strlen(c);
    int s = 0;
    for (int i = 0; i < (n); i++) s += c[i] - 'a';
    printf("%d\n", (dp[n][s] + 1000000007 - 1) % 1000000007);
  }
  return 0;
}
