#include <bits/stdc++.h>
using namespace std;
int main(void) {
  const size_t word_length = 100;
  const size_t letters_sum = 25 * word_length;
  vector<vector<size_t>> s(word_length + 1, vector<size_t>(letters_sum + 1, 0));
  s[0][0] = 1;
  for (size_t l = 1; l <= word_length; ++l) {
    for (size_t ss = 0; ss <= letters_sum; ++ss) {
      size_t start = (ss > 25 ? ss - 25 : 0);
      for (size_t i = start; i <= ss; ++i) {
        s[l][ss] += s[l - 1][i];
        s[l][ss] %= 1000000007;
      }
    }
  }
  size_t n = 0;
  cin >> n;
  for (size_t u = 0; u < n; ++u) {
    if (u) cout << endl;
    string a = "";
    cin >> a;
    size_t cur_l = a.length();
    size_t sum = 0;
    for (size_t i = 0; i < cur_l; ++i) {
      sum += (a[i] - 'a');
    }
    cout << (s[cur_l][sum] - 1);
  }
  return 0;
}
