#include <bits/stdc++.h>
using namespace std;
int dp[200][3000];
const int mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  for (int j = 1; j <= 26; j++) dp[1][j] = 1;
  for (int i = 2; i <= 110; i++)
    for (int j = 2; j <= 26 * 110; j++)
      for (int a = 1; a <= 26 and a < j; a++) {
        dp[i][j] += dp[i - 1][j - a] % mod;
        dp[i][j] %= mod;
      }
  while (n--) {
    string s;
    cin >> s;
    int t = 0;
    for (int i = 0; i < s.size(); i++) {
      t += s[i] - 'a' + 1;
    }
    cout << dp[s.size()][t] - 1 << endl;
  }
}
