#include <bits/stdc++.h>
using namespace std;
unsigned long long D[101][2601];
char s[200];
int main(void) {
  int i, j, k, n, m;
  fill(D[0], D[1], 0);
  D[0][0] = 1;
  for (i = 1; i <= 100; ++i)
    for (j = 0; j <= 2600; ++j) {
      int t = min(j, 26);
      unsigned long long r = 0;
      for (k = 1; k <= t; ++k) r += D[i - 1][j - k];
      D[i][j] = r % 1000000007;
    }
  cin >> n;
  for (i = 0; i < n; ++i) {
    cin >> s;
    for (m = j = 0; s[j]; ++j) m += s[j] - 'a' + 1;
    cout << D[j][m] - 1 << endl;
  }
  return 0;
}
