#include <bits/stdc++.h>
using namespace std;
const long long infl = 1e18 + 5;
long long n, m, k, q, x, y, f, val, t, i, j;
long long ind, cnt, sz, sm, ans, mx, mn;
long long dp[101][2503];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  if (fopen("inp.txt", "r")) {
    freopen("myfile.txt", "w", stdout);
    freopen("inp.txt", "r", stdin);
  }
  string s;
  cin >> q;
  dp[0][0] = 1;
  for (i = 1; i < 101; i++) {
    for (j = 0; j < 2503; j++) {
      for (k = 0; k < 26; k++) {
        if (k <= j) dp[i][j] += dp[i - 1][j - k];
        dp[i][j] %= 1000000007;
      }
    }
  }
  while (q--) {
    cin >> s;
    n = s.size();
    sm = 0;
    for (i = 0; i < n; i++) {
      sm += s[i] - 'a';
    }
    cout << (dp[n][sm] - 1LL + 1000000007) % 1000000007 << "\n";
  }
  return 0;
}
