#include <bits/stdc++.h>
using namespace std;
signed long long int dp[102][2600 + 5];
int main() {
  dp[0][0] = 1;
  for (int len = 1; len <= 100; ++len) {
    for (int sum = 1; sum <= 2600; sum++) {
      for (int alp = 1; alp <= 26; ++alp) {
        if (sum - alp >= 0) dp[len][sum] += dp[len - 1][sum - alp];
        dp[len][sum] %= 1000000007;
      }
    }
  }
  int t;
  string ss;
  cin >> t;
  while (t--) {
    cin >> ss;
    int sum = 0, len = ss.length();
    for (int i = 0; i < len; ++i) sum += ss[i] - 'a' + 1;
    cout << (dp[len][sum] - 1 + 1000000007) % 1000000007 << endl;
  }
}
