#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18, MOD = 1e9 + 7;
const int N = 1e2 + 10, N2 = 26 * N + 10, INFI = 1e9 + 10, L = 19;
int t, n;
long long dp[N][N2];
string s;
long long add(long long a, long long b) {
  long long sum = a + b;
  if (sum < 0) {
    sum += MOD;
  }
  if (sum >= MOD) {
    sum -= MOD;
  }
  return sum;
}
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  for (int i = 1; i <= 26; i++) {
    dp[0][i] = 1;
  }
  for (int i = 1; i < N; i++) {
    for (int j = 1; j < N2; j++) {
      for (int k = 1; k <= 26; k++) {
        if (j - k < 0) continue;
        dp[i][j] = add(dp[i][j], dp[i - 1][j - k]);
      }
    }
  }
  cin >> t;
  while (t--) {
    cin >> s;
    n = s.size();
    int sum = 0;
    for (int i = 0; i < n; i++) {
      sum += s[i] - 'a' + 1;
    }
    cout << dp[n - 1][sum] - 1 << endl;
  }
  return 0;
}
