#include <bits/stdc++.h>
using namespace std;
long long dp[101][3001], mod = 1e9 + 7;
bool vis[101][3001];
int n;
long long solve(int x, int sum) {
  if (sum < 0) return 0;
  if (x == 0) {
    if (sum == 0) return 1;
    return 0;
  }
  if (vis[x][sum]) return dp[x][sum];
  vis[x][sum] = true;
  long long t = 0;
  for (int i = 0; i <= 25; i++) {
    t = (t + solve(x - 1, sum - i) % mod + mod) % mod;
  }
  return dp[x][sum] = t % mod;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    n = s.size();
    int sum = 0;
    for (int i = 0; i < n; i++) {
      sum += s[i] - 'a';
    }
    long long ans = solve(n, sum) - 1;
    cout << ans << endl;
  }
  return 0;
}
