#include <bits/stdc++.h>
char w[128];
int z[128][2550] = {1}, l, s, t;
int main(void) {
  for (int i(1); i < 101; ++i)
    for (int j(0); j < 2501; ++j)
      for (int k(0); k < 26; ++k)
        z[i][j + k] = (z[i - 1][j] + z[i][j + k]) % 1000000007;
  for (scanf("%d", &t); t--;) {
    scanf("%s", w);
    for (l = s = 0; w[l]; ++l) s += w[l] - 'a';
    printf("%d\n", z[l][s] - 1);
  }
  return 0;
}
