#include <bits/stdc++.h>
using namespace std;
int n;
int dp[105][2555];
char s[105];
inline void up(int& ret, int v) { ret = (ret + v) % 1000000007; }
int main() {
  dp[0][0] = 1;
  for (int i = 0; i < 100; ++i)
    for (int j = 0; j < 2555; ++j)
      if (dp[i][j])
        for (int k = 0; k < 26; ++k) up(dp[i + 1][j + k], dp[i][j]);
  int t;
  scanf("%d", &t);
  while (t--) {
    scanf("%s", s);
    n = strlen(s);
    int sum = 0;
    for (int i = 0; i < n; ++i) sum += s[i] - 'a';
    printf("%d\n", (dp[n][sum] - 1 + 1000000007) % 1000000007);
  }
  return 0;
}
