#include <bits/stdc++.h>
using namespace std;
unsigned long long n, a[2510][110], sum, ans;
string s;
int main() {
  cin >> n;
  for (int i = 0; i <= 100; i++) {
    a[0][i] = 1;
  }
  for (int i = 0; i <= 25; i++) {
    a[i][1] = 1;
  }
  for (int i = 1; i <= 105; i++) {
    for (int j = 1; j <= 2505; j++) {
      sum = 0;
      for (int d = 0; d <= 25; d++) {
        if (j - d < 0) {
          break;
        }
        sum += a[j - d][i - 1];
      }
      a[j][i] = sum % 1000000007;
    }
  }
  for (int i = 1; i <= n; i++) {
    cin >> s;
    ans = 0;
    for (int i = 0; i < s.size(); i++) {
      ans += (s[i] - 'a');
    }
    cout << (a[ans][s.size()] - 1) % 1000000007 << endl;
  }
  return 0;
}
