#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
long long dp[100][5001];
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int T;
  cin >> T;
  for (int i = 0; i < 100; i++) {
    for (int j = 0; j <= 5000; j++) {
      if (i == 0 && j < 26)
        dp[i][j] = 1;
      else
        dp[i][j] = 0;
    }
  }
  for (int i = 0; i < 99; i++) {
    for (int j = 0; j < 5000; j++) {
      if (i == 0 && j < 26) dp[i][j] = 1;
      for (int k = 0; k < 26; k++) {
        dp[i + 1][j + k] += dp[i][j];
        dp[i + 1][j + k] %= MOD;
      }
    }
  }
  while (T--) {
    string s;
    cin >> s;
    int N = s.length();
    int total = 0;
    for (int i = 0; i < N; i++) {
      total += s[i] - 'a';
    }
    long long result = (dp[N - 1][total] + MOD - 1) % MOD;
    cout << result << endl;
  }
}
