#include <bits/stdc++.h>
using namespace std;
const int modref = 1000000007;
int dp[111][2511] = {0};
int T;
int n, s;
char c[115];
int main() {
  dp[0][0] = 1;
  for (int i = 1; i < 101; ++i)
    for (int j = 0; j <= 25 * i; ++j)
      for (int k = 0; k < 26; ++k)
        if (j - k >= 0) {
          dp[i][j] += dp[i - 1][j - k];
          dp[i][j] %= modref;
        }
  scanf("%d", &T);
  for (int z = 0; z < T; ++z) {
    scanf("%s", c);
    for (n = 0; c[n] != '\0'; ++n)
      ;
    s = 0;
    for (int i = 0; i < n; ++i) s += (int(c[i] - 'a'));
    int res = (dp[n][s] + modref - 1) % modref;
    printf("%d\n", res);
  }
  return 0;
}
