#include <bits/stdc++.h>
using namespace std;
const int maxN = 105 * 26;
int N, M;
int dp[105][maxN];
int main() {
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  for (int i = (1), _ = (101); i <= _; ++i)
    for (int k = (1), _ = (2601); k <= _; ++k)
      for (int j = (1), _ = (min(k, 26)); j <= _; ++j)
        (dp[i][k] += dp[i - 1][k - j]) %= (int)(1e9 + 7);
  static char c[105];
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%s", c + 1);
    N = M = 0;
    for (int i = 1; c[i]; ++i) N += c[i] - 'a' + 1;
    M = strlen(c + 1);
    printf("%d\n", dp[M][N] - 1);
  }
  return 0;
}
