#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
string s;
int t, dp[102][2502];
int main() {
  dp[0][0] = 1;
  for (int i = 0; i < 100; i++) {
    for (int s = 0; s <= 2500; s++) {
      for (int j = 0; j < 26 && j + s <= 2500; j++) {
        dp[i + 1][s + j] += dp[i][s];
        dp[i + 1][s + j] %= MOD;
      }
    }
  }
  cin >> t;
  while (t--) {
    cin >> s;
    int sum = 0;
    for (int i = 0; i < s.size(); i++) sum += s[i] - 'a';
    int ans = (dp[s.size()][sum] - 1 + MOD) % MOD;
    cout << ans << "\n";
  }
  return 0;
}
