#include <bits/stdc++.h>
using namespace std;
const int MAX = 109, MAXM = 26 * 100 + 100, MOD = 1e9 + 7;
long long dp[MAX][MAXM], q, sum;
int main() {
  dp[0][0] = 1;
  for (int i = 1; i < MAX; i++)
    for (int j = 0; j < 2500; j++)
      for (int k = 0; k < 26; k++)
        dp[i][j + k] = (dp[i][j + k] + dp[i - 1][j]) % MOD;
  cin >> q;
  string s;
  while (q--) {
    cin >> s, sum = 0;
    for (int i = 0; i < s.size(); i++) sum += s[i] - 'a';
    cout << (dp[s.size()][sum] - 1 + MOD) % MOD << '\n';
  }
  return 0;
}
