#include <bits/stdc++.h>
using namespace std;
long long int dp[101][2701];
int n;
char s[101];
int E = 0;
void dpp() {
  dp[0][0] = 1;
  for (int i = 1; i <= 100; ++i) {
    for (int j = 1; j <= 2601; ++j) {
      for (int letter = 1; letter <= 26; ++letter) {
        if (j - letter < 0) break;
        dp[i][j] = (dp[i][j] + dp[i - 1][j - letter]) % 1000000007;
      }
    }
  }
}
int main() {
  dpp();
  int tasks;
  scanf("%d", &tasks);
  while (tasks--) {
    scanf("%s", s);
    int dl = strlen(s);
    int E = 0;
    for (int i = 0; i < dl; ++i) E += s[i] - 'a' + 1;
    cout << dp[dl][E] - 1 << endl;
  }
  return 0;
}
