#include <bits/stdc++.h>
using namespace std;
const int N = 105;
const int mod = 1e9 + 7;
int n, f[N][N * N];
void add(int &x, int y) {
  x = (x + y);
  if (x >= mod) x -= mod;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  f[0][0] = 1;
  for (int i = 0; i <= 100; ++i) {
    for (int j = 0; j <= 2700; ++j) {
      for (int k = 1; k <= 26; ++k) {
        add(f[i + 1][j + k], f[i][j]);
      }
    }
  }
  cin >> n;
  while (n--) {
    int tot = 0;
    string s;
    cin >> s;
    for (char c : s) tot += (c - 'a' + 1);
    cout << f[(int)s.size()][tot] - 1 << '\n';
  }
}
