#include <bits/stdc++.h>
using namespace std;
long long dp[111][2610];
long long go(int len, int sum) {
  if (sum < 0) return 0;
  long long& ret = dp[len][sum];
  if (ret != -1) return ret;
  if (len == 0) return ret = sum == 0;
  ret = 0;
  for (typeof(0) i(0); i != (26); ++i)
    (ret += go(len - 1, sum - i)) %= 1000000007;
  return ret;
}
int main(int argc, char const* argv[]) {
  int t = ({
    int t;
    scanf("%d", &t);
    t;
  });
  memset(dp, -1, sizeof(dp));
  while (t--) {
    string a;
    cin >> a;
    int al = a.size(), sum = 0;
    for (typeof(0) i(0); i != (al); ++i) sum += a[i] - 'a';
    long long ans = (go(al, sum) - 1) % 1000000007;
    if (ans < 0) ans += 1000000007;
    cout << ans << endl;
  }
  return 0;
}
