#include <bits/stdc++.h>
using namespace std;
int dp[105][2505];
void init() {
  dp[0][0] = 1;
  for (int i = 1; i <= 100; i++) {
    for (int j = 0; j <= 2500; j++) {
      for (int k = 0; k <= 25; k++) {
        if (j - k < 0) break;
        dp[i][j] = (dp[i][j] + dp[i - 1][j - k]) % 1000000007;
      }
    }
  }
}
int main() {
  int t;
  scanf("%d", &t);
  init();
  while (t--) {
    string s;
    cin >> s;
    int sum = 0;
    for (int i = 0; i < s.size(); i++) {
      sum += s[i] - 'a';
    }
    printf("%d\n", (dp[s.size()][sum] - 1 + 1000000007) % 1000000007);
    ;
  }
  return 0;
}
