#include <bits/stdc++.h>
using namespace std;
const int MXN = 1e2 + 9;
const long long MOD = 1e9 + 7;
long long dp[MXN][MXN * 27];
inline long long solve(int left, int sum) {
  if (left == 0) return (sum == 0);
  if (dp[left][sum] != -1) return dp[left][sum];
  long long ans = 0;
  for (int i = 1; i <= 26; ++i) ans = (ans + solve(left - 1, sum - i)) % MOD;
  return dp[left][sum] = ans;
}
int main() {
  int T;
  cin >> T;
  memset(dp, -1, sizeof(dp));
  while (T--) {
    string S;
    cin >> S;
    int Sum = 0;
    for (int i = 0; i < (int)S.length(); ++i) Sum += (S[i] - 'a' + 1);
    cout << (solve((int)S.length(), Sum) % MOD - 1 + MOD) % MOD << "\n";
  }
  return 0;
}
