#include <bits/stdc++.h>
using namespace std;
const long long N = 1e2 + 7;
const long long M = 3e3 + 7;
const long long inf = 1e9 + 7;
const long long mod = 1e9 + 7;
int t;
string s;
int d[N][M];
int main() {
  ios_base::sync_with_stdio(false);
  d[0][0] = 1;
  for (int i = 1; i <= 100; i++) {
    for (int j = 1; j <= 2600; j++) {
      for (int h = 1; h <= 26; h++) {
        if (j < h) {
          continue;
        }
        d[i][j] = (d[i][j] + d[i - 1][j - h]) % mod;
      }
    }
  }
  cin >> t;
  while (t--) {
    cin >> s;
    int sum = 0;
    for (auto x : s) {
      sum += (x - 'a' + 1);
    }
    cout << (d[(int)s.size()][sum] - 1 + mod) % mod << "\n";
  }
}
