#include <bits/stdc++.h>
using namespace std;
const int mo = 1000000007;
const int m = 110;
int n, dp[m][2880];
char s[m];
void ddpp() {
  int k;
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  for (int i = 0; i <= 103; i++)
    for (int j = 0; j < 2800; j++) {
      if (dp[i][j] > 0) {
        for (k = 0; k < 26; k++) {
          (dp[i + 1][j + k] += dp[i][j]) % mo;
          dp[i + 1][j + k] %= mo;
        }
      }
    }
}
int main() {
  cin >> n;
  getchar();
  ddpp();
  for (int i = 1; i <= n; i++) {
    gets(s);
    int sum = 0;
    for (int j = 0; j < strlen(s); ++j) {
      sum += s[j] - 'a';
    }
    cout << dp[strlen(s)][sum] - 1 << endl;
  }
  return 0;
}
