#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int main() {
  vector<vector<int> > dp(101, vector<int>(2501));
  for (int i = int(0); i < int(26); i++) dp[1][i] = 1;
  for (int i = int(2); i < int(101); i++)
    for (int j = int(0); j < int(2501); j++)
      for (int k = int(0); k < int(26); k++)
        if (j - k >= 0) dp[i][j] = (dp[i][j] + dp[i - 1][j - k]) % MOD;
  for (int t; cin >> t && t;) {
    while (t--) {
      string s;
      cin >> s;
      int sum = 0;
      for (int i = int(0); i < int(s.size()); i++) sum += s[i] - 'a';
      cout << dp[s.size()][sum] - 1 << endl;
    }
  }
  return 0;
}
