#include <bits/stdc++.h>
using namespace std;
long long ans = 1;
int n;
char s[105];
int tt;
long long a[105][2505];
long long get_ans(int x, int y) {
  if (y < 0) return 0;
  if (x * 25 < y) return 0;
  if (x == 0) {
    if (y)
      return 0;
    else
      return 1;
  }
  if (a[x][y]) return a[x][y];
  long long ans = 0;
  for (int i = 0; i <= 25; ++i)
    ans = (ans + get_ans(x - 1, y - i)) % 1000000007;
  a[x][y] = ans;
  return ans;
}
int main() {
  cin >> tt;
  for (int _i = 0; _i < tt; ++_i) {
    cin >> s;
    n = strlen(s);
    int r = 0;
    for (int i = 0; i < n; ++i) r += s[i] - 'a';
    cout << (get_ans(n, r) + 1000000007 - 1) % 1000000007 << endl;
  }
  return 0;
}
