#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const long long MOD = 1000000007;
string p;
long long dp[101][2601];
long long solve(long long idx, long long rem) {
  if (!rem) return 1;
  if (!idx) return 0;
  if (dp[idx][rem] != -1) return dp[idx][rem];
  long long ans = 0;
  for (long long i = 0; i < 26; ++i)
    if (i <= rem) ans = (ans + solve(idx - 1, rem - i)) % MOD;
  return dp[idx][rem] = ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  memset(dp, -1, sizeof dp);
  long long t;
  cin >> t;
  while (t--) {
    long long s = 0;
    cin >> p;
    for (auto it : p) s += (long long)(it - 'a');
    cout << (solve((long long)p.size(), s) - 1 + MOD) % MOD << "\n";
  }
  return 0;
}
