#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 101;
const int maxm = 25 * maxn + 2;
long long dp[maxn][maxm];
void solve(int tc) {
  for (int i = 0; i < maxn; i++) {
    for (int j = 0; j < maxm; j++) {
      if (i == 0) {
        if (j <= 25) dp[i][j] = 1;
        continue;
      }
      for (int k = 0; k <= min(25, j); k++) {
        dp[i][j] = (dp[i][j] + dp[i - 1][j - k]) % mod;
      }
    }
  }
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    int n = s.size();
    long long sum = 0;
    for (int i = 0; i < n; i++) sum += (long long)(s[i] - 'a');
    long long ans = dp[n - 1][sum];
    ans--;
    if (ans < 0) ans += mod;
    cout << ans << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve(i);
    cout << "\n";
  }
  return 0;
}
