#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
int dp[120][2700];
char s[200];
int main() {
  int t;
  scanf("%d", &t);
  memset(dp[0], 0, sizeof(dp[0]));
  dp[0][0] = 1;
  for (int i = 1; i <= 100; i++) {
    for (int j = 0; j <= i * 26; j++) {
      dp[i][j] = 0;
      for (int k = 0; k < 26; k++) {
        if (j >= k) dp[i][j] = (dp[i][j] + dp[i - 1][j - k]) % 1000000007;
      }
    }
  }
  while (t--) {
    scanf("%s", s);
    int p = 0;
    int len = strlen(s);
    for (int i = 0; i < len; i++) p += s[i] - 'a';
    printf("%d\n", (dp[len][p] - 1 + 1000000007) % 1000000007);
  }
}
