#include <bits/stdc++.h>
using namespace std;
int dp[200][3000];
int main() {
  int t, ans, tt, i, j, len;
  char str[200];
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  for (i = 1; i < 200; i++)
    for (j = 0; j < 3000; j++)
      for (t = 0; t < 26 && t <= j; t++)
        dp[i][j] = (dp[i - 1][j - t] + dp[i][j]) % 1000000007;
  scanf("%d", &tt);
  while (tt--) {
    getchar();
    scanf("%s", str);
    ans = 0, len = strlen(str);
    for (i = 0; i < len; i++) ans += str[i] - 'a';
    cout << (dp[len][ans] + 1000000007 - 1) % 1000000007 << endl;
  }
  return 0;
}
