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