#include <bits/stdc++.h>
using namespace std;
int tn, q[101][2501], s;
string p;
int z(int n, int s) {
  if ((n < 1) || (s < 0)) return 0;
  if (q[n][s] >= 0) return q[n][s];
  int r = 0;
  if (s <= 25 * n)
    for (int t = 0; t < 26; t++) r = (r + z(n - 1, s - t)) % 1000000007;
  q[n][s] = r;
  return r;
}
int main() {
  for (int i = 1; i < 101; i++)
    for (int j = 0; j < 2501; j++) q[i][j] = -1;
  for (int i = 1; i < 101; i++) {
    q[i][0] = 1;
    q[i][1] = i;
  }
  for (int j = 0; j < 26; j++) q[1][j] = 1;
  cin >> tn;
  while (tn--) {
    cin >> p;
    for (int i = s = 0; i < p.length(); i++) s += p[i] - 'a';
    cout << ((z(p.length(), s) + 1000000007 - 1) % 1000000007) << endl;
  }
  return 0;
}
