#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int dp[101][2626], N;
string s;
int rec(int pos, int remain) {
  if (pos == 0) return (remain == 0);
  int &res = dp[pos][remain];
  if (res != -1) return res;
  res = 0;
  for (int i = 0; i < (min(remain, 25) + 1); ++i) {
    res = (res + rec(pos - 1, remain - i)) % MOD;
  }
  return res;
}
int main() {
  int i, j, k, n, m, test;
  memset(dp, -1, sizeof(dp));
  scanf("%d", &test);
  while (test--) {
    cin >> s;
    int sum = 0;
    for (int i = 0; i < s.size(); ++i) sum += (s[i] - 'a');
    cout << (rec(s.size(), sum) - 1) << endl;
  }
  return 0;
}
