#include <bits/stdc++.h>
using namespace std;
int n, test;
int dp[111][10009];
void build() {
  for (int i = 0; i < 26; i++) dp[1][i] = 1;
  for (int i = 2; i < 111; i++) {
    dp[i][0] = 1;
    for (int j = 1; j <= i * 25; j++) {
      for (int k = 0; k < 26 && j >= k; k++)
        dp[i][j] = (dp[i][j] + dp[i - 1][j - k]) % 1000000007;
    }
  }
}
int main() {
  build();
  cin >> test;
  while (test--) {
    string s;
    cin >> s;
    int sum = -97 * s.size();
    for (int i = 0; i < s.size(); i++) sum += s[i];
    cout << (dp[s.size()][sum] - 1) % 1000000007 << endl;
  }
}
