#include <bits/stdc++.h>
using namespace std;
long long t, n, ans, dp[101][2501], M = 1e9 + 7;
string str;
void pre() {
  dp[0][0] = 1;
  for (int i = 1; i < 101; ++i)
    for (int j = 0; j < 2501; ++j)
      for (int k = 0; k < 26 && (j - k) >= 0; ++k) {
        dp[i][j] += dp[i - 1][j - k];
        dp[i][j] %= M;
      }
}
int main() {
  pre();
  cin >> t;
  while (t--) {
    cin >> str;
    n = str.size();
    ans = 0;
    for (int i = 0; i < n; ++i) ans += (int)(str[i] - 'a');
    cout << (dp[n][ans] - 1 + M) % M << endl;
  }
  return 0;
}
