#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int dp[105][2700];
int t;
string s;
void solve() {
  dp[0][0] = 1;
  for (int i = 0; i < 101; i++)
    for (int j = 0; j <= 25 * i; j++) {
      for (int k = 0; k < 26; k++) {
        dp[i + 1][j + k] += dp[i][j];
        dp[i + 1][j + k] %= MOD;
      }
    }
}
int main() {
  solve();
  cin >> t;
  while (t--) {
    cin >> s;
    int sum = 0;
    for (int i = 0; i < s.size(); i++) sum += s[i] - 'a';
    cout << dp[s.size()][sum] - 1 << endl;
  }
  return 0;
}
