#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:60000000")
using namespace std;
long long dp[110][27 * 110];
long long mod = 1000000007;
string S;
int main() {
  dp[0][0] = 1LL;
  for (int i = 1; i <= 100; i++) {
    for (int j = 0; j <= 25 * i; j++)
      for (int k = 0; k < min(26, j + 1); k++) {
        dp[i][j] = (dp[i][j] + dp[i - 1][j - k]) % mod;
      }
  }
  int N;
  scanf("%d", &N);
  for (int j = 0; j < (int)(N); j++) {
    cin >> S;
    int sum = 0;
    for (int i = 0; i < (int)(S.size()); i++) sum += (S[i] - 'a');
    cout << (dp[S.length()][sum] + mod - 1) % mod << endl;
  }
  return 0;
}
