#include <bits/stdc++.h>
using namespace std;
const int N = 2000010, mod = 1e9 + 7;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
char str[N];
long long f[110][3000];
void solve() {
  scanf("%s", str + 1);
  int n = strlen(str + 1);
  int sum = 0;
  for (int i = 1; i <= n; ++i) {
    sum += str[i] - 'a' + 1;
  }
  cout << (f[n][sum] - 1 + mod) % mod << '\n';
}
int main() {
  int T = read();
  f[0][0] = 1;
  ;
  for (int i = 1; i <= 100; ++i) {
    for (int j = 1; j <= 100 * 26; ++j) {
      for (int k = 1; k <= 26; ++k) {
        if (j - k >= 0) f[i][j] = (f[i][j] + f[i - 1][j - k]) % mod;
      }
    }
  }
  while (T--) {
    solve();
  }
  return 0;
}
