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