#include <bits/stdc++.h>
using namespace std;
const int base = 1000000007;
int n, f[3000][200];
string s;
int calc(int p, int k) {
  if (f[p][k] != -1) return f[p][k];
  if (k == 0)
    if (p == 0)
      return 1;
    else
      return 0;
  long long ans = 0;
  for (int i = 0; i <= min(p, 25); i++) ans = (ans + calc(p - i, k - 1)) % base;
  f[p][k] = ans;
  return ans;
}
int solve(string s) {
  int k = s.length();
  int p = 0;
  for (int i = 0; i < k; i++) p += s[i] - 'a';
  return (calc(p, k) + base - 1) % base;
}
int main() {
  memset(f, -1, sizeof f);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    cout << solve(s) << endl;
  }
}
