#include <bits/stdc++.h>
using namespace std;
long long n, v[110], dp[110][110 * 26], mod = 1000000007;
string s;
long long solve(long long i, long long sum) {
  if (i <= 0) return (!sum);
  if (dp[i][sum] != -1) return dp[i][sum];
  long long ans = 0;
  for (long long j = 0; j < 26; j++)
    if (sum >= j) ans = (ans + solve(i - 1, sum - j)) % mod;
  return dp[i][sum] = ans;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long T;
  cin >> T;
  memset(dp, -1, sizeof dp);
  while (T--) {
    cin >> s;
    n = s.size();
    long long sum = 0;
    for (long long i = 1; i <= n; i++) sum += (s[i - 1] - 'a');
    cout << ((solve(n, sum) - 1) % mod + mod) % mod << '\n';
  }
}
