#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int dp[102][2702];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  dp[0][0] = 1;
  for (int i = 0; i < 100; i++) {
    for (int j = 0; j <= 2600; j++) {
      for (int k = 0; k < 26; k++) {
        dp[i + 1][j + k] = (dp[i + 1][j + k] + dp[i][j]) % mod;
      }
    }
  }
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    int sum = 0;
    for (char x : s) sum += x - 'a';
    cout << (dp[s.size()][sum] - 1 + mod) % mod << '\n';
  }
  return 0;
}
