#include <bits/stdc++.h>
using namespace std;
long long dp[2605][105];
long long solve(int n, int i) {
  if (i == 0 && n == 0) return 1;
  if (n == 0) return 1;
  if (i == 0) return 0;
  if (dp[n][i] != -1) return dp[n][i];
  long long temp = 0;
  for (int j = 0; j <= min(n, 25); j++)
    temp += solve(n - j, i - 1), temp %= 1000000007;
  return dp[n][i] = temp % 1000000007;
}
int main() {
  int t;
  scanf("%d", &t);
  memset(dp, -1, sizeof dp);
  while (t--) {
    string s;
    cin >> s;
    int counter = 0;
    for (int i = 0; i < s.size(); i++) counter += (s[i] - 'a');
    printf("%I64d\n",
           ((solve(counter, s.size()) - 1) + 1000000007) % 1000000007);
  }
  return 0;
}
