#include <bits/stdc++.h>
using namespace std;
const int DX[8] = {1, -1, 0, 0, 1, 1, -1, -1};
const int DY[8] = {0, 0, 1, -1, 1, -1, 1, -1};
const int M = 1000000007;
int dp[105][2600];
char s[105];
int saya(int x, int y) {
  int &ret = dp[x][y];
  if (ret != -1) return ret;
  if (x == 0 && y == 0) return 1;
  if (x == 0) return 0;
  ret = 0;
  for (int i = 0; i < 26; i++) {
    if (y >= i) ret = (ret + saya(x - 1, y - i)) % M;
  }
  return ret;
}
int main() {
  int t;
  scanf("%d", &t);
  memset(dp, -1, sizeof(dp));
  while (t--) {
    scanf("%s", s);
    int n = strlen(s);
    int sum = 0;
    for (int i = 0; i < n; i++) sum += s[i] - 'a';
    printf("%d\n", (saya(n, sum) - 1 + M) % M);
  }
}
