#include <bits/stdc++.h>
using namespace std;
long long dp[101][3000];
inline void Solve() {
  string s;
  cin >> s;
  int n = s.length(), sum = 0;
  for (int i = 0; i < n; i++) {
    sum += s[i] - 'a' + 1;
  }
  long long ans = dp[n][sum];
  ans -= 1;
  if (ans < 0) ans += 1000000007;
  printf("%I64d\n", ans);
  return;
}
int main() {
  dp[0][0] = 1;
  for (int i = 1; i <= 100; i++) {
    for (int j = 1; j <= 2700; j++) {
      for (int k = 1; k <= 26; k++) {
        if (j - k < 0) continue;
        dp[i][j] += dp[i - 1][j - k];
        if (dp[i][j] >= 1000000007) dp[i][j] -= 1000000007;
      }
    }
  }
  int t;
  cin >> t;
  while (t--) {
    Solve();
  }
  return 0;
}
