#include <bits/stdc++.h>
using namespace std;
int dp[110][110 * 27];
int main() {
  dp[0][0] = 1;
  for (int i(1); i <= 101; i++)
    for (int j(0); j <= 26 * 101; j++)
      for (int q(0); q <= 'z' - 'a' && j - q >= 0; q++)
        dp[i][j] = (dp[i][j] + dp[i - 1][j - q]) % 1000000007ll;
  int n;
  cin >> n;
  string s;
  while (n--) {
    cin >> s;
    int sum(0);
    for (auto i : s) sum += i - 'a';
    cout << (dp[s.size()][sum] + 1000000007ll - 1) % 1000000007ll << '\n';
  }
  return 0;
}
