#include <bits/stdc++.h>
unsigned int dp[2510][102][27];
inline void add(unsigned int &a, unsigned int b) { a = (a + b) % 1000000007; }
int main() {
  int t;
  scanf("%d", &t);
  int i, j, k;
  char buf[120];
  for (i = 0; i <= 100; ++i) dp[0][i][0] = dp[0][i][26] = 1;
  for (i = 1; i <= 2500; ++i) {
    for (j = (i + 24) / 25; j <= 100; ++j) {
      dp[i][j][0] = dp[i][j][26] = dp[i][j - 1][26];
      for (k = 1; k < 26; ++k) {
        unsigned int v = dp[i - 1][j][k - 1];
        add(dp[i][j][k], v);
        add(dp[i][j][26], v);
      }
    }
  }
  while (t--) {
    scanf("%s", buf);
    int len, cnt = 0;
    for (len = 0; buf[len]; ++len) cnt += buf[len] - 'a';
    printf("%u\n", dp[cnt][len][26] - 1);
  }
  return 0;
}
