#include <bits/stdc++.h>
using namespace std;
void loadData(void);
int proc(void);
void printRes(int);
int testcase;
char input[101];
int dp[101][101][2501];
int getRes(int pos, int sum);
int main(int argc, char** argv) {
  loadData();
  return 0;
}
int getRes(int len, int pos, int sum) {
  if (dp[len][pos][sum] != -1) return dp[len][pos][sum];
  if (pos == len - 1) return dp[len][pos][sum] = (sum >= 0 && sum < 26 ? 1 : 0);
  if (sum < 0) return dp[len][pos][sum] = 0;
  int res = 0;
  for (int i = 0; i < 26; i++)
    res = (res + getRes(len, pos + 1, sum - i)) % 1000000007;
  return dp[len][pos][sum] = res;
}
int proc(void) {
  int len = strlen(input);
  int sum = 0;
  for (int i = 0; i < len; i++) sum += (input[i] - 'a');
  return getRes(len, 0, sum) - 1;
}
void loadData(void) {
  memset(dp, -1, sizeof(dp));
  char enter;
  scanf("%d%c", &testcase, &enter);
  while (testcase--) {
    scanf("%s%c", input, &enter);
    printRes(proc());
  }
  return;
}
void printRes(int res) {
  printf("%d\n", res);
  return;
}
