#include <bits/stdc++.h>
using namespace std;
int debug;
int const MAXN = 1e6 + 3;
int const INF = 1e9;
long long const LLINF = 1e15;
long long const MOD = 1e9 + 7;
long long dp[101][2501];
void solve() {
  string s;
  int n, sum = 0;
  cin >> s;
  n = s.size();
  for (int i = 0; i < n; i++) sum += s[i] - 'a';
  cout << dp[n][sum] - 1 << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  dp[0][0] = 1;
  for (int i = 1; i <= 100; i++) {
    for (int j = 0; j <= 2500; j++) {
      for (int k = 0; k <= 25 && j - k >= 0; k++) {
        dp[i][j] += dp[i - 1][j - k];
        dp[i][j] %= MOD;
      }
    }
  }
  int tests(1);
  int t(0);
  if (tests) cin >> t;
  while (t-- > 0) solve();
  return 0;
}
