#include <bits/stdc++.h>
using namespace std;
const int M = 102, T = 1000 * 1000 * 1000 + 7;
int a[2600][M];
bool mrk[2600][M];
string s;
int ff(long long sum, int n) {
  if (sum < 0) return 0;
  if (mrk[sum][n]) return a[sum][n];
  if (sum > 25 && n == 1) return 0;
  if (sum <= 25 && n == 1) return 1;
  long long temp = 0;
  for (int i = 0; i < 26; i++) temp += ff(sum - i, n - 1), temp %= T;
  a[sum][n] = temp;
  mrk[sum][n] = true;
  return temp;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    long long sum = 0;
    for (int i = 0; i < s.length(); i++) sum += s[i] - 'a';
    cout << (ff(sum, s.length()) + T - 1) % T << endl;
  }
  return 0;
  ;
}
