#include <bits/stdc++.h>
using namespace std;
int f[105][2700], s[106];
const int md = 1000000007;
bool out(int a) {
  if (a >= 1 && a <= 26)
    return false;
  else
    return true;
}
int main() {
  int kkk;
  scanf("%d", &kkk);
  for (int i = 1; i <= 26; i++) f[1][i] = 1;
  for (int i = 2; i <= 100; i++)
    for (int j = 1; j <= 2600; j++)
      for (int k = 1; k <= 26; k++)
        f[i][j + k] = (f[i][j + k] + f[i - 1][j]) % md;
  for (int kk = 1; kk <= kkk; kk++) {
    string s;
    cin >> s;
    int k = 0;
    for (int i = 0; i != s.size(); i++) k += s[i] - 96;
    cout << (f[s.size()][k] - 1 + md) % md << endl;
  }
}
