#include <bits/stdc++.h>
using namespace std;
char a[110];
long long dp[110][2620];
inline long long read() {
  long long res = 0, f = 1;
  char c;
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) res = (res << 1) + (res << 3) + (c ^ 48);
  return res * f;
}
inline void write(long long x) {
  static long long a[35];
  long long top = 0;
  if (x < 0) putchar('-'), x = -x;
  do {
    a[top++] = x % 10, x /= 10;
  } while (x);
  while (top) putchar(a[--top] + 48);
  puts("");
}
signed main() {
  long long T = read();
  dp[0][0] = 1;
  for (long long i = 1; i <= 100; i++)
    for (long long j = 1; j <= 2600; j++)
      for (long long k = 1; k <= min(j, 26ll); k++)
        dp[i][j] = (dp[i][j] + dp[i - 1][j - k]) % 1000000007;
  while (T--) {
    scanf("%s", a + 1);
    long long len = strlen(a + 1), sum = 0;
    for (long long i = 1; i <= len; i++) sum += a[i] - 'a' + 1;
    write(dp[len][sum] - 1);
  }
  return 0;
}
