#include <bits/stdc++.h>
char c[105];
long long dp[105][3000];
int main() {
  int a;
  long long num = 0, all = 0;
  scanf("%d", &a);
  dp[0][0] = 1;
  for (int i = 0; i < 104; i++) {
    for (int j = 0; j <= 2900; j++) {
      for (int k = 1; k <= 26; k++) {
        dp[i + 1][j + k] = dp[i + 1][j + k] + dp[i][j];
        dp[i + 1][j + k] = dp[i + 1][j + k] % 1000000007;
      }
    }
  }
  for (int i = 0; i < a; i++) {
    memset(c, 0, sizeof(c));
    scanf("%s", &c);
    all = 0;
    num = strlen(c);
    for (int p = 0; p < num; p++) {
      all = all + c[p] - 'a' + 1;
    }
    printf("%I64d\n", (dp[num][all] - 1) % 1000000007);
  }
  return 0;
}
