#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
long long int t;
string s;
long long int n;
long long int dp[100][2501];
long long int adp[100][2501];
long long int l, r, sm;
void solve() {
  cin >> s;
  n = s.length() - 1;
  sm = 0;
  for (auto it : s) sm += it - 'a';
  l = adp[n][sm] - 1;
  if (l < 0) l += MOD;
  cout << l << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  for (int i = 0; i < 26; i++) adp[0][i] = dp[0][i] = 1;
  for (int i = 1; i <= 2500; i++) {
    dp[0][i] += dp[0][i - 1];
    dp[0][i] %= MOD;
  }
  for (int i = 1; i < 100; i++) {
    for (int j = 0; j <= 2500; j++) {
      l = r = 0;
      if (j - 26 >= 0) l = dp[i - 1][j - 26];
      r = dp[i - 1][j];
      dp[i][j] = r - l;
      if (dp[i][j] < 0) dp[i][j] += MOD;
      dp[i][j] %= MOD;
      adp[i][j] = dp[i][j];
      if (j != 0) {
        dp[i][j] += dp[i][j - 1];
        dp[i][j] %= MOD;
      }
    }
  }
  t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
