#include <bits/stdc++.h>
using namespace std;
const int N = 101 * 25 + 3;
long long arr[110][N];
int mod = 1000000007;
char s[102];
int main() {
  arr[0][0] = 1;
  for (int i = 1; i < 101; i++) {
    for (int j = 0; j < N; j++)
      arr[i][j] = (arr[i - 1][j] + ((j < 1) ? 0 : arr[i][j - 1]) + mod -
                   ((j < 26) ? 0 : arr[i - 1][j - 26])) %
                  mod;
  }
  int t;
  scanf("%d", &t);
  for (int tt = 0; tt < t; tt++) {
    scanf("%s", s);
    int num = 0;
    int n = strlen(s);
    for (int i = 0; i < n; i++) num += (s[i] - 'a');
    printf("%d\n", arr[n][num] - 1);
  }
  return 0;
}
