#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100 + 20, MAXS = 2600 + 200, M = 1000 * 1000 * 1000 + 7;
long long d[MAXN][MAXS];
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < 101; i++)
    for (int j = i + 1; j <= (i + 1) * 26; j++) {
      for (int k = 1; k <= min(j, 26); k++) {
        if (i == 0 && j <= 26)
          d[i][j] = 1;
        else if (i != 0)
          d[i][j] += d[i - 1][j - k];
        d[i][j] %= M;
      }
    }
  while (t--) {
    long long sum = 0;
    string s;
    cin >> s;
    for (int i = 0; i < s.size(); i++) sum += s[i] - 'a' + 1;
    cout << d[s.size() - 1][sum] - 1 << endl;
  }
  return 0;
}
