#include <bits/stdc++.h>
using namespace std;
const int ms = 111;
const long long mod = 1e9 + 7;
long long dp[ms][25 * ms];
int main() {
  dp[0][0] = 1;
  for (int i = 1; i < ms; i++) {
    dp[i][0] = 1;
    long long sum = 1;
    for (int s = 1; s <= 25 * i; s++) {
      sum = (sum + dp[i - 1][s]) % mod;
      if (s - 26 >= 0) sum = (sum - dp[i - 1][s - 26] + mod) % mod;
      dp[i][s] = sum;
    }
  }
  int t;
  cin >> t;
  string s;
  while (t--) {
    cin >> s;
    int n = s.size();
    int sum = 0;
    for (char c : s) sum += c - 'a';
    cout << (dp[n][sum] + mod - 1) % mod << endl;
  }
}
