#include <bits/stdc++.h>
using namespace std;
const int N = 105;
const int MOD = int(1e9) + 7;
int t, sz;
int memo[2605][105];
string curr;
inline int absM(int x) { return x < 0 ? x + MOD : x; }
int dp(int sum, int cant) {
  int &r = memo[sum][cant];
  if (r != -1) return r;
  if (cant == 0) return r = (sum == 0);
  r = 0;
  for (int i = 0; i <= min(25, sum); ++i)
    r = ((r) + (dp(sum - i, cant - 1))) % MOD;
  return r;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  memset(memo, -1, sizeof memo);
  cin >> t;
  while (t--) {
    cin >> curr;
    sz = curr.size();
    int tSum = 0;
    for (char it : curr) tSum += it - 'a';
    printf("%d\n", absM(((dp(tSum, sz)) + (-1)) % MOD));
  }
  return 0;
}
