#include <bits/stdc++.h>
using namespace std;
int mem[110][3000] = {};
bool solve() {
  char s[110];
  int ans = 0, su = 0, n;
  scanf("%s", s);
  for (n = 0; s[n]; ++n) su += s[n] - 'a';
  printf("%d\n", (1000000007 + mem[n][su] - 1) % 1000000007);
  return true;
}
int main() {
  for (int i = 0; i < 26; ++i) mem[1][i] = 1;
  for (int i = 2; i < 105; ++i)
    for (int j = 0; j < 2700; ++j)
      for (int k = 0; k < 26; ++k)
        if (j - k >= 0)
          mem[i][j] = (mem[i][j] + mem[i - 1][j - k]) % 1000000007;
  int t;
  scanf("%d", &t);
  for (int i = 0; i < t; ++i) solve();
  return 0;
}
