#include <bits/stdc++.h>
using namespace std;
int vis[2666][111];
const int MOD = 1000 * 1000 * 1000 + 7;
inline int sum(int a, int b) {
  a += b;
  if (a >= MOD) {
    a -= MOD;
  }
  return a;
}
int dp[2666][111];
int rec(int s, int q) {
  if (vis[s][q]) {
    return dp[s][q];
  }
  vis[s][q] = 1;
  if (q == 0) {
    return dp[s][q] = (s == 0 ? 1 : 0);
  }
  int ret = 0;
  for (int i = 1; i <= min(26, s); i++) {
    ret = sum(ret, rec(s - i, q - 1));
  }
  return dp[s][q] = ret;
}
char S[111];
void solve() {
  scanf("%s", S);
  int s = 0, q = 0;
  for (int i = 0; S[i]; i++) {
    s += S[i] - 'a' + 1;
    q++;
  }
  printf("%d\n", sum(MOD - 1, rec(s, q)));
}
int main() {
  int t;
  scanf("%d", &t);
  for (int i = 0; i < t; i++) {
    solve();
  }
  return 0;
}
