#include <bits/stdc++.h>
using namespace std;
long long mem[101][2606];
int main() {
  mem[0][0] = 1;
  for (long long i = 1; i <= 100; i++)
    for (long long j = 0; j < 26; j++)
      for (long long k = 0; k <= 2600 - j; k++)
        mem[i][k + j] = (mem[i][k + j] + mem[i - 1][k]) % 1000000007;
  long long Case, s, len;
  string st;
  scanf("%lld", &Case);
  while (Case--) {
    cin >> st;
    len = st.size();
    s = 0;
    for (long long i = 0; i < len; i++) s += (st[i] - 'a');
    printf("%lld\n", (mem[len][s] - 1 + 1000000007) % 1000000007);
  }
  return 0;
}
