#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;
int add(int a, int b) { return (a + b >= mod ? a + b - mod : a + b); }
vector<vector<int>> dp;
void bober() {
  string s;
  cin >> s;
  int n = s.size();
  s = '#' + s;
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    sum += s[i] - 'a';
  }
  cout << (dp[n][sum] - 1 + mod) % mod << "\n";
}
void Precalc() {
  dp.resize(101);
  int sum = 100 * 25;
  dp[0].resize(sum + 1);
  dp[0][0] = 1;
  for (int i = 1; i <= 100; i++) {
    dp[i].resize(sum + 1);
    for (int j = 0; j <= sum; j++) {
      for (int k = j; k >= max(j - 25, 0); k--) {
        dp[i][j] = add(dp[i][j], dp[i - 1][k]);
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  Precalc();
  int q;
  cin >> q;
  while (q--) {
    bober();
  }
  return 0;
}
