#include <bits/stdc++.h>
using namespace std;
const int Maxn = 100 + 10;
const int MaxSum = 25 * 100 + 10;
const int mod = 1e9 + 7;
int dp[Maxn][MaxSum];
int main() {
  dp[0][0] = 1;
  for (int i = 1; i < Maxn; i++)
    for (int j = 0; j < MaxSum; j++)
      for (int k = 0; k < min(j + 1, 26); k++) {
        dp[i][j] += dp[i - 1][j - k];
        dp[i][j] %= mod;
      }
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int sum = 0;
    string s;
    cin >> s;
    for (int i = 0; i < (int)s.size(); i++) sum += s[i] - 'a';
    cout << (dp[(int)s.size()][sum] - 1 + mod) % mod << endl;
  }
  return 0;
}
