#include <bits/stdc++.h>
using namespace std;
long long dp[101][2601];
const long long MOD = 1000000007;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  dp[0][0] = 1;
  for (int i = 1; i < 101; ++i) {
    for (int j = 1; j < 2601; ++j) {
      for (int k = 1; k <= 26; ++k) {
        if (j >= k) {
          dp[i][j] = (dp[i][j] + dp[i - 1][j - k]) % MOD;
        }
      }
    }
  }
  int t, sum;
  string st;
  cin >> t;
  while (t--) {
    cin >> st;
    sum = 0;
    for (int i = 0; i < st.size(); ++i) sum += st[i] - 'a' + 1;
    cout << (dp[st.size()][sum] - 1 + MOD) % MOD << "\n";
  }
}
