#include <bits/stdc++.h>
using namespace std;
const int m = int(1e9) + 7;
string s;
int test, n, sum, f[105][3005];
bool g[105][3005];
int dp(int len, int sum) {
  if (len == 1) {
    if (sum <= 26)
      return 1;
    else
      return 0;
  }
  if (g[len][sum]) return f[len][sum];
  for (int x = 1; x < 27 && sum - x > 0; x++)
    f[len][sum] = (f[len][sum] + dp(len - 1, sum - x)) % m;
  g[len][sum] = true;
  return f[len][sum];
}
int main() {
  if (0) {
    freopen("a.inp", "r", stdin);
  };
  scanf("%d\n", &test);
  for (int i = 0; i < test; i++) {
    getline(cin, s);
    n = s.length();
    sum = 0;
    for (int j = 0; j < n; j++) sum += s[j] - 'a' + 1;
    printf("%d\n", (dp(n, sum) + m - 1) % m);
  }
}
