#include <bits/stdc++.h>
using namespace std;
const int MXN = (int)1e6 + 10;
const int INF = (int)1e9 + 7;
const long long LINF = (long long)1e18 + 10;
const double EPS = (double)1e-9;
int dp[111][2600];
int n;
int T;
int sum, ans;
string s;
void add(int &x, int y) {
  x += y;
  if (x >= INF) x -= INF;
}
int main() {
  for (int i = 0; i < 26; ++i) {
    dp[1][i] = 1;
  }
  for (int i = 2; i <= 100; ++i) {
    for (int j = 0; j <= 2500; ++j) {
      for (int k = 0; k <= min(j, 25); ++k) {
        add(dp[i][j], dp[i - 1][j - k]);
      }
    }
  }
  cin >> T;
  while (T--) {
    cin >> s;
    sum = 0;
    n = (int)s.size();
    for (int i = 0; i < n; ++i) {
      sum += (s[i] - 'a');
    }
    ans = dp[n][sum];
    add(ans, INF - 1);
    cout << ans << "\n";
  }
  return 0;
}
