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