//#include <GOD>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define len length
#define FAST_IO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define frei freopen("input.txt","r",stdin)
#define freo freopen("output.txt","w",stdout)

const ll inf=1e18;
const ll mod=1e9+7;
const ll maxn=1e5+10,maxl=2e6+10;

ll t,sum;
string s;
ll dp[110][2610];

int main(){
	FAST_IO;
	dp[0][0]=1;
	for(int i=1;i<110;i++){
		for(int j=0;j<2610;j++){
			for(int k=0;k<=min(j,25);k++){
				dp[i][j]+=dp[i-1][j-k];
				dp[i][j]%=mod;
			}
		}
	}
	cin>>t;
	while(t--){
		cin>>s;
		sum=0;
		for(int i=0;i<s.len();i++){
			sum+=s[i]-'a';
		}
		cout<<(dp[s.len()][sum]-1+mod)%mod<<endl;
	}
}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;
const int N = 105, M = 1e9 + 7;
int tc;
string s;
ll dp[N][2][26 * N][2];
ll solve(int i = 0, bool sign = 0, int change = 0, bool differ = 0)
{
    if(i == s.size())                                   return (differ && !change);
    if(~dp[i][sign][change][differ])                    return dp[i][sign][change][differ];
    int new_change = change;
    if(sign)    new_change *= -1;
    int dig = s[i] - 'a';
    char new_c = s[i] - new_change;
    int ans = 0;
    for(char j = 'a';j <= 'z';++j)
    {
        if(j == new_c)
            ans += solve(i + 1, 0, 0, differ);
        else
        {
            int tmp_change = j - new_c;
            ans += solve(i + 1, tmp_change < 0, abs(tmp_change), 1);
        }
        ans %= M;
    }
    return dp[i][sign][change][differ] = ans;
}
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> tc;
    while(tc--)
    {
        cin >> s;
        memset(dp, -1, sizeof dp);
        cout << solve() << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;
const int N = 105, M = 1e9 + 7;
int tc;
string s;
ll dp[N][26 * N];
ll solve(int i, int sum)
{
    if(i == s.size())   return (!sum);
    if(~dp[i][sum])     return dp[i][sum];
    ll ans = 0;
    for(int j = 0;j <= min(25, sum);++j)
        (ans += solve(i + 1, sum - j)) %= M;
    return dp[i][sum] = ans;
}
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> tc;
    memset(dp, -1, sizeof dp);
    while(tc--)
    {
        cin >> s;
        int sum = 0;
        for(auto &it : s)
            sum += it - 'a';
        cout << (solve(0, sum) - 1 + M) % M << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;
const int N = 105, M = 1e9 + 7;
int tc;
string s;
int dp[N][2][20 * N][2];
int solve(int i = 0, bool sign = 0, int change = 0, bool differ = 0)
{
    if(i == s.size())                                   return (differ && !change);
    if(~dp[i][sign][change][differ])                    return dp[i][sign][change][differ];
    int new_change = change;
    if(sign)    new_change *= -1;
    int ans = 0;
    int dig = s[i] - 'a';
    for(int j = 0;j <= 25;++j)
    {
        if(j == dig)
            ans += solve(i + 1, sign, change, differ);
        else
        {
            int tmp_change = j - dig + new_change;
            ans += solve(i + 1, tmp_change < 0, abs(tmp_change), 1);
        }
        ans %= M;
    }
    return dp[i][sign][change][differ] = ans;
}
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> tc;
    while(tc--)
    {
        cin >> s;
        memset(dp, -1, sizeof dp);
        cout << solve() << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;
const int N = 105, M = 1e9 + 7;
int tc;
string s;
int dp[N][2][26 * N][2];
int solve(int i = 0, bool sign = 0, int change = 0, bool differ = 0)
{
    if(i == s.size())                                   return (differ && !change);
    if(~dp[i][sign][change][differ])                    return dp[i][sign][change][differ];
    int new_change = change;
    if(sign)    new_change *= -1;
    int ans = 0;
    int dig = s[i] - 'a';
    for(int j = 0;j <= 25;++j)
    {
        if(j == dig)
            ans += solve(i + 1, sign, change, differ);
        else
        {
            int tmp_change = j - dig + new_change;
            ans += solve(i + 1, tmp_change < 0, abs(tmp_change), 1);
        }
        ans %= M;
    }
    return dp[i][sign][change][differ] = ans;
}
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> tc;
    while(tc--)
    {
        cin >> s;
        memset(dp, -1, sizeof dp);
        cout << solve() << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;
const int N = 105, M = 1e9 + 7;
int tc;
string s;
int dp[N][26 * N];
int solve(int i, int sum)
{
    if(i == s.size())   return (!sum);
    if(~dp[i][sum])     return dp[i][sum];
    int ans = 0;
    for(int j = 0;j <= min(25, sum);++j)
        (ans += solve(i + 1, sum - j)) %= M;
    return dp[i][sum] = ans;
}
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> tc;
    memset(dp, -1, sizeof dp);
    while(tc--)
    {
        cin >> s;
        int sum = 0;
        for(auto &it : s)
            sum += it - 'a';
        cout << (solve(0, sum) - 1 + M) % M << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;
const int N = 105, M = 1e9 + 7;
int tc;
ll dp[N][26 * N];
ll solve(int i, int sum)
{
    if(!i)              return (!sum);
    if(~dp[i][sum])     return dp[i][sum];
    ll ans = 0;
    for(int j = 0;j <= min(25, sum);++j)
        (ans += solve(i - 1, sum - j)) %= M;
    return dp[i][sum] = ans;
}
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> tc;
    memset(dp, -1, sizeof dp);
    while(tc--)
    {
        string s;
        cin >> s;
        int sum = 0;
        for(auto &it : s)
            sum += it - 'a';
        cout << (solve(s.size(), sum) - 1 + M) % M << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;
const int N = 105, M = 1e9 + 7;
int tc;
string s;
int dp[N][2][2 * N][2];
int solve(int i = 0, bool sign = 0, int change = 0, bool differ = 0)
{
    if(i == s.size())                                   return (differ && !change);
    if(~dp[i][sign][change][differ])                    return dp[i][sign][change][differ];
    int new_change = change;
    if(sign)    new_change *= -1;
    int ans = 0;
    int dig = s[i] - 'a';
    for(int j = 0;j <= 25;++j)
    {
        if(j == dig)
            ans += solve(i + 1, sign, change, differ);
        else
        {
            int tmp_change = j - dig + new_change;
            ans += solve(i + 1, tmp_change < 0, abs(tmp_change), 1);
        }
        ans %= M;
    }
    return dp[i][sign][change][differ] = ans;
}
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> tc;
    while(tc--)
    {
        cin >> s;
        memset(dp, -1, sizeof dp);
        cout << solve() << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;
const int N = 105, M = 1e9 + 7;
int tc;
string s;
int dp[N][2][26 * N][2];
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> tc;
    while(tc--)
    {
        cin >> s;
        for(int i = s.size();i >= 0;--i)
        {
            for(int sign = 0;sign < 2;++sign)
            {
                for(int change = 0;change <= 26 * N;++change)
                {
                    for(int differ = 0;differ < 2;++differ)
                    {
                        int &ret = dp[i][sign][change][differ];
                        if(i == s.size())
                            ret = (differ && !change);
                        else
                        {
                            int new_change = change;
                            if(sign)    new_change *= -1;
                            ret = 0;
                            int dig = s[i] - 'a';
                            for(int j = 0;j <= 25;++j)
                            {
                                if(j == dig)
                                    ret += dp[i + 1][sign][change][differ];
                                else
                                {
                                    int tmp_change = j - dig + new_change;
                                    ret += dp[i + 1][tmp_change < 0][abs(tmp_change)][1];
                                }
                                ret %= M;
                            }
                        }
                    }
                }
            }
        }
        cout << dp[0][0][0][0] << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;
const int N = 105, M = 1e9 + 7;
int tc;
string s;
int dp[N][20 * N];
int solve(int i, int sum)
{
    if(i == s.size())   return (!sum);
    if(~dp[i][sum])     return dp[i][sum];
    int ans = 0;
    for(int j = 0;j <= min(25, sum);++j)
        (ans += solve(i + 1, sum - j)) %= M;
    return dp[i][sum] = ans;
}
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> tc;
    while(tc--)
    {
        cin >> s;
        memset(dp, -1, sizeof dp);
        int sum = 0;
        for(auto &it : s)
            sum += it - 'a';
        cout << (solve(0, sum) - 1 + M) % M << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;
const int N = 105, M = 1e9 + 7;
int tc;
string s;
int dp[N][26 * N];
int solve(int i, int sum)
{
    if(i == s.size())   return (!sum);
    if(~dp[i][sum])     return dp[i][sum];
    int ans = 0;
    for(int j = 0;j <= min(25, sum);++j)
        (ans += solve(i + 1, sum - j)) %= M;
    return dp[i][sum] = ans;
}
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> tc;
    while(tc--)
    {
        cin >> s;
        memset(dp, -1, sizeof dp);
        int sum = 0;
        for(auto &it : s)
            sum += it - 'a';
        cout << (solve(0, sum) - 1 + M) % M << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;
const int N = 105, M = 1e9 + 7;
int tc;
string s;
ll dp[N][2][26 * N][2];
ll solve(int i = 0, bool sign = 0, int change = 0, bool differ = 0)
{
    if(i == s.size())                                   return (differ && !change);
    if(~dp[i][sign][change][differ])                    return dp[i][sign][change][differ];
    int new_change = change;
    if(sign)    new_change *= -1;
    ll ans = 0;
    int dig = s[i] - 'a';
    for(int j = 0;j <= 25;++j)
    {
        if(j == dig)
            ans += solve(i + 1, sign, change, differ);
        else
        {
            int tmp_change = j - dig + new_change;
            ans += solve(i + 1, tmp_change < 0, abs(tmp_change), 1);
        }
        ans %= M;
    }
    return dp[i][sign][change][differ] = ans;
}
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> tc;
    while(tc--)
    {
        cin >> s;
        memset(dp, -1, sizeof dp);
        cout << solve() << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;
const int N = 105, M = 1e9 + 7;
int tc;
string s;
int dp[N][20 * N];
int solve(int i, int sum)
{
    if(i == s.size())   return (!sum);
    if(~dp[i][sum])     return dp[i][sum];
    int ans = 0;
    for(int j = 0;j <= min(25, sum);++j)
        (ans += solve(i + 1, sum - j)) %= M;
    return dp[i][sum] = ans;
}
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> tc;
    memset(dp, -1, sizeof dp);
    while(tc--)
    {
        cin >> s;
        int sum = 0;
        for(auto &it : s)
            sum += it - 'a';
        cout << (solve(0, sum) - 1 + M) % M << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;
const int N = 105, M = 1e9 + 7;
int tc, n;
ll dp[N][26 * N];
ll solve(int i, int sum)
{
    if(i == n)          return (!sum);
    if(~dp[i][sum])     return dp[i][sum];
    ll ans = 0;
    for(int j = 0;j <= min(25, sum);++j)
        (ans += solve(i + 1, sum - j)) %= M;
    return dp[i][sum] = ans;
}
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> tc;
    memset(dp, -1, sizeof dp);
    while(tc--)
    {
        string s;
        cin >> s;
        n = s.size();
        int sum = 0;
        for(auto &it : s)
            sum += it - 'a';
        cout << (solve(0, sum) - 1 + M) % M << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>

#define make_unique(x) sort(all(x)),x.resize(unique(all(x))-x.begin())
#define re return
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int) (x).size())
#define sqr(x) ((x) * (x))
#define sqrt(x) sqrt(abs(x))
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)

using namespace std;

typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector<pii> vii;
typedef vector<ll> vll;
typedef long double ld;
typedef unsigned long long ull;

int t;
ll dp[200][3000];
ll mod = 1000000007;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	rep(i, 26)
	{
	    dp[1][i] = 1;
	}
	for (int i = 2; i <= 120; i++)
    {
        for (int j = 0; j <= 2700; j++)
        {
            for (int k = 0; k < 26; k++)
            {
                if (j - k >= 0) dp[i][j] += dp[i-1][j-k];
                dp[i][j] %= mod;
            }
        }
    }

	cin >> t;
	while (t--)
    {
        string s;
        cin >> s;
        int sum = 0;
        rep(i, sz(s))
            sum += s[i] - 'a';
        cout << dp[sz(s)][sum] - 1 << "\n";
    }

	re 0;
}


#include <bits/stdc++.h>
#define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll long long
#define f first
#define s second
using namespace std;

const int N = 105, M = 2505, mod = 1e9 + 7;

int t, n, m, dp[N][M];
string s;

int sum()
{
    int ret = 0;
    for(auto i : s)
        ret += i - 'a' + 1;
    return ret;
}

int solve(int i, int sm)
{
    if(i == 0)
        return (sm == 0);
    int &x = dp[i][sm];
    if(x != -1)
        return x;
    x = 0;
    for(int j = 1; j <= min(sm, 26); j++)
        x = (x + solve(i - 1, sm - j)) % mod;
    return x;
}

int main()
{
    IO;
    memset(dp, -1, sizeof dp);
    cin >> t;
    while(t--)
    {
        cin >> s;
        n = s.size();
        m = sum();
        cout << (solve(n, m) - 1 + mod) % mod << '\n';
    }
}


#include <bits/stdc++.h>
#define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll long long
#define f first
#define s second
using namespace std;

const int N = 105, M = 2505, mod = 1e9 + 7;

int t, n, m, dp[N][M];
string s;

int sum()
{
    int ret = 0;
    for(auto i : s)
        ret += i - 'a' + 1;
    return ret;
}

int solve(int i, int sm)
{
    if(i == n)
        return (sm == 0);
    int &x = dp[i][sm];
    if(x != -1)
        return x;
    x = 0;
    for(int j = 1; j <= min(sm, 26); j++)
        x = (x + solve(i + 1, sm - j)) % mod;
    return x;
}

int main()
{
    IO;
    memset(dp, -1, sizeof dp);
    cin >> t;
    while(t--)
    {
        cin >> s;
        n = s.size();
        m = sum();
        cout << (solve(0, m) - 1 + mod) % mod << '\n';
    }
}


#include<bits/stdc++.h>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define X first
#define Y second
#define pb push_back
#define sz(s) int64_t(s.size())
#define make_unique(x) sort(all(x)), x.resize(unique(all(x)) - x.begin())

const LL mod = 1e9 + 7;

template<class T>
istream& operator >> (istream& in, vector<T>& v){ for (auto &x : v) { in >> x; } return in; }

template<class T, class U>
istream& operator >> (istream& in, pair<T, U> & v){ in >> v.X >> v.Y;return in; }

template<class T, class U>
ostream& operator << (ostream& out, pair<T, U> & v){ out << v.X << " " << v.Y;return out; }

template<class T, class U>
void chkmax(T &a, U b) {
    a = max(a, (T)b);
    return;
}

template<class T, class U>
void chkmin(T &a, U b) {
    a = min(a, (T)b);
    return;
}

LL ppow (LL x, LL s) {
    if (!s) return 1;
    if (!(s - 1)) return x % mod;
    if (s % 2) return (x * ppow (x, s - 1)) % mod;
    LL b = ppow (x, s / 2);
    return (b * b) % mod;
}

vector<int> zf (string s) {

	int n = sz(s);

	vector<int> z (n);

	for (int i = 1, l = 0, r = 0; i < n; i++) {

		if (i <= r)
			z[i] = min (r - i + 1, z[i - l]);

		while (i + z[i] < n && s[z[i]] == s[i + z[i]])
			z[i]++;

		if (i + z[i] - 1 > r)
			l = i,  r = i + z[i] - 1;

	}

	return z;

}

vector<int> pf(string p) {
    int n = sz(p);
    vector<int> pref_fun(n, 0);

    for (int i = 1;i < n;i++) {
        int j = pref_fun[i - 1];
        while (j > 0 && p[i] != p[j])
            j = pref_fun[j - 1];
        if (p[i] == p[j])
            j++;
        pref_fun[i] = j;
    }
    return pref_fun;
}

vector<vector<int> > mul(vector<vector<int> > &a, vector<vector<int> > &b) {
    int n = sz(a);
    vector<vector<int> > c(n, vector<int> (n, 0));

    for (int i = 0;i < n;i++) {
        for (int j = 0;j < n;j++) {
            for (int k = 0;k < n;k++) {
                LL ga = a[i][k];
                ga *= b[k][j];
                ga %= mod;
                c[i][j] += ga;
                if (c[i][j] >= mod) {
                    c[i][j] -= mod;
                }
            }
        }
    }

    return c;
}

vector<vector<int> > matrix_pow(vector<vector<int> > a, LL y) {
    int n = sz(a);
    vector<vector<int> > res(n, vector<int> (n, 0));
    for (int i = 0;i < n;i++) res[i][i] = 1;
    while (y) {
        if (y%2 == 1) {
            res = mul(res, a);
            y--;
        }else {
            a = mul(a, a);
            y /= 2;
        }
    }
    return res;
}

main(){
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
//    freopen("input.txt", "r", stdin);

    int MAXN = 101;

    vector<vector<LL> > dp(MAXN, vector<LL> (MAXN*26,0));

    dp[0][0] = 1;

    for (int i = 0;i < MAXN - 1;i++) {
        for (int j = 0;j < 26*MAXN;j++) {
            for (int k = 0;k < 26;k++) {
                if (j + k < MAXN*26) {
                    dp[i + 1][j + k] += dp[i][j];
                    if (dp[i + 1][j + k] >= mod) dp[i + 1][j + k] -= mod;
                }
            }
        }
    }

    int t;
    cin >> t;

    while (t--) {
        string s;
        cin >> s;
        int n = sz(s);
        int m = 0;
        for (auto x : s) {
            m += x - 'a';
        }

        cout << (mod - 1 + dp[n][m])%mod  << '\n';
    }

    return 0;
}


#define watch5(A,b,c,d,e) cerr<<#A<<": "<<A<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d << " | "<<#e<<": "<<e<<endl;
#define watch4(A,b,c,d) cerr<<#A<<": "<<A<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define watch3(A,b,c) cerr <<#A<<": "<<A<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<endl;
#define sharingan cerr << "\N-------------------------------------------\N\N";
#define watch2(A,b) cerr <<#A<<": "<<A<<" | "<<#b<<": "<<b<< endl;
#define Yup ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define watch(A) cerr <<#A<<": "<<A<<endl;
#define __gcd(A, b) __algo_gcd(A, b)
#define PI 3.14159265358979323846
#include<set>
#include<map>
#include<cmath>
#include<stack>
#include<queue>
#include<array>
#include<cstdio>
#include<bitset>
#include<vector>
#include<utility>
#include<sstream>
#include<cstring>
#include <climits>
#include <fstream>
#include<iostream>
#include<iomanip>
#include<algorithm>
#include <functional>
#include <unordered_map>
using namespace std;
#define mod 1000000007

string s;

long long go( int left, int req, vector<vector<long long> > &dp){
    if( req == 0 && left == 0 )return 1;
    if( left < 0 )return 0;
    if( req < 0 )return 0;
    if( dp[left][req] != -1 )return dp[left][req];
    long long ans = 0;
    for( int i = 1; i <= 26; i++ ){
        ans += go( left-1, req-i, dp);
        ans %= mod;
    }
    return dp[left][req] = ans;
}

int main(){
    vector<vector<long long> > dp(101, vector<long long>(2601, -1));
    go(100, 2600, dp);
    int t;
    cin >> t;
    while( t-- ){
        cin >> s;
        int req = 0;
        for( auto it : s ){
            req += it - 'a' + 1;
        }
        int l = s.size();
        cout << go(l, req, dp)-1 << "\n";
    }
}


#define watch5(A,b,c,d,e) cerr<<#A<<": "<<A<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d << " | "<<#e<<": "<<e<<endl;
#define watch4(A,b,c,d) cerr<<#A<<": "<<A<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define watch3(A,b,c) cerr <<#A<<": "<<A<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<endl;
#define sharingan cerr << "\N-------------------------------------------\N\N";
#define watch2(A,b) cerr <<#A<<": "<<A<<" | "<<#b<<": "<<b<< endl;
#define Yup ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define watch(A) cerr <<#A<<": "<<A<<endl;
#define __gcd(A, b) __algo_gcd(A, b)
#define PI 3.14159265358979323846
#include<set>
#include<map>
#include<cmath>
#include<stack>
#include<queue>
#include<array>
#include<cstdio>
#include<bitset>
#include<vector>
#include<utility>
#include<sstream>
#include<cstring>
#include <climits>
#include <fstream>
#include<iostream>
#include<iomanip>
#include<algorithm>
#include <functional>
#include <unordered_map>
using namespace std;
#define mod 1000000007

string s;

long long go( int left, int req, vector<vector<long long> > &dp){
    if( req == 0 && left == 0 )return 1;
    if( left < 0 )return 0;
    if( req < 0 )return 0;
    if( dp[left][req] != -1 )return dp[left][req];
    long long ans = 0;
    for( int i = 1; i <= 26; i++ ){
        ans += go( left-1, req-i, dp);
        ans %= mod;
    }
    return dp[left][req] = ans;
}

int main(){
    int t;
    cin >> t;
    while( t-- ){
        cin >> s;
        int req = 0;
        for( auto it : s ){
            req += it - 'a' + 1;
        }
        int l = s.size();
        vector<vector<long long> > dp(l+1, vector<long long>(req+1, -1));
        cout << go(l, req, dp)-1 << "\n";
    }
}


#define watch5(A,b,c,d,e) cerr<<#A<<": "<<A<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d << " | "<<#e<<": "<<e<<endl;
#define watch4(A,b,c,d) cerr<<#A<<": "<<A<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define watch3(A,b,c) cerr <<#A<<": "<<A<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<endl;
#define sharingan cerr << "\N-------------------------------------------\N\N";
#define watch2(A,b) cerr <<#A<<": "<<A<<" | "<<#b<<": "<<b<< endl;
#define Yup ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define watch(A) cerr <<#A<<": "<<A<<endl;
#define __gcd(A, b) __algo_gcd(A, b)
#define PI 3.14159265358979323846
#include<set>
#include<map>
#include<cmath>
#include<stack>
#include<queue>
#include<array>
#include<cstdio>
#include<bitset>
#include<vector>
#include<utility>
#include<sstream>
#include<cstring>
#include <climits>
#include <fstream>
#include<iostream>
#include<iomanip>
#include<algorithm>
#include <functional>
#include <unordered_map>
using namespace std;
#define mod 1000000007

string s;

long long go( int left, int req, vector<vector<long long> > &dp){
    if( req == 0 && left == 0 )return 1;
    if( left < 0 )return 0;
    if( req < 0 )return 0;
    if( dp[left][req] != -1 )return dp[left][req];
    long long ans = 0;
    for( int i = 1; i <= 26; i++ ){
        ans += go( left-1, req-i, dp);
        ans %= mod;
    }
    return dp[left][req] = ans;
}

int main(){
    vector<vector<long long> > dp(101, vector<long long>(2601, -1));
    go(100, 2600, dp);
    int t;
    cin >> t;
    while( t-- ){
        cin >> s;
        int req = 0;
        for( auto it : s ){
            req += it - 'a' + 1;
        }
        int l = s.size();
        cout << go(l, req, dp)-1 << "\n";
    }
}

// Example:
// s = ywy convert it to digits s = 25 23 25
// total possiblity
// cnt: 1 | i: 21 | j: 26 | k: 26
// cnt: 2 | i: 22 | j: 25 | k: 26
// cnt: 3 | i: 22 | j: 26 | k: 25
// cnt: 4 | i: 23 | j: 24 | k: 26
// cnt: 5 | i: 23 | j: 25 | k: 25
// cnt: 6 | i: 23 | j: 26 | k: 24
// cnt: 7 | i: 24 | j: 23 | k: 26
// cnt: 8 | i: 24 | j: 24 | k: 25
// cnt: 9 | i: 24 | j: 25 | k: 24
// cnt: 10 | i: 24 | j: 26 | k: 23
// cnt: 11 | i: 25 | j: 22 | k: 26
// cnt: 12 | i: 25 | j: 23 | k: 25
// cnt: 13 | i: 25 | j: 24 | k: 24
// cnt: 14 | i: 25 | j: 25 | k: 23
// cnt: 15 | i: 25 | j: 26 | k: 22
// cnt: 16 | i: 26 | j: 21 | k: 26
// cnt: 17 | i: 26 | j: 22 | k: 25
// cnt: 18 | i: 26 | j: 23 | k: 24
// cnt: 19 | i: 26 | j: 24 | k: 23
// cnt: 20 | i: 26 | j: 25 | k: 22
// cnt: 21 | i: 26 | j: 26 | k: 21


#include <vector>
#include <math.h>
#include<algorithm>
#include <iostream>
#include<set>
#include <string>
#include <math.h>
#include <numeric>
#include<map>
#include<queue>
#define pll pair<ll,ll>
#define pii pair<int,int>
#define ll long long int
#define vi vector<int>
#define vll vector<long long int>
#define ve vector
#define fi first
#define se second
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define pb push_back
#define mp make_pair
#define len(a) (int)(a).size()
#define all(a) (a).begin(),(a).end()
#define endl  '\n'
#define M_PI 3.14159265358979323846
const int INF = 2 * 1e9;
const ll MOD = 1000000007;

using namespace std;
ve<ve<ll>> was(27*(100+10), ve<ll>(110, -1));

int dp(ll sum, int n) {
	if (n == 0) {
		return sum == 0;
	}
	if (was[sum][n] != -1)
		return was[sum][n];
	ll ans = 0;
	for (int i = 0; i < 26; i++) {
		if (i <= sum) {
			ans = (ans + dp(sum - i, n - 1)%MOD) % MOD;
		}
	}
	was[sum][n] = ans;
	return ans;
}

void solve() {
	string s;
	cin >> s;
	int sum = 0;
	rep(i, len(s)) {
		sum += (s[i] - 'a');
	}
	cout << dp(sum, len(s))-1 << endl;

}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	cout.fixed; cout.precision(12);
	int t; cin >> t; rep(i, t)
	solve();

	return 0;
}


#include <vector>
#include <math.h>
#include<algorithm>
#include <iostream>
#include<set>
#include <string>
#include <math.h>
#include <numeric>
#include<map>
#include<queue>
#define pll pair<ll,ll>
#define pii pair<int,int>
#define ll long long int
#define vi vector<int>
#define vll vector<long long int>
#define ve vector
#define fi first
#define se second
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define pb push_back
#define mp make_pair
#define len(a) (int)(a).size()
#define all(a) (a).begin(),(a).end()
#define endl  '\n'
#define M_PI 3.14159265358979323846
const int INF = 2 * 1e9;
const ll MOD = 1000000007;

using namespace std;
ve<ve<ll>> was(27*(100+10), ve<ll>('z' - 'a' + 1, -1));

int dp(ll sum, int n) {
	if (n == 0) {
		return sum == 0;
	}
	if (was[sum][n] != -1) return was[sum][n];
	ll ans = 0;
	for (int i = 0; i < 26; i++) {
		if (i <= sum) {
			ans = (ans + dp(sum - i, n - 1)%MOD) % MOD;
		}
	}
	was[sum][n] = ans;
	return ans;
}

void solve() {
	string s;
	cin >> s;
	int sum = 0;
	rep(i, len(s)) {
		sum += (s[i] - 'a');
	}
	cout << dp(sum, len(s))-1 << endl;

}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	cout.fixed; cout.precision(12);
	int t; cin >> t; rep(i, t)
	solve();

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

#define nl '\n'

#define y1 aza_ibagaliev

#define f first
#define s second

#define ed end()
#define bg begin()
#define rbg rbegin()

#define rv reverse
#define mp make_pair
#define pb push_back
#define ppb pop_back
#define ppf pop_front

#define sz size()
#define all(x) x.bg, x.ed

#define pll pair < ll, ll >
#define pii pair < int, int >

#define sqr(x) ((x) * 1ll * (x))
#define sqrd(x) ((x) * 1.0 * (x))

#define speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)

#define rnl cout << "----------------------------------------" << nl

#define bit __builtin_popcount

inline ll bip(ll x, ll n, ll mod){ll res=1;while(n){if(n & 1){res=(res*x)%mod;}x=(x*x)%mod;n>>=1;}return res;}

const int ppr = 257;
const ll INF = 2e18;
const int inf = 2e9;
const int mod = 1e9 + 7;
const int N = 1e6 + 123;
const ld pi = 3.1741592653589793238462643;

const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};

int dp[111][3333];

main() {
//  freopen(".in", "r", stdin);
//  freopen(".out", "w", stdout);

//	srand(time(NULL));

	dp[0][0] = 1;
	for(int l = 1; l <= 100; l++)
		for(int s = 0; s <= 2500; s++)
			for(int k = s; k >= max(0, s - 25); k--)
				dp[l][s] = (dp[l][s] + dp[l - 1][k]) % mod;

	int t;
	cin >> t;
	while(t--) {
		string s;
		cin >> s;
		int sum = 0;
		for(char c : s)
			sum += int(c - 'a');
		cout << dp[s.size()][sum] - 1 << nl;
	}

    return 0;
}


#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define repi(i, a, b) for(int i=(a); i>(b); i--)
#define db(x) (cerr << #x << ": " << (x) << '\n')
#define sync ios_base::sync_with_stdio(false), cin.tie(NULL)
#define tests(t) int t; cin >> t; while(t--)
#define iceil(n, x) (((n) + (x) - 1) / (x))
#define ll long long
#define gcd __gcd
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define sz size()
#define all(v) (v).begin(), (v).end()
#define uni(v) sort(all(v)); (v).erase(unique(all(v)), (v).end());
#define pii pair<int, int>
#define vi vector<int>
#define vpii vector<pii>
#define vvi vector<vi>
#define fi first
#define se second
#define umap unordered_map
#define uset unordered_set
#define pqueue priority_queue
#define si(a) scanf("%d", &a)
#define sll(a) scanf("%lld", &a)
#define bitcount(x) __builtin_popcount(x)
#define cps CLOCKS_PER_SEC
#define PI acos(-1.0)
#define EPS 1e-9
#define mod 1000000007
#define MOD 1000000007
#define N 5005
using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}

template<typename T>
using minpq = priority_queue<T, vector<T>, greater<T>>;

template<typename T>
using maxpq = priority_queue<T>;

//All indexing is 0-based
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag,
             tree_order_statistics_node_update> ordered_set;
//methods: find_by_order(k); & order_of_key(k);
//To make it an ordered_multiset, use pairs of (value, time_of_insertion)
//to distinguish values which are similar.

template<class key, class value, class cmp = std::less<key>>
using ordered_map = tree<key, value, cmp, rb_tree_tag, tree_order_statistics_node_update>;
//ordered_map<int, int> my_map;

//Returns no. of values x for which ceil(n / x) == y (y must be > 1).
inline ll CC(ll n, ll y) { return iceil(n, y-1) - iceil(n, y); }

//Returns no. of values x for which floor(n / x) == y
inline ll FF(ll n, ll y) { return n / y - n / (y+1); }

//a and b are assumed to be taken modulo p
inline int add(int a, int b, int p = mod){ int c = a + b; if(c >= p) c -= p; return c;}
inline int sub(int a, int b, int p = mod){ int c = a - b; if(c < 0) c += p; return c;}
inline int mul(int a, int b, int p = mod){ return (a * 1ll * b) % p;}

int dp[105][3005];
int n;

int rec(int i, int j) {
    if(j < 0) return 0;
    if(i == 0) return !j;
    int &ans = dp[i][j];

    if(ans != -1) return ans;

    ans = 0;
    for(int x = 0; x < 26; x++) {
        ans = add(ans, rec(i-1, j-x));
    }
    return ans;
}

main()
{
    #ifndef ONLINE_JUDGE
        freopen("/home/tarun/Desktop/input.txt", "r", stdin);
    //  freopen("/home/tarun/Desktop/output.txt", "w", stdout);
    #endif
    sync;
    clock_t clk = clock();
    cerr << "I will return...\n";

    memset(dp, -1, sizeof dp);
    tests(t) {
        int sum = 0; string s; cin >> s;
        for(char c : s) sum += c - 'a';
        n = s.sz;
        cout << sub(rec(n, sum), 1) << '\n';
    }

    cerr << "...don't you ever hang your head.\n";
    cerr << "Time (in ms): " << double(clock() - clk) * 1000.0 / cps << '\n';
}

//Compile using:
//g++ -o filename.exe --std=c++11 filename.cpp
//Use -D CP for defining a macro CP in the local environment


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <queue>
#include <stack>
#include <sstream>
#include <cstring>
#include <numeric>
#include <ctime>
#include <cassert>
#include <random>
#include <valarray>
//#include <fstream>

#define re return
#define fi first
#define se second
#define mp make_pair
#define pb emplace_back
#define all(x) x.begin(), x.end()
#define sz(x) ((int)(x).size())
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define y0 y32479
#define y1 y95874
#define next next239
#define prev prev239
#define fill(x, y) memset(x, y, sizeof(x))
#define sqr(x) ((x)*(x))
#define sqrt(x) sqrt(abs(x))
#define unq(x) (x.resize(unique(all(x)) - x.begin()))
#define ba back()
#define fastIO() {ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);}
#define in(x) int x; cin >> x;
#define in1(x) int x; cin >> x; x--;
#define inll(x) ll x; cin >> x;
#define ins(x) string x; cin >> x;

#ifdef LOCAL_BOBER
bool local = true;
#define deb(x) cout << #x << " = " << (x) << endl
#define debn(x, n) { cout << #x << "(" << n << ") = " << \
	"{"; int _f_ = 1; rep(_i_, n) {if (!_f_) cout << "|"; cout << x[_i_]; _f_= 0;} cout << "}" << endl;}
#define deba(x) { cout << #x << " (size: " << sz(x) << ") = " << \
	"{"; int _f_ = 1; for (auto o : x) {if (!_f_) cout << "|"; cout << o; _f_ = 0;} cout << "}" << endl;}
#else
bool local = false;
#define deb(x) ;
#define debn(x, n) ;
#define deba(x) ;
#define endl "\n"
#endif

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef pair<double, double> pdd;
typedef long double LD;
typedef double D;

template<class T> string toString(T x) { ostringstream sout; sout << x;	re sout.str();}
template<class T> void print(T v) { cout << sz(v) << endl; for (auto x : v) cout << x << ' '; cout << endl; };
template<class T1, class T2> ostream& operator << (ostream &o, pair<T1, T2> x) {re o << x.fi << ' ' << x.se;}
template<class T1, class T2> istream& operator >> (istream &o, pair<T1, T2> &x) {re o >> x.fi >> x.se;}
template<class T1, class T2> pair<T1, T2> operator + (pair<T1, T2> a, pair<T1, T2> b) {a.fi += b.fi; a.se += b.se; re a;}
template<class T1, class T2> pair<T1, T2> operator - (pair<T1, T2> a, pair<T1, T2> b) {a.fi -= b.fi; a.se -= b.se; re a;}
template<class T1, class T2> void operator += (pair<T1, T2> &a, pair<T1, T2> b) {a.fi += b.fi; a.se += b.se;}
template<class T1, class T2> void operator -= (pair<T1, T2> &a, pair<T1, T2> b) {a.fi -= b.fi; a.se -= b.se;}

int nint() {int x; cin >> x; re x;}
double getTime() { re clock() / (double) CLOCKS_PER_SEC;};

mt19937 rnd(0);
int rand(int n) { re rnd() % n; }
int rand(int l, int r) { re rnd() % (r - l + 1) + l; }

const int mod = 1000000000 + 7;

void initIO() {
	if (local) {
		freopen("input.txt", "r", stdin);
		//freopen("output.txt", "w", stdout);
		srand((int)time(0));
		rnd.seed((int)time(0));
	}
	else {
		//freopen("input.txt", "r", stdin);
		//freopen("output.txt", "w", stdout);
		fastIO();
	}
}

void solve();
void precalc();

int main() {
	initIO();

	precalc();

	int tc = 1;
	cin >> tc;
	rep(tt, tc) {
//		cout << "Case #" << tt + 1 << ": ";
		solve();
	}

	if (local)
		cout << endl << "time = " << getTime() << endl;
}

/* ================ actual code starts here ================ */

int n;
int m;

int get(string s) {
	int ans = 0;
	for (char c : s)
		ans += c - 'a';
	re ans;
}

int table[105][3000];

int getans(int k, int s) {
	if (!k)
		re s == 0;
	int &ans = table[k][s];
	if (ans != -1)
		re ans;
	ans = 0;
	rep(i, 26)
	if (s >= i) {
		ans += getans(k - 1, s - i);
		if (ans >= mod)
			ans -= mod;
	}
	re ans;
}

void precalc() {
	fill(table, -1);
}

void solve() {
	string s;
	cin >> s;

	cout << (getans(sz(s), get(s)) + mod - 1) % mod << endl;
}


#include <bits/stdc++.h>

using namespace std;

#define MOD 1000000007
#define N 102
#define M 26
#define ll long long
#define ld long double
#define pb push_back
#define ff first
#define ss second

ll dp[N][N*M];

int main(){
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif
	int t; cin>>t;
	int n, i, j, k;
	ll sum, ans;
	string s;
	dp[0][0] = 1;
	for(i=1; i<N; i++){
		for(j=0; j<N*M; j++){
			for(k=0; k<M; k++){
				dp[i][j+k] = (dp[i][j+k] + dp[i-1][j]) % MOD;
			}
		}
	}
	while(t--){
		cin>>s;
		n = s.size(); sum = 0;
		for(i=0; i<n; i++){
			sum = sum + s[i] - 'a';
		}
		ans = (dp[n][sum] - 1 + MOD) % MOD;
		cout<<ans<<"\n";
	}
	return 0;
}


    /*  CF_CC_
            4U7H0R:_C4551DY */

#include <bits/stdc++.h>
#include <fstream>

using namespace std;

typedef long long ll;

#define IC ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define rep(a,b,c) for(int a=b;a<c;a++)
#define lb lower_bound
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vec vector<ll>
#define fir first
#define sec second
#define pb push_back
#define mp make_pair
#define len length()
#define rev reverse
#define con continue
#define pq priority_queue <int>

const int mx=2e3+666;
const ll mod=1e9+7;
const ll inf=1e9;
const int llg=18;

int power(ll a, ll b){
	if (b==0)
		return 1;
	ll c=power(a,b/2);
	if(b&1)
		return b*c*c;
    else
        return c*c;
}
ll dp[166][mx];

int main(){
    IC
    rep(i,0,26) dp[1][i]=1;
    rep(i,2,160){
        rep(j,0,mx){
            rep(k,0,min(26,j+1)) dp[i][j]=(dp[i][j]+dp[i-1][j-k])%mod;
        }
    }
    int t;
    cin >> t;
    while(t--){
        ll sum=0;
        string s;
        cin >> s;
        rep(i,0,s.len) sum+=s[i]-'a',sum%=mod;
        cout << dp[s.len][sum]-1 << '\n';
    }
}


#define _USE_MATH_DEFINES

#include <iostream>
#include <cstdio>
#include <map>
#include <vector>
#include <set>
#include <string>
#include <list>
#include <cstdlib>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <stack>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>

using namespace std;

typedef long long li;
typedef long double ld;
typedef pair<int, int> pt;

#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
#define forn(i,n) for (int i = 0; i < int(n); ++i)
#define ft first
#define sc second

const int INF = 1e9;

string ss;

bool read()
{
    return (cin >> ss);
}

const int N = 6000;

int dp[105][N];

void solve()
{
    int low = N / 2, hight = low + 25;
    int s[105];

    forn (i, ss.size())
        s[i] = ss[i] - 'a' + low;

    forn (i, 105)
        forn (j, N)
            dp[i][j] = 0;

    dp[0][s[0]] = 1;

    int mod = 1e9 + 7;
    forn (i, ss.size() - 1)
    {
        forn (j, N)
        {
            if (dp[i][j] == 0)
                continue;

            for (int nj = low; nj <= hight; ++nj)
            {
                int del = j - nj;
                if (s[i + 1] + del < 0 || s[i + 1] + del >= N)
                    continue;
                dp[i + 1][s[i + 1] + del] = (dp[i + 1][s[i + 1] + del] + dp[i][j]) % mod;
            }
        }
    }

    int ans = 0;
    for (int i = low; i <= hight; ++i)
        ans = (ans + dp[ss.size() - 1][i]) % mod;

    cout << ans - 1 << endl;
}

int main() {
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#endif

    int t;
    cin >> t;

    while(read())
        solve();

    return 0;
}


#define _USE_MATH_DEFINES

#include <iostream>
#include <cstdio>
#include <map>
#include <vector>
#include <set>
#include <string>
#include <list>
#include <cstdlib>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <stack>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>

using namespace std;

typedef long long li;
typedef long double ld;
typedef pair<int, int> pt;

#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
#define forn(i,n) for (int i = 0; i < int(n); ++i)
#define ft first
#define sc second

const int INF = 1e9;

string s;

bool read()
{
    return (cin >> s);
}

const int N = 230;

int dp[105][N];

void solve()
{
    forn (i, s.size())
        s[i] -= 'a' - 100;

    int low = 100, hight = 125;

    forn (i, 105)
        forn (j, N)
            dp[i][j] = 0;

    dp[0][s[0]] = 1;

    int mod = 1e9 + 7;
    forn (i, s.size() - 1)
    {
        forn (j, N)
        {
            if (dp[i][j] == 0)
                continue;
            for (int nj = low; nj <= hight; ++nj)
            {
                int del = j - nj;
                if (s[i + 1] - del < 0 || s[i + 1] - del >= N)
                    continue;
                dp[i + 1][s[i + 1] + del] = (dp[i + 1][s[i + 1] + del] + dp[i][j]) % mod;
            }
        }
    }

    int ans = 0;
    for (int i = low; i <= hight; ++i)
        ans = (ans + dp[s.size() - 1][i]) % mod;

    cout << ans - 1 << endl;
}

int main() {
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#endif

    int t;
    cin >> t;

    while(read())
        solve();

    return 0;
}


#define _USE_MATH_DEFINES

#include <iostream>
#include <cstdio>
#include <map>
#include <vector>
#include <set>
#include <string>
#include <list>
#include <cstdlib>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <stack>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>

using namespace std;

typedef long long li;
typedef long double ld;
typedef pair<int, int> pt;

#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
#define forn(i,n) for (int i = 0; i < int(n); ++i)
#define ft first
#define sc second

const int INF = 1e9;

string s;

bool read()
{
    return (cin >> s);
}

const int N = 230;

int dp[105][N];

void solve()
{
    forn (i, s.size())
        s[i] -= 'a' - 100;

    int low = 100, hight = 125;

    forn (i, 105)
        forn (j, N)
            dp[i][j] = 0;

    dp[0][s[0]] = 1;

    int mod = 1e9 + 7;
    forn (i, s.size() - 1)
    {
        forn (j, N)
        {
            if (dp[i][j] == 0)
                continue;

            for (int nj = low; nj <= hight; ++nj)
            {
                int del = j - nj;
                if (s[i + 1] + del < 0 || s[i + 1] + del >= N)
                    continue;
                dp[i + 1][s[i + 1] + del] = (dp[i + 1][s[i + 1] + del] + dp[i][j]) % mod;
            }
        }
    }

    int ans = 0;
    for (int i = low; i <= hight; ++i)
        ans = (ans + dp[s.size() - 1][i]) % mod;

    cout << ans - 1 << endl;
}

int main() {
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#endif

    int t;
    cin >> t;

    while(read())
        solve();

    return 0;
}


#define _USE_MATH_DEFINES

#include <iostream>
#include <cstdio>
#include <map>
#include <vector>
#include <set>
#include <string>
#include <list>
#include <cstdlib>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <stack>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>

using namespace std;

typedef long long li;
typedef long double ld;
typedef pair<int, int> pt;

#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
#define forn(i,n) for (int i = 0; i < int(n); ++i)
#define ft first
#define sc second

const int INF = 1e9;

string s;

bool read()
{
    return (cin >> s);
}

const int N = 3000;

int dp[105][N];

void solve()
{
    int sum = 0;
    forn (i, s.size())
        sum += s[i] - 'a' + 1;

    cout << dp[s.size()][sum] - 1 << endl;
}

int main() {
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#endif

    int t;
    cin >> t;

    int mod = 1e9 + 7;
    dp[0][0] = 1;
    for (int i = 1; i < 105; ++i)
        for (int j = i; j <= i * 26; ++j)
            for (int lt = 1; lt <= 26; ++lt)
                if (j - lt >= 0)
                    dp[i][j] = (dp[i][j] + dp[i - 1][j - lt]) % mod;

    while(read())
        solve();

    return 0;
}


#include<iostream>
using namespace std;
char a[5][5];
bool flag;
int main(){
    for(int i=1;i<=3;i++){
        for(int j=1;j<=3;j++){
            cin>>a[j][i];
        }
    }
    for(int i=1,j=3;i<=3;i++,j--){
        if(a[i][1]!=a[j][3]){
            flag=1;
        }
    }
    if(a[1][2]!=a[3][2]){
        flag=1;
    }
    if(flag){
        cout<<"NO"<<endl;
    }
    else{
        cout<<"YES"<<endl;
    }
//  system("pause");
    return 0;
}


#if 1
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <cassert>
#include <ctime>
#include <iostream>
#include <sstream>
#include <utility>

using namespace std;

typedef long long LL;
typedef long double LD;
typedef pair <int, int> pii;
typedef vector <int> veci;
typedef vector <veci> graph;
const LD pi = acos(- 1.0);
const LD eps = 1e-9;
const int inf = 1000 * 1000 * 1000;
const LL inf64 = LL(inf) * inf;

//template <class T> T xabs(const T &a) { if(a < 0) return -a; else return +a; }

#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define iss istringstream
#define oss ostringstream
#define dbg(x) {cerr << #x << " = " << x << endl;}
#define dbgv(x) {cerr << #x << " = {"; for (int _i = 0; _i < (x).size(); _i++) cerr << x[_i] << ", "; cerr << "}" << endl;}

int mod = 1e+9 + 7;
int main()
{
	int t;
	cin >> t;
	for (int q = 0; q < t; q++)
	{
		string a;
		cin >> a;
		int n = a.size();
		LL s = 0;
		for (int i = 0; i < n; i++)
			s += a[i] - 'a' + 1;
		vector <vector <LL>> dp(n + 1, vector <LL> (s + 1));
		dp[0][0] = 1;
		for (int i = 1; i <= n; i++)
		{
			for (int k = 1; k <= s; k++)
			{
				for (int j = 1; j <= 26; j++)
				{
					if (k >= j)
					{
						dp[i][k] += dp[i - 1][k - j];
						dp[i][k] %= mod;
					}
				}
			}
		}
		cout << dp[n][s] - 1 << endl;
	}
    return 0;
}
/********************

**********/
#endif


#if 1
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <cassert>
#include <ctime>
#include <iostream>
#include <sstream>
#include <utility>

using namespace std;

typedef long long LL;
typedef long double LD;
typedef pair <int, int> pii;
typedef vector <int> veci;
typedef vector <veci> graph;
const LD pi = acos(- 1.0);
const LD eps = 1e-9;
const int inf = 1000 * 1000 * 1000;
const LL inf64 = LL(inf) * inf;

//template <class T> T xabs(const T &a) { if(a < 0) return -a; else return +a; }

#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define iss istringstream
#define oss ostringstream
#define dbg(x) {cerr << #x << " = " << x << endl;}
#define dbgv(x) {cerr << #x << " = {"; for (int _i = 0; _i < (x).size(); _i++) cerr << x[_i] << ", "; cerr << "}" << endl;}

int mod = 1e+9 + 7;
int main()
{
	int t;
	cin >> t;
	int max_s = -1;
	vector <int> ss;
	vector <int> nn;
	int max_n = -1;
	for (int q = 0; q < t; q++)
	{
		string a;
		cin >> a;
		int n = a.size();
		LL s = 0;
		for (int i = 0; i < n; i++)
			s += a[i] - 'a' + 1;
		if (s > max_s)
			max_s = s;
		ss.pb(s);
		nn.pb(n);
		if (n > max_n)
			max_n = n;
	}
		vector <vector <LL> > dp(max_n + 1, vector <LL> (max_s + 1));
		dp[0][0] = 1;
		for (int i = 1; i <= max_n; i++)
		{
			for (int k = 1; k <= max_s; k++)
			{
				for (int j = 1; j <= 26; j++)
				{
					if (k >= j)
					{
						dp[i][k] += dp[i - 1][k - j];
						dp[i][k] %= mod;
					}
				}
			}
		}
		for (int i = 0; i < t; i++)
		{
			cout << dp[nn[i]][ss[i]] - 1 << endl;
		}
    return 0;
}
/********************

**********/
#endif


// compile with: /EHsc
#include <cassert>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <map>

using namespace std;

#define forn(i, n) for (int i = 0; i < (int)(n); i++)
#define mp make_pair
#define sz(a) (int)(a).size()
#define all(a) (a).begin(), (a).end()
#define BS_L(a, x, less) (lower_bound(all(a), x, less) - (a).begin())
#define BS_U(a, x, less) (upper_bound(all(a), x, less) - (a).begin())
#define LL long long
#define infl ((LL)((unsigned LL)-1L / 2))
#define infi ((int)((unsigned int)-1 / 2))
#define PII pair<int,int>
#define MOD 1000000007L
#define OSN 25

int test_count;
int l;
LL count;
char s[110];
LL vals[53];
LL n_vals[53];

LL dp[110][50000];

int main(int argc, char *argv[])
{
    dp[0][0] = 1;
    for (int i = 1; i <= 100; i ++)
        for (int j = 0; j <= (i - 1) * OSN; j++)
            for (int letter=0; letter <= OSN; letter++)
            {
                //printf("%d %d %d\n", i, j, letter);
                //if (i == 2 && j + letter == 24)
                //    printf("%d %d %d\n", i, j, letter);
                dp[i][j + letter] = (dp[i][j + letter] + dp[i-1][j]) % MOD;
            }

    scanf("%d\n", &test_count);
    for (int test=0; test < test_count; test++)
    {
        gets(s);
        int len = strlen(s);
        int height=0;
        //printf("%d %d\n", len, height);
        for (char *c = s; (*c) != 0; c++)
            height += (*c) - 'a';
        printf("%I64d\n", (dp[len][height] + MOD - 1L) % MOD);
    }
	return 0;
}


#define _CRT_SECURE_NO_DEPRECATE
//#define _AFX_SECURE_NO_DEPRECATE
//#define _ATL_SECURE_NO_DEPRECATE

#include <stdio.h>
#include <tchar.h>
#include <iostream>

//#include <math.h>
//#include <stdlib.h>
//#include <string.h>
//#include <vector>
//#include <set>
#include <map>
//#include <algorithm>
//#include <string>

#ifndef ONLINE_JUDGE
#include <time.h>
#include <assert.h>
#include "..\..\Common\define.h"
#include "..\..\Common\Timer.h"
#include "..\..\Common\Timer.cpp"
#else
#define assert(x)
#define C_ASSERT(a)
#define C_ASSERT_STR(a, b)
#endif

#ifndef PI
#define PI 3.1415926535897932384626433832795
#endif

using namespace std;

template<typename T> bool Eq(T a, T b, T eps=T(1e-10)) { return a > b-eps && a < b+eps; }
template<class T, class U> inline T& mmin(T& par1, U& par2) { if(par1<par2) return par1; else return par2; }
template<class T, class U> inline T& mmax(T& par1, U& par2) { if(par1<par2) return par2; else return par1; }

template<class T> struct sEraser {
	T* pCont;
	sEraser(T& Cont) { pCont = &Cont; }
	void operator() (typename T::value_type i) { pCont->erase(i); }
};
template<class T> sEraser<T> eraser(T& t) { return sEraser<T>(t); }

#define mfor_each(cont, func) for_each((cont).begin(), (cont).end(), func)

typedef long long LL;
typedef unsigned long long ULL;

//while (!cin.eof()) {
//	cin.getline(str, sizeof(str));

//for(;;)
//	cin>>ch;
//	if(cin.eof()) break;

#define NUM 1000000007

typedef map<int, LL> cache_t;
cache_t caches[128];

LL Solve(int n, int m) {
	if(n == 1) {
		if(m < 26)
			return 1;
		else
			return 0;
	}
	if(m > 25*n) {
		return 0;
	}

	cache_t::iterator cache_hit = caches[n].find(m);

	if(cache_hit != caches[n].end()) {
		return cache_hit->second;
	}
	int l = n/2;
	int r = n/2 + n%2;
	LL Res = 0;
	for(int i=max(0, m-25*r); i<=min(m, 25*l); i++) {
		Res += Solve(l, i)*Solve(r, m-i);
		Res %= NUM;
	}
	caches[n][m] = Res;
	return Res;
}

int _tmain(int argc, char* argv[]) {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	CTimer Timer;
#endif

	for(int i=0; i<10000; i++)
		Solve(100, 50*25+i-500);

	/*
	int k;
	cin>>k;
	for(int i=0; i<k; i++) {
		char str[129];
		cin>>str;
		int n=0,m=0;
		for(char* p = str; *p; p++) {
			n++;
			m += (*p-'a');
		}
		LL Res = Solve(n, m);
		Res = (Res+NUM-1)%NUM;
		cout<<Res<<endl;
	}
	//*/

#ifndef ONLINE_JUDGE
	COUT2(Timer.FormatTime(Timer.Stop()), "ms");
#endif
	return 0;
}


#define _CRT_SECURE_NO_DEPRECATE
//#define _AFX_SECURE_NO_DEPRECATE
//#define _ATL_SECURE_NO_DEPRECATE

#include <stdio.h>
#include <tchar.h>
#include <iostream>

//#include <math.h>
//#include <stdlib.h>
//#include <string.h>
//#include <vector>
//#include <set>
#include <map>
//#include <algorithm>
//#include <string>

#ifndef ONLINE_JUDGE
#include <time.h>
#include <assert.h>
#include "..\..\Common\define.h"
#include "..\..\Common\Timer.h"
#include "..\..\Common\Timer.cpp"
#else
#define assert(x)
#define C_ASSERT(a)
#define C_ASSERT_STR(a, b)
#endif

#ifndef PI
#define PI 3.1415926535897932384626433832795
#endif

using namespace std;

template<typename T> bool Eq(T a, T b, T eps=T(1e-10)) { return a > b-eps && a < b+eps; }
template<class T, class U> inline T& mmin(T& par1, U& par2) { if(par1<par2) return par1; else return par2; }
template<class T, class U> inline T& mmax(T& par1, U& par2) { if(par1<par2) return par2; else return par1; }

template<class T> struct sEraser {
	T* pCont;
	sEraser(T& Cont) { pCont = &Cont; }
	void operator() (typename T::value_type i) { pCont->erase(i); }
};
template<class T> sEraser<T> eraser(T& t) { return sEraser<T>(t); }

#define mfor_each(cont, func) for_each((cont).begin(), (cont).end(), func)

typedef long long LL;
typedef unsigned long long ULL;

//while (!cin.eof()) {
//	cin.getline(str, sizeof(str));

//for(;;)
//	cin>>ch;
//	if(cin.eof()) break;

#define NUM 1000000007
map<pair<int, int>, LL> cache;

LL Solve(int n, int m) {
	if(n == 1) {
		if(m < 26)
			return 1;
		else
			return 0;
	}
	if(m > 25*n) {
		return 0;
	}
	if(cache.find(make_pair(n, m)) != cache.end()) {
		return cache[make_pair(n, m)];
	}
	int l = n/2;
	int r = n/2 + n%2;
	LL Res = 0;
	for(int i=max(0, m-25*r); i<=min(m, 25*l); i++) {
		Res += Solve(l, i)*Solve(r, m-i);
		Res %= NUM;
	}
	cache[make_pair(n, m)] = Res;
	return Res;
}

int _tmain(int argc, char* argv[]) {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	CTimer Timer;
#endif

	int k;
	cin>>k;
	for(int i=0; i<k; i++) {
		char str[129];
		cin>>str;
		int n=0,m=0;
		for(char* p = str; *p; p++) {
			n++;
			m += (*p-'a');
		}
		LL Res = Solve(n, m);
		Res = (Res+NUM-1)%NUM;
		cout<<Res<<endl;
	}

#ifndef ONLINE_JUDGE
	COUT2(Timer.FormatTime(Timer.Stop()), "ms");
#endif
	return 0;
}


#define _CRT_SECURE_NO_DEPRECATE
//#define _AFX_SECURE_NO_DEPRECATE
//#define _ATL_SECURE_NO_DEPRECATE

#include <stdio.h>
#include <tchar.h>
#include <iostream>

//#include <math.h>
//#include <stdlib.h>
//#include <string.h>
//#include <vector>
//#include <set>
#include <map>
//#include <algorithm>
//#include <string>

#ifndef ONLINE_JUDGE
#include <time.h>
#include <assert.h>
#include "..\..\Common\define.h"
#include "..\..\Common\Timer.h"
#include "..\..\Common\Timer.cpp"
#else
#define assert(x)
#define C_ASSERT(a)
#define C_ASSERT_STR(a, b)
#endif

#ifndef PI
#define PI 3.1415926535897932384626433832795
#endif

using namespace std;

template<typename T> bool Eq(T a, T b, T eps=T(1e-10)) { return a > b-eps && a < b+eps; }
template<class T, class U> inline T& mmin(T& par1, U& par2) { if(par1<par2) return par1; else return par2; }
template<class T, class U> inline T& mmax(T& par1, U& par2) { if(par1<par2) return par2; else return par1; }

template<class T> struct sEraser {
	T* pCont;
	sEraser(T& Cont) { pCont = &Cont; }
	void operator() (typename T::value_type i) { pCont->erase(i); }
};
template<class T> sEraser<T> eraser(T& t) { return sEraser<T>(t); }

#define mfor_each(cont, func) for_each((cont).begin(), (cont).end(), func)

typedef long long LL;
typedef unsigned long long ULL;

//while (!cin.eof()) {
//	cin.getline(str, sizeof(str));

//for(;;)
//	cin>>ch;
//	if(cin.eof()) break;

#define NUM 1000000007

typedef map<int, LL> cache_t;
cache_t caches[128];

LL Solve(int n, int m) {
	if(n == 1) {
		if(m < 26)
			return 1;
		else
			return 0;
	}
	if(m > 25*n) {
		return 0;
	}

	cache_t::iterator cache_hit = caches[n].find(m);

	if(cache_hit != caches[n].end()) {
		return cache_hit->second;
	}
	int l = n/2;
	int r = n/2 + n%2;
	LL Res = 0;
	for(int i=max(0, m-25*r); i<=min(m, 25*l); i++) {
		Res += Solve(l, i)*Solve(r, m-i);
		Res %= NUM;
	}
	caches[n][m] = Res;
	return Res;
}

int _tmain(int argc, char* argv[]) {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	CTimer Timer;
#endif

	/*
	for(int i=0; i<10000; i++)
		Solve(100, 50*25+i-500);
	///*/

	//*
	int k;
	cin>>k;
	for(int i=0; i<k; i++) {
		char str[129];
		cin>>str;
		int n=0,m=0;
		for(char* p = str; *p; p++) {
			n++;
			m += (*p-'a');
		}
		LL Res = Solve(n, m);
		Res = (Res+NUM-1)%NUM;
		cout<<Res<<endl;
	}
	//*/

#ifndef ONLINE_JUDGE
	COUT2(Timer.FormatTime(Timer.Stop()), "ms");
#endif
	return 0;
}


#define _CRT_SECURE_NO_DEPRECATE
//#define _AFX_SECURE_NO_DEPRECATE
//#define _ATL_SECURE_NO_DEPRECATE

#include <stdio.h>
#include <tchar.h>
#include <iostream>

//#include <math.h>
//#include <stdlib.h>
//#include <string.h>
//#include <vector>
//#include <set>
#include <map>
//#include <algorithm>
//#include <string>

#ifndef ONLINE_JUDGE
#include <time.h>
#include <assert.h>
#include "..\..\Common\define.h"
#include "..\..\Common\Timer.h"
#include "..\..\Common\Timer.cpp"
#else
#define assert(x)
#define C_ASSERT(a)
#define C_ASSERT_STR(a, b)
#endif

#ifndef PI
#define PI 3.1415926535897932384626433832795
#endif

using namespace std;

template<typename T> bool Eq(T a, T b, T eps=T(1e-10)) { return a > b-eps && a < b+eps; }
template<class T, class U> inline T& mmin(T& par1, U& par2) { if(par1<par2) return par1; else return par2; }
template<class T, class U> inline T& mmax(T& par1, U& par2) { if(par1<par2) return par2; else return par1; }

template<class T> struct sEraser {
	T* pCont;
	sEraser(T& Cont) { pCont = &Cont; }
	void operator() (typename T::value_type i) { pCont->erase(i); }
};
template<class T> sEraser<T> eraser(T& t) { return sEraser<T>(t); }

#define mfor_each(cont, func) for_each((cont).begin(), (cont).end(), func)

typedef long long LL;
typedef unsigned long long ULL;

//while (!cin.eof()) {
//	cin.getline(str, sizeof(str));

//for(;;)
//	cin>>ch;
//	if(cin.eof()) break;

#define NUM 1000000007

//typedef map<int, LL> cache_t;
//cache_t caches[128];
LL cache[128][32*1024] = {0};

LL Solve(int n, int m) {
	if(n == 1) {
		if(m < 26)
			return 1;
		else
			return 0;
	}
	if(m > 25*n) {
		return 0;
	}

	/*
	cache_t::iterator cache_hit = caches[n].find(m);
	if(cache_hit != caches[n].end()) {
		return cache_hit->second;
	}
	*/
	if(cache[n][m])
		return cache[n][m];
	int l = n/2;
	int r = n/2 + n%2;
	LL Res = 0;
	for(int i=max(0, m-25*r); i<=min(m, 25*l); i++) {
		Res += Solve(l, i)*Solve(r, m-i);
		Res %= NUM;
	}
	/*
	caches[n][m] = Res;
	*/
	cache[n][m] = Res;
	return Res;
}

int _tmain(int argc, char* argv[]) {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	CTimer Timer;
#endif

	/*
	for(int i=0; i<10000; i++)
		Solve(100, 50*25+i-500);
	///*/

	//*
	int k;
	cin>>k;
	for(int i=0; i<k; i++) {
		char str[129];
		cin>>str;
		int n=0,m=0;
		for(char* p = str; *p; p++) {
			n++;
			m += (*p-'a');
		}
		LL Res = Solve(n, m);
		Res = (Res+NUM-1)%NUM;
		cout<<Res<<endl;
	}
	//*/

#ifndef ONLINE_JUDGE
	COUT2(Timer.FormatTime(Timer.Stop()), "ms");
#endif
	return 0;
}


#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<algorithm>
#include<cmath>
#include<set>
#include<queue>
#include<sstream>
#include<utility>

using std::pair;
using std::stringstream;
using std::next_permutation;
using std::sqrt;
using std::priority_queue;
using std::sort;
using std::stack;
using std::string;
using std::vector;
using std::cin;
using std::cout;
using std::endl;
using std::min;
using std::max;
using std::set;
using std::swap;
using std::random_shuffle;
using std::queue;
using std::sin;
using std::cos;
using std::make_pair;

typedef long long ll;
typedef pair<ll, ll> pll;
const double PI = 3.14159265358979323846;

struct ans {
	char c;
	int x;
};

int main() {
	int t;
	vector<vector<int> > data(110, vector<int> (2751, 0));
	int mod = 1000 * 1000 * 1000 + 7;
	for (int i = 0; i < 26; ++i)
		data[0][i] = 1;
	for (int i = 1; i < data.size(); ++i) {
		for (int j = 0; j <= 25 * (i + 1); ++j) {
			for (int k = 0; (k <= j) && (k < 26); ++k)
				data[i][j] = (data[i][j] + data[i - 1][j - k]) % mod;
		}
	}
	cin >> t;
	for (int i = 0; i < t; ++i) {
		string s;
		cin >> s;
		int sum = 0;
		for (int j = 0; j < s.size(); ++j)
			sum += s[j] - 'a';
		cout << data[s.size() - 1][sum] - 1 << endl;
	}
	return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#define STR string
#define V(T) vector <T>
#define QU(T) queue <T>
#define ST(T) stack <T>
#define SE(T) set <T>
#define MA(T, T1) map <T, T1>
#define P(T) pair <T, T>
#define PA(T, T1) pair <T, T1>
#define MPA make_pair

using namespace std;
typedef long long LONG;
typedef unsigned long long ULONG;

const int MOD = 1e9 + 7, MAXN = 101, ABC = 26;
int dyn[MAXN][MAXN * ABC];

int main() {
	for (int i = 0; i < ABC; i++) {
		dyn[1][i] = 1;
	}
	for (int i = 2; i < MAXN; i++) {
		for (int j = 0; j < MAXN * ABC; j++) {
			int a = min(j + 1, ABC);
			for (int k = 0; k < a; k++) {
				dyn[i][j] = (dyn[i][j] + dyn[i - 1][j - k]) % MOD;
			}
		}
	}
	int n;
	cin >> n;
	STR a;
	for (int i = 0; i < n; i++) {
		cin >> a;
		int b = 0;
		for (int j = 0; j < a.size(); j++) {
			b += a[j] - 'a';
		}
		cout << dyn[a.size()][b] - 1 << endl;
	}
	cin >> n;
}


                                        /* in the name of Allah */
#include <iostream>
#include <memory.h>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <map>

using namespace std;

#define int64 long long
#define Mod 1000000007
#define P pair<int, int>
#define B 30

int n;
char ch[200];
int64 dp[110][3000];

int64 mem(int len, int sum){
    if(len == 0)
        return (sum == 0 ? 1 : 0);
    if(dp[len][sum] != -1)
        return dp[len][sum];
    int64 &ref = dp[len][sum];
    ref = 0;
    for(int i = 0; i < 26; i++){
        ref += mem(len - 1, sum - i);
        if(ref >= Mod)
            ref -= Mod;
    }
    return ref;
}

int main(){
    string str;
    memset(dp, -1, sizeof dp);
    int T;
    for(cin >> T; T--; ){
        scanf("%s", &ch);
        n = strlen(ch);
        int sum = 0;
        for(int i = 0; i < n; i++)
            sum += ch[i] - 'a';
        int64 res = mem(n, sum);
        res = (res - 1 + Mod) % Mod;
        cout << res << endl;
    }
    return 0;
}


#include <stdlib.h>
#include <time.h>
#include <vector>
#include <math.h>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <fstream>
#include <string>
#include <string.h>
#include <map>
#include <stack>
#include <queue>
#include <utility>
#include <set>
#include <bitset>

#include <time.h>

using namespace std;

const int M=100+10;

typedef long long int ll;

ll dp[M][26*M];

ll MOD=1000000000+7;

ll dfs(int slen, int ssum)
{
	if (dp[slen][ssum]!=-1)
	{
		return dp[slen][ssum];
	}

	if (slen==0)
	{
		return ssum==0;
	}

	ll ans=0;
	for (int p=0; p<26; p++)
	{
		int res=ssum-p;
		if (res>=0)
		{
			ans=ans+dfs(slen-1,res);
			ans=ans%MOD;
		}
	}
	return dp[slen][ssum]=ans;
}

int main()
{
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);

	time_t t_start,t_end;
	t_start=clock();

	for (int i=0; i<M; i++)
	{
		for (int j=0; j<26*M; j++)
		{
			dp[i][j]=-1;
		}
	}

	int t;
	cin>>t;
	for (int i=0; i<t; i++)
	{
		string s;
		cin>>s;
		int slen=s.length();
		int ssum=0;
		for (int j=0; j<slen; j++)
		{
			ssum=ssum+s[j]-'a';
		}

		ll ans=dfs(slen, ssum);
		ans--;
		if (ans<0)
		{
			ans+=MOD;
		}
		cout<<ans<<endl;

	}

	t_end=clock();
	//printf("%.10f\n", (double)(t_end-t_start)/CLOCKS_PER_SEC );

	return 0;

}


#include <iostream>
#include <vector>
#include <set>
#include <string>

using namespace std;

const int mod = 1000 * 1000 * 1000 + 7;

int dp[110][2700];

int main() {
	//freopen("input.txt", "r", stdin);
	for(int i = 1; i <= 26; i ++)
		dp[1][i] = 1;
	for(int len = 1; len < 100; len ++) {
		for(int sum = 1; sum < 2650; sum ++) {
			for(int k = 1; k <= 26; k ++) {
				dp[len + 1][sum + k] += dp[len][sum];
				dp[len + 1][sum + k] %= mod;
			}
		}
	}
	int n;
	cin >> n;
	for(int i = 0; i < n; i ++) {
		string s;
		cin >> s;
		int sum = 0;
		for(int j = 0; j < s.size(); j ++)
			sum += (s[j] - 'a' + 1);
		cout << (dp[s.size()][sum] - 1 + mod) % mod << endl;
	}
	return 0;
}


#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cstring>
#include <string>
#include <iostream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>
#include <numeric>

using namespace std;

int nextInt() {
	int x;
	scanf("%d", &x);
	return x;
}

const int BUFSIZE = 10000;
char buf[BUFSIZE + 1];
string nextString() {
	scanf("%s", buf);
	return buf;
}

const int MOD = 1e9 + 7;

void add(int &x, int y) {
	x += y;
	while (x >= MOD) {
		x -= MOD;
	}
}

const int N = 100;
int F[N * 25 + 1][N + 1];

int main() {
	for (int s = 0; s <= 25; ++s) {
		F[s][1] = 1;
	}
	for (int len = 2; len <= N; ++len) {
		for (int s = 0; s <= len * 25; ++s) {
			F[s][len] = 0;
			for (int t = 0; t <= 25 && t <= s; ++t) {
				add(F[s][len], F[s - t][len - 1]);
			}
		}
	}
	int q = nextInt();
	while (q--) {
		string s = nextString();
		int sum = 0;
		for (int i = 0; i < s.size(); ++i) {
			sum += s[i] - 'a';
		}
		cout << (F[sum][s.size()] + MOD - 1) % MOD << endl;
	}
	return 0;
}


#include <iostream>
#include <cstring>
#include <algorithm>
#define MOD 1000000007
using namespace std;
int M[105][2505],T,t;
int i,j,k,s,rez,n;
char C[105];
int main()
{
	for(i=0;i<=25;i++)
		M[1][i]=1;

	for(i=2;i<=100;i++)
		for(j=0;j<=2500;j++)
			for(k=0;k<=min(j,25);k++)
				M[i][j]=(M[i][j]+M[i-1][j-k])%MOD;
	cin>>T;
	cin.getline(C,100);
	for(t=1;t<=T;t++)
	{
		cin.getline(C,101);
		n=strlen(C);
		s=0;
		for(i=0;i<n;i++)
			s+=(C[i]-'a');
		cout<<(M[n][s]+MOD-1)%MOD<<"\n";
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <utility>
#include <string>

using namespace std;
int d[101][2601];

int main()
{
	d[0][0] = 1;
	for( int i = 1; i <= 100; ++i )
		for( int j = 0; j <= 2600; ++j )
			for( int z = 0; z < 26; ++z )
				if( j - z >= 0 )
				{
					d[i][j] += d[i-1][j-z];
					d[i][j] %= 1000000007;
				}
	int n;
	scanf( "%d", &n );
	for( int i = 0; i < n; ++i )
	{
		string s;
		cin >> s;
		int sum = 0;
		for( int j = 0; j < s.size(); ++j )
		{
			sum += s[j] - 'a';
		}

		printf( "%d\n", d[s.size()][sum] - 1 );
	}
	return 0;
}


//
//  main.cpp
//  cf_29_02-c
//
//  Created by Andriy Medvid' on 2/29/12.
//  Copyright (c) 2012 hellowebapps.com. All rights reserved.
//

#include <cstdio>
#include <string.h>

char strMas[10010][102];
int results[101][2510], sums[101], len[101];
int main ()
{
    int n;
    scanf("%d", &n);
    for(int i = 0; i < n; i++)
    {
        scanf("%s", &strMas[i]);
        sums[i] = 0;
        len[i] = strlen(strMas[i]);
        for(int j = 0; strMas[i][j]; j++)
            sums[i] += strMas[i][j] - 'a';
    }
    for(int i = 0; i < 101; i++)
        for(int j = 0; j <= 2500; j++)
            results[i][j] = 0;
    results[0][0] = 1;
    for(int i = 1; i <= 100; i++)
        for(int j = 0; j <= 25*i; j++)
            for(int k = 0; k <= 25; k++)
            {
                if(k <= j)
                {
                    results[i][j] += results[i-1][j-k];
                    results[i][j] %= 1000000007;
                }
            }
    for(int i = 0; i < n; i++)
    {
        printf("%d\n", (results[len[i]][sums[i]] + 1000000006) % 1000000007);
    }
    return 0;
}


//
//  main.cpp
//  cf_29_02-c
//
//  Created by Andriy Medvid' on 2/29/12.
//  Copyright (c) 2012 hellowebapps.com. All rights reserved.
//

#include <cstdio>
#include <string.h>

char strMas[10010][102];
int results[101][2510], sums[10010], len[10010];
int main ()
{
    int n;
    scanf("%d", &n);
    for(int i = 0; i < n; i++)
    {
        scanf("%s", &strMas[i]);
        sums[i] = 0;
        len[i] = strlen(strMas[i]);
        for(int j = 0; strMas[i][j]; j++)
            sums[i] += strMas[i][j] - 'a';
    }
    for(int i = 0; i < 101; i++)
        for(int j = 0; j <= 2500; j++)
            results[i][j] = 0;
    results[0][0] = 1;
    for(int i = 1; i <= 100; i++)
        for(int j = 0; j <= 25*i; j++)
            for(int k = 0; k <= 25; k++)
            {
                if(k <= j)
                {
                    results[i][j] += results[i-1][j-k];
                    results[i][j] %= 1000000007;
                }
            }
    for(int i = 0; i < n; i++)
    {
        printf("%d\n", (results[len[i]][sums[i]] + 1000000006) % 1000000007);
    }
    return 0;
}


#include<iostream>
#include<string>
#include<algorithm>
#include<queue>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<vector>
#include<iomanip>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<cstdio>
#include<ctime>

using namespace std;
int n,m,ans,dp[100][2561],t;
char s[100];
int const M=1e9+7;
int main()
{
    scanf("%d",&t);
    for(int i=0;i<26;++i)
        dp[0][i]=1;
    for(int i=0;i<99;++i)
        for(int j=0;j<2501;++j)
            for(int k=0;k<26;++k)
                dp[i+1][j+k]=(dp[i][j]%M+dp[i+1][j+k]%M)%M;
    for(int q=0;q<t;++q)
    {
        scanf("%s",&s);
        n=strlen(s);
        int f=0;
        for(int i=0;i<n;++i)
            f+=(int)s[i]-97;
        printf("%d\n",dp[n-1][f]-1);
    }
    return 0;
}


#include <iostream>
#include <fstream>
#define _USE_MATH_DEFINES
#include <math.h>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
const int mod=1000000007;
string s;
long long a[100][2700]={0};
long long work(int l, int sum)
{
	if (sum<0) return 0;
	if (sum>l*25) return 0;
	if (l==0) return 1;
	if (a[l][sum]!=-1) return a[l][sum];
	long long sm=0;
	for (int i=0;i<26;i++)
		sm=(sm+work(l-1,sum-i))%mod;
	a[l][sum]=sm;
	return sm;
}
void main()
{
	//ifstream cin("input.txt");
	int n;
	cin>>n;
	memset(a,-1,sizeof a);
	for (int j=0;j<=100;j++)
		for (int i=0;i<=2500;i++)
			work(j,i);
	for (int i=0;i<n;i++)
	{
		string s;
		cin>>s;
		int q=0;
		for (int i=0;i<s.length();i++)
			q+=int(s[i]-'a');
		long long res=work(s.length(),q)-1;
		if (res<0) res+=mod;
		cout<<res<<endl;
	}
}


#include <iostream>
#include <fstream>
#define _USE_MATH_DEFINES
#include <math.h>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
const int mod=1000000007;
string s;
long long a[200][27][27]={0};
long long work(int p)
{
	if (p>=s.length()-1)
		return 1;
	char c=s[p],c2=s[p+1];
	while (s[p]!='a'&&s[p+1]!='z')
	{
		s[p]--;
		s[p+1]++;
	}
	long long sum=0;
	while (true)
	{
		if (a[p][s[p]-'a'][s[p+1]-'a']==-1)
			a[p][s[p]-'a'][s[p+1]-'a']=work(p+1);
		sum=(sum+a[p][s[p]-'a'][s[p+1]-'a'])%mod;
		if (s[p]!='z'&&s[p+1]!='a')
		{
			s[p]++;
			s[p+1]--;
		}
		else
			break;
	}
	s[p]=c;
	s[p+1]=c2;
	return sum;
}
void main()
{
	//ifstream cin("input.txt");
	int n;
	cin>>n;
	for (int i=0;i<n;i++)
	{
		cin>>s;
		memset(a,-1,sizeof(a));
		long long res=work(0);
		res--;
		if (res<0) res+=mod;
		cout<<res<<endl;
	}
}


#include <iostream>
#include <fstream>
#define _USE_MATH_DEFINES
#include <math.h>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
const int mod=1000000007;
string s;
long long a[200][2700]={0};
long long work(int l, int sum)
{
	if (sum<0) return 0;
	if (sum>l*25) return 0;
	if (l==0) return 1;
	if (a[l][sum]!=-1) return a[l][sum];
	long long sm=0;
	for (int i=0;i<26;i++)
		sm=(sm+work(l-1,sum-i))%mod;
	a[l][sum]=sm;
	return sm;
}
void main()
{
	//ifstream cin("input.txt");
	int n;
	cin>>n;
	memset(a,-1,sizeof a);
	for (int j=0;j<=100;j++)
		for (int i=0;i<=2500;i++)
			work(j,i);
	for (int i=0;i<n;i++)
	{
		string s;
		cin>>s;
		int q=0;
		for (int i=0;i<s.length();i++)
			q+=int(s[i]-'a');
		long long res=work(s.length(),q)-1;
		if (res<0) res+=mod;
		cout<<res<<endl;
	}
}


#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#include<cctype>
#define INF 1000000007
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
using namespace std;
int t;
char str[110];
int sum;
__int64 dp[2610][110]={0};
int main(){
    for(int i=0;i<26;i++){
        dp[i][1]=1;
    }
    for(int i=2;i<=100;i++){
        dp[0][i]=dp[i*25][i]=1;
        for(int j=1;j<i*25;j++){
            for(int k=0;k<26&&j>=k;k++){
                dp[j][i]=(dp[j][i]+dp[j-k][i-1])%INF;
            }
        }
    }
    scanf("%d",&t);
    while(t--){
        scanf("%s",str);
        int l=strlen(str);
        sum=0;
        for(int i=0;i<l;i++){
            sum+=str[i]-'a';
        }
        printf("%I64d\n",(dp[sum][l]-1+INF)%INF);
    }
}


#include <cstdio>

const int LIT='z'-'a';
const int MAXLEN=100, MAXSUM=LIT*MAXLEN, MOD=1000000007;
int dp[MAXLEN+1][MAXSUM+1]={0};
char str[MAXLEN+1];

int main()
{
    int i, j, s, t, T;
    dp[0][0]=1;
    for(i=1; i<=MAXLEN; ++i)
        for(s=0; s<=MAXSUM; ++s)
            for(j=0; j<=s && j<=LIT; ++j)
            {
                dp[i][s]+=dp[i-1][s-j];
                if(dp[i][s]>=MOD)
                    dp[i][s]-=MOD;
            }
    scanf("%d", &T);
    for(t=0; t<T; ++t)
    {
        scanf("%s", str);
        for(s=i=0; str[i]; s+=str[i]-'a', ++i);
        printf("%d\n", (dp[i][s]-1+MOD)%MOD);
    }
    return 0;
}


#include <stdio.h>
#include <string.h>
const int maxn = 1000;
const int mod = 1e9 + 7;

char a[maxn];
int col[maxn * 30];
void solve(){
	gets(a);
	int n = strlen(a), s = 0,q;
	for(int i = 0; i < n; i ++) s += a[i] - 'a';
	memset(col, 0, sizeof col);
	col[0] = 1;
	for(int i = 1; i <= n; i ++){
		q = 25 * i;
		if(q > s) q = s;
		for(int j = q; j > 0; j --){
			for(int c = 1; c < 26 && j - c >= 0; c ++){
				col[j] += col[j - c];
				col[j] %= mod;
			}
		}
	}
	printf("%d\n",(col[s] + mod - 1) % mod);
}
int main(){
	int t;
	scanf("%d\n",&t);
	while(t --) solve();
}


#include <stdio.h>
#include <string.h>
const int maxn = 1000;
const int mod = 1e9 + 7;

char a[maxn];
int col[maxn << 5];
int sum[maxn << 5];
void solve(){
	gets(a);
	int n = strlen(a), s = 0,q;
	for(int i = 0; i < n; i ++) s += a[i] - 'a';
	memset(col, 0, sizeof col);
	col[0] = 1;
	for(int i = 1; i <= n; i ++){
		q = 25 * i;
		if(q > s) q = s;
		sum[0] = col[0];
		for(int j = 1; j <= q; j ++) sum[j] = (sum[j - 1] + col[j]) % mod;
		for(int j = q; j > 0; j --){
			if(j >= 26) col[j] = (sum[j] - sum[j - 26] + mod) % mod;
			else col[j] = sum[j];
		}
	}
	printf("%d\n",(col[s] + mod - 1) % mod);
}
int main(){
	int t;
	scanf("%d\n",&t);
	while(t --) solve();
}


#include <stdio.h>
#include <string.h>
const int maxn = 1000;
const int mod = 1e9 + 7;

char a[maxn];
int col[maxn];
void solve(){
	gets(a);
	int n = strlen(a), s = 0,q;
	for(int i = 0; i < n; i ++) s += a[i] - 'a';
	memset(col, 0, sizeof col);
	col[0] = 1;
	for(int i = 1; i <= n; i ++){
		q = 25 * i;
		if(q > s) q = s;
		for(int j = q; j > 0; j --){
			for(int c = 1; c < 26 && j - c >= 0; c ++){
				col[j] += col[j - c];
				col[j] %= mod;
			}
		}
	}
	printf("%d\n",(col[s] + mod - 1) % mod);
}
int main(){
	int t;
	scanf("%d\n",&t);
	while(t --) solve();
}


#include <stdio.h>
#include <string.h>
const int mod = 1e9 + 7;

char a[101];
int col[3000];
int sum[3000];
int res[102][3000];
void solve(){
//	gets(a);
	int q;
	col[0] = 1;
	for(int i = 1; i <= 100; i ++){
		q = 25 * i;
		sum[0] = col[0];
		for(int j = 1; j <= q; j ++) sum[j] = (sum[j - 1] + col[j]) % mod;
		for(int j = q; j > 0; j --){
			if(j >= 26) col[j] = (sum[j] - sum[j - 26] + mod) % mod;
			else col[j] = sum[j];
		}
		for(int j = 0; j <= q; j ++) res[i][j] = col[j];
	}
}
int main(){
	int t;
	solve();
	scanf("%d\n",&t);
	while(t --){
		gets(a);
		int n = strlen(a), s = 0;
		for(int i = 0; i < n; i ++) s += a[i] - 'a';
		printf("%d\n", (res[n][s] - 1 + mod) % mod);
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <utility>
#include <string>

using namespace std;
int total[101][2501];

int main()
{
	int i, j, k, t, len, sum;
	total[0][0] = 1;
	for(i=1; i<101; i++)
	{
		for(j=0; j<2501; j++)
		{
			for(k=0; k<26; k++)
			{
				if(j-k >= 0)
				{
					total[i][j] += total[i-1][j-k];
					total[i][j] %= 1000000007;
				}
			}
		}
	}

	string str;
	cin >> t;
	for(i=0; i<t; i++)
	{

		cin >> str;
		len = str.length();
		sum = 0;
		for(j=0; j<len; j++)
		{
			sum += (int)str[j] - (int)'a';
		}
		cout << total[len][sum] - 1 << endl;
	}
	return 0;
}


#include <algorithm>
#include <functional>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <cassert>
#include <bitset>
#include <map>

using namespace std;

//from Ilya_MSU's solution

int main() {
	int t;
	vector<vector<int> > data(110, vector<int> (2751, 0));
	int mod = 1000 * 1000 * 1000 + 7;
	for (int i = 0; i < 26; ++i)
		data[0][i] = 1;
	for (int i = 1; i < data.size(); ++i) {
		for (int j = 0; j <= 25 * (i + 1); ++j) {
			for (int k = 0; (k <= j) && (k < 26); ++k)
				data[i][j] = (data[i][j] + data[i - 1][j - k]) % mod;
		}
	}
	cin >> t;
	for (int i = 0; i < t; ++i) {
		string s;
		cin >> s;
		int sum = 0;
		for (int j = 0; j < s.size(); ++j)
			sum += s[j] - 'a';
		cout << data[s.size() - 1][sum] - 1 << endl;
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <string>
using namespace std;

int main(void)
{
	const size_t word_length = 100;
	const size_t letters_sum = 25 * word_length;

	vector<vector<size_t>> s(word_length+1, vector<size_t>(letters_sum+1, 0));
	s[0][0] = 1;

	for(size_t l=1; l<=word_length; ++l)
	{
		for(size_t ss=0; ss<=letters_sum; ++ss)
		{
			size_t start = (ss>25 ? ss-25 : 0);
			for(size_t i=start; i<=ss; ++i)
			{
				s[l][ss] += s[l-1][i];
				s[l][ss] %= 1000000007;
			}
		}
	}

	size_t n=0;
	cin >> n;
	for(size_t u=0; u<n; ++u)
	{
		if(u)
			cout << endl;
		string a = "";
		cin >> a;
		size_t cur_l = a.length();
		size_t sum = 0;
		for(size_t i=0; i<cur_l; ++i)
		{
			sum += (a[i] - 'a');
		}
		cout << (s[cur_l][sum] - 1);
	}
	return 0;
}


// (.Y.)™

#define _USE_MATH_DEFINES

#include <cmath>
#include <cstdio>
#include <climits>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

#define ui  unsigned           int
#define  ll          long long int
#define ull unsigned long long int

#define pii pair <int, int>

#define mp make_pair
#define pb push_back

#define ret return

#define all(x) x.begin(), x.end()

#define DEBUG(x) cout << #x << ": " << (x) << endl

#define MOD 1000000007

int  tab[110][2510];
bool was[110][2510];

int f(int l, int s) {
    if ( l == 0 )
        ret( s == 0 ? 1 : 0);

    if ( was[l][s] )
        goto exit;

    int res = 0;

    for (int i = 0; i <= 25; i++) {
        if ( s-i < 0 )
            break;

        res += f(l-1, s-i);
        res %= MOD;
    }

    tab[l][s] = res;
    was[l][s] = true;

exit:
    ret(tab[l][s]);
}

int main() {
#ifndef ONLINE_JUDGE
    freopen( "input.txt", "rt", stdin );
    //freopen("output.txt", "wt", stdout);
#endif

    int t;
    scanf("%d\n", &t);

    for (int i = 0; i < t; i++) {
        char s[110];
        scanf("%s\n", s);

        int S = 0;

        int len = strlen(s);

        for (int i = 0; i < len; i++)
            S += s[i]-'a';

        printf("%d\n", f(len, S)-1);
    }

#ifndef ONLINE_JUDGE
    printf("\n>>> Time of execution %.3f seconds <<<\n", (double)clock() / CLOCKS_PER_SEC);
#endif

    ret(0);
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <set>

using namespace std;

const int maxL = 200;
const int maxS = maxL*25;
const int alpha = 26;
const int MOD = 1000000000 + 7;
int d[maxL][maxS];

int main()
{
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	int t;
	cin >> t;
	for (int it = 0; it < t; ++it)
	{
		string s;
		cin >> s;
		int SUM = 0;
		for (int i = 0; i < s.size(); ++i)
			SUM += s[i] - 'a';
		for (int len = 0; len <= s.size(); ++len)
			for (int sum = 0; sum <= SUM; ++sum)
				d[len][sum] = 0;
		for (int sum = 0; sum < alpha; ++sum)
			d[1][sum] = 1;
		for (int len = 2; len <= s.size(); ++len)
			for (int sum = 0; sum <= SUM; ++sum)
				for (int i = 0; i < alpha; ++i)
					d[len][sum] = (d[len][sum] + d[len - 1][sum - i]) % MOD;
		cout << d[s.size()][SUM] - 1 << endl;
	}

	return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <set>

using namespace std;

const int maxL = 200;
const int maxS = maxL*25;
const int alpha = 26;
const int MOD = 1000000000 + 7;
int d[maxL][maxS];

int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int t;
	cin >> t;
	for (int it = 0; it < t; ++it)
	{
		string s;
		cin >> s;
		int SUM = 0;
		for (int i = 0; i < s.size(); ++i)
			SUM += s[i] - 'a';
		for (int len = 0; len <= s.size(); ++len)
			for (int sum = 0; sum <= SUM; ++sum)
				d[len][sum] = 0;
		for (int sum = 0; sum < alpha; ++sum)
			d[1][sum] = 1;
		for (int len = 2; len <= s.size(); ++len)
			for (int sum = 0; sum <= SUM; ++sum)
				for (int i = 0; i < alpha; ++i)
					d[len][sum] = (d[len][sum] + d[len - 1][sum - i]) % MOD;
		cout << d[s.size()][SUM] - 1 << endl;
	}

	return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <set>

using namespace std;

const int maxL = 100 + 5;
const int maxS = maxL*25;
const int alpha = 26;
const int MOD = 1000000000 + 7;
int d[maxL][maxS];

int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	for (int len = 0; len <= maxL; ++len)
			for (int sum = 0; sum <= maxS; ++sum)
				d[len][sum] = 0;
		for (int sum = 0; sum < alpha; ++sum)
			d[1][sum] = 1;
		for (int len = 2; len <= maxL; ++len)
			for (int sum = 0; sum <= maxS; ++sum)
				for (int i = 0; i < alpha; ++i)
					d[len][sum] = (d[len][sum] + d[len - 1][sum - i]) % MOD;
	int t;
	cin >> t;
	for (int it = 0; it < t; ++it)
	{
		string s;
		cin >> s;
		int SUM = 0;
		for (int i = 0; i < s.size(); ++i)
			SUM += s[i] - 'a';
		cout << d[s.size()][SUM] - 1 << endl;
	}

	return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <set>

using namespace std;

const int maxL = 100 + 5;
const int maxS = maxL*25 + 5;
const int alpha = 26;
const int MOD = 1000000000 + 7;
int d[maxL][maxS];

int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	for (int len = 0; len < maxL; ++len)
			for (int sum = 0; sum < maxS; ++sum)
				d[len][sum] = 0;
		for (int sum = 0; sum < alpha; ++sum)
			d[1][sum] = 1;
		for (int len = 2; len < maxL; ++len)
			for (int sum = 0; sum < maxS; ++sum)
				for (int i = 0; i < alpha; ++i)
					if (i <= sum)
					   d[len][sum] = (d[len][sum] + d[len - 1][sum - i]) % MOD;
	int t;
	cin >> t;
	for (int it = 0; it < t; ++it)
	{
		string s;
		cin >> s;
		int SUM = 0;
		for (int i = 0; i < s.size(); ++i)
			SUM += s[i] - 'a';
		cout << max(d[s.size()][SUM] - 1, 0) << endl;
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,a[100],i,k;
	cin>>n;
	int s=0;
	for(i=0;i<n;i++)
	{cin>>a[i]; s=s+a[i];}
	int temp=s;
	for(i=0;i<n;i++)
	{
		if(temp<s/2)
		{
		  break;
		}
		else
		{ temp=temp-a[i];
		}
	}cout<<i;
	return 0 ;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long int n,a[100000],i,k;
	cin>>n;
	long long int s=0;
	for(i=0;i<n;i++)
	{cin>>a[i]; s=s+a[i];}
	long long int temp=s,t=0;
	for(i=0;i<n;i++)
	{
		if(2*temp>=(s+1))
		{
		  temp=temp-a[i];t++;		}
		else
		{
			break;
		}
	}cout<<t;
	return 0 ;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long int n,a[100000],i,k;
	cin>>n;
	long long int s=0;
	for(i=0;i<n;i++)
	{cin>>a[i]; s=s+a[i];}
	long long int temp=0,t=0;
	for(i=0;i<n;i++)
	{
        temp=temp+a[i];
        if(2*temp>=(s))
            break;

	}cout<<i;
	return 0 ;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long int n,a[100000],i,k;
	cin>>n;
	long long int s=0;
	for(i=0;i<n;i++)
	{cin>>a[i]; s=s+a[i];}
	long long int temp=s,t=0;
	for(i=0;i<n;i++)
	{
		/*if(temp=s/2)
		{
		  temp=temp-a[i];t++;		}
		else */ if(temp>s/2)
		{
		  temp=temp-a[i];t++;		}
		else
		{
			break;
		}
	}cout<<t;
	return 0 ;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,a[100000],i,k;
	cin>>n;
	int s=0;
	for(i=0;i<n;i++)
	{cin>>a[i]; s=s+a[i];}
	int temp=s,t=0;
	for(i=0;i<n;i++)
	{
		/*if(temp=s/2)
		{
		  temp=temp-a[i];t++;		}
		else */ if(temp>s/2)
		{
		  temp=temp-a[i];t++;		}
		else
		{
			break;
		}
	}cout<<t;
	return 0 ;
}


#include<bits/stdc++.h>
using namespace std;
{
	int n,a[100],i,k;
	cin>>n;
	int s=0;
	for(i=0;i<n;i++)
	{cin>>a[i]; s=s+a[i];}
	int temp=s;
	for(i=0;i<n;i++)
	{
		if(temp<s/2)
		{
		  break;
		}
		else
		{ temp=temp-a[i];
		}
	}cout<<i;
	return 0 ;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long int n,a[100000],i,k;
	cin>>n;
	long long int s=0;
	for(i=0;i<n;i++)
	{cin>>a[i]; s=s+a[i];}
	long long int temp=0,t=0;
	for(i=0;i<n;i++)
	{
        temp=temp+a[i];
        if(2*temp>=(s))
            break;

	}cout<<i+1;
	return 0 ;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,a[100],i,k;
	cin>>n;
	int s=0;
	for(i=0;i<n;i++)
	{cin>>a[i]; s=s+a[i];}
	int temp=s;
	for(i=0;i<n;i++)
	{
		if(temp<s/2)
		{
		  break;
		}
		else
		{ temp=temp-a[i];
		}
	}cout<<i-1;
	return 0 ;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long int n,a[400000],i,k;
	cin>>n;
	long long int s=0;
	for(i=0;i<n;i++)
	{cin>>a[i]; s=s+a[i];}
	long long int temp=0,t=0;
	for(i=0;i<n;i++)
	{
        temp=temp+a[i];
        if(2*temp>=(s))
            break;

	}cout<<i+1;
	return 0 ;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long int n,a[100000],i,k;
	cin>>n;
	long long int s=0;
	for(i=0;i<n;i++)
	{cin>>a[i]; s=s+a[i];}
	long long int temp=0,t=0;
	for(i=0;i<n;i++)
	{
        temp=temp+a[i];
        if(2*temp>=(s+1))
            break;

	}cout<<i;
	return 0 ;
}


#include <iostream>
using namespace std;

int main() {
	int a=0,arr[10000],s=0,i,t,j=0;
	scanf("%d",&t);
	for(i=0;i<t;t++)
	{
		scanf("%d",&arr[i]);
		s=s+arr[i];
	}
	a=s;
	//printf("%d",s);
	for(i=0;i<t;i++)
	{if(a!=s/2)
		{
			a=a-arr[i];
			j++;
		}
	}
	printf("%d",j);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long int n,a[100000],i,k;
	cin>>n;
	long long int s=0;
	for(i=0;i<n;i++)
	{cin>>a[i]; s=s+a[i];}
	long long int temp=s,t=0;
	for(i=0;i<n;i++)
	{
		if(temp*2>=s)
		{
		  temp=temp-a[i];t++;		}
		else
		{
			break;
		}
	}cout<<t;
	return 0 ;
}


#include <iostream>

using namespace std;

long long p[200001], n;

int main() {
    cin >> n;
    for(int i = 1; i <= n; i++) {
        cin >> p[i];
        p[i] += p[i-1];
    }
    for(int i = 1; i <= n; i++) {
        if(p[i] >= (p[n]+1)/2) {
            cout << i << endl;
            return 0;
        }
    }
}


#include <iostream>

using namespace std;

int main()
{
    int n,i,sum = 0,sam = 0,c = 0;
    cin>>n;
    int a[n];
    for(i=1;i<=n;i++){
        cin>>a[i];
        sum+=a[i];
    }
    for(i=1;i<=n;i++){
        sam+=a[i];
        c++;
        if(c==n){
            return -1;
        }
        if(sam>=sum/2){
            cout<<c;
            return 0;
        }
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n,i,sum = 0,sam = 0,c = 0;
    cin>>n;
    int a[n];
    for(i=1;i<=n;i++){
        cin>>a[i];
        sum+=a[i];
    }
    for(i=1;i<=n;i++){
        sam+=a[i];
        c++;
        if(sam>=sum/2){
            cout<<c;
            return 0;
        }
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n;
    int i;
    float sum = 0,sam = 0,c = 0;
    cin>>n;
    float a[n];
    for(i=1;i<=n;i++){
        cin>>a[i];
        sum+=a[i];
    }
    cout<<sum/2;
    for(i=1;i<=n;i++){
        sam+=a[i];
        c++;
        if(sam>=sum/2){
            cout<<c;
            return 0;
        }
    }
    return 0;
}


#include <iostream>

using namespace std;

int main() {
    int n;
    cin >> n;
    long long p[n];
    for(int i = 1; i <= n; i++) {
        cin >> p[i];
        p[i] += p[i-1];
    }
    for(int i = 1; i <= n; i++) {
        if(p[i] >= (p[n]+1)/2) {
            cout << i << endl;
            return 0;
        }
    }
}


#include<iostream>
using namespace std;
int main(){

	int k=0, s=0, n;

	cin>>n;

	int a[n];

	for(int i=1; i<=n; i++){
		cin>>a[i];
		s=s+a[i];

			}

		for(int i=1; i<=n; i++){

			k=k+a[i];
			 if (k=s/2 || k>s/2)  {break;}
			   }

			cout<<k;

}


#include<iostream>
using namespace std;
int main(){

	int k=0, s=0, n, j;

	cin>>n;

	int a[n];

	for(int i=1; i<=n; i++){
		cin>>a[i];
		s=s+a[i];

			}

		for( j=1; j<=n; j++){

			k=k+a[j];

			 if (k==s/2+s%2 || k>s/2+s%2)  {break;}
			   }

			cout<<j;

}


#include<iostream>
using namespace std;
int main(){

	int k=0, s=0, n, j;

	cin>>n;

	int a[n];

	for(int i=1; i<=n; i++){
		cin>>a[i];
		s=s+a[i];

			}

		for( j=1; j<=n; j++){

			k=k+a[j];

			 if (k==s/2 || k>s/2)  {break;}
			   }

			cout<<j;

}


#include<iostream>
using namespace std;
int main(){

	int k=0, s=0, n;

	cin>>n;

	int a[n];

	for(int i=1; i<=n; i++){
		cin>>a[i];
		s=s+a[i];

			}

	while(k<s){

		for(int i=1; i<=n; i++){
k=k+a[i];

			}

			   }

		cout<<k

}


#include<iostream>
using namespace std;
int main(){

	int k=0, s=0, n;

	cin>>n;

	int a[n];

	for(int i=1; i<=n; i++){
		cin>>a[i];
		s=s+a[i];

			}

	while(k<s){

		for(int i=1; i<=n; i++){
k=k+a[i];

			}

			   }

		cout<<k;

}


#include<iostream>
using namespace std;
int main(){

	int k=0, s=0, n;

	cin>>n;

	int a[n];

	for(int i=1; i<=n; i++){
		cin>>a[i];
		s=s+a[i];

			}

		for(int i=1; i<=n; i++){

			k=k+a[i];

			 if (k==s/2 || k>s/2)  {break;}
			   }

			cout<<k+1;

}


#include<iostream>
using namespace std;
int main(){

	int k=0, s=0, n;

	cin>>n;

	int a[n];

	for(int i=1; i<=n; i++){
		cin>>a[i];
		s=s+a[i];

			}

		for(int i=1; i<=n; i++){

			k=k+a[i];

			 if (k=s/2 || k>s/2)  {break;}
			   }

			cout<<k+1;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	int a[10000];
	cin>>n;
	int sum=0;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		sum=sum+a[i];
	}
	if(sum%2==0)sum=sum/2;
	if(sum%2!=0)sum=sum/2+1;
	for(int i=1;i<=n;i++)
	{
		sum=sum-a[i];
		if(sum<=0)
		{

			printf("%d\n",i);
			return 0;
		}
	}
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
   int n,a[10050],s=0,s1,s2=0;
   cin>>n;
   for(int i=1;i<=n;i++)
    {
	  cin>>a[i];
	  s=s+a[i];
    }
    s1=s/2;
	for(int i=1;i<=n;i++)
	 {
	    s2=s2+a[i];
	    if(s2>=s1)
		  {
		     cout<<i;
		     break;
	      }
     }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,a[200000],ans;
double r;
int main()
{

 	cin>>n;
 	for(int i=1;i<=n;i++)
 	{
 		cin>>a[i];
 		r=r+a[i];
	}
	r=(r*1.0)/2;
	for(int i=1;i<=n;i++)
	{
		ans=ans+a[i];
		if(ans>=r)
		{
			cout<<i;
			return 0;

		}

	}
}


#include<bits/stdc++.h>
using namespace std;
int n,a[200005],k,sum;
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%d",&k);
        a[i]=a[i-1]+k;
        sum+=k;
    }
    if(sum%2==0) sum/=2;
    else sum=sum/2+1;
    for(int i=1;i<=n;i++){
        if(a[i]>=sum){
            cout<<i;
            break;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
  long long a,b[20005],c=0,d=0;
  cin>>a;
  for(int i=1;i<=a;i++){
  	cin>>b[i];
  	c+=b[i];
  }
  c/=2;
  for(int i=1;i<=a;i++){
  	d+=b[i];
  	if(d>=c){
  	  cout<<i<<endl;
	  break;
	}
  }

  return 0;
}


#include <bits/stdc++.h>
int s,ans,a[200005],n;
int main(void){
    scanf ("%d",&n);//读入不解释
    for (int i=0;i<n;i++)scanf ("%d",&a[i]),s+=a[i];//求总共有多少题
    int i=0;
    for (;i<n;i++){ans+=a[i];if(ans>=s*1.0/2)break;}//注意！直接/2是下取整！所以要用double！
    printf ("%d",i+1);//0下标+1
}


#include<bits/stdc++.h>
#define TP int
using namespace std;
inline TP read(){
    char c=getchar();
    TP x=0;
    bool f=0;
    while(!isdigit(c))f^=!(c^45),c=getchar();
    while(isdigit(c))x=(x<<1)+(x<<3)+(c^48),c=getchar();
    if(f)x=-x;return x;
}
int s,ans,a[200005],n;
int main(void){
    n=read();
    for (int i=0;i<n;i++){
    	a[i]=read();
		s+=a[i];
    }
    int i=0;
    for (;i<n;i++){
		ans+=a[i];
		if(ans>=s*1.0/2){
			break;
		}
	}
    cout<<i+1;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,r,a[200000],ans,anss;
int main()
{

 	cin>>n;
 	for(int i=1;i<=n;i++)
 	{
 		cin>>a[i];
 		r=r+a[i];
	}
	r=r*0.5;
	for(int i=1;i<=n;i++)
	{
		ans=ans+a[i];
		if(ans>=r)
		{
			anss=i;
			break;

		}

	}
	cout<<anss;
    return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int n,a[i],i,s=0,s2=0;
	double av;
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>a[i];
		s+=a[i];
	}
	av=(s+0.0)/2.0;
	for(i=0;i<n;i++)
	{
		s2+=a[i];
		if(s2>=av)
		{
			cout<<i;
			break;
		}
	}
	return 0;
}


#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
#include <sstream>
#define IOS ios_base::sync_with_stdio(0); cin.tie(0);
#define Mod 1000000007
#define eps 1e-6
#define ll long long
#define INF 0x3f3f3f3f
#define MEM(x,y) memset(x,y,sizeof(x))
#define Maxn 100005
#define P pair<int,int>
using namespace std;
int main()
{
	int a;
	cin >> a;
	long b[200005];
	int  c[200005];
	for (int i = 0; i < a; i++)
	{
		cin >> b[i];
		if (i == 0)
			c[i] = b[i];
		else
			c[i] = b[i] + c[i - 1];
	}
	float d;
	d=c[a-1]/2.0;
	ll ans = lower_bound(c, c + a, d) - c+1;
	cout << ans << endl;

}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n,sum=0,sum1=0;
	cin>>n;
	int a[n];
	for(int i=0;i<n;i++)
	cin>>a[i],sum+=a[i];
	for(int i=0;i<n;i++)
	{
		sum1+=a[i];
		if(sum1>=(sum/2)+1)
		{
			cout<<i+1<<endl;
			return 0;
		}
	}

	return 0;
 }


#include<stdio.h>
#include<cstring>
using namespace std;
int a[1000001];
int main() {
	int n,sum=0,total=0;
	scanf("%d",&n);
	for(int i=1; i<=n; i++) {
		scanf("%d",&a[i]);
		total+=a[i];
	}
	total=total-(total>>1);
	for(int i=1; i<=n; i++) {
		sum+=a[i];
		if(sum>=total) {
			printf("%d",i);
			return 0;
		}
	}
	return 0;
}


#include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#include <stack>
#include <utility>
#include <functional>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define endll putchar('\n');
#define RI register int
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
inline ll read(){
    char ch=getchar();ll x=0,f=1;
    while(ch<'0'||ch >'9') {
        if(ch=='-') f=-1;
        ch=getchar();
    }
    while('0'<=ch&&ch<='9') {
        x=x*10+ch-'0';
        ch=getchar();
    }
    return x*f;
}
inline void print(ll k){
    if(k<0) k=-k,putchar('-');
    if(k>9) print(k/10);
    putchar(k%10+48);
}
ll sum;
ll localsum;
int a[200000];
int n;
int main(){
	n=read();
	rep(i,1,n){
		a[i]=read();
		sum+=a[i];
	}
	rep(i,1,n){
		localsum+=a[i];
		if((localsum<<1)>=sum){
			print(i);
			endll;
			return 0;
		}
	}
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int al=0,la=0;
	int a[1002],ans=0,n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
		al+=a[i];
	}
	for(int i=0;i<n;i++)
	{
		la+=a[i];
		ans++;
		if(2*la>=al)break;
	}
	printf("%d\n",ans);
	return 0;
 }


#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	double a[10028];
	double n,s=0,o=0,day=0;
	cin>>n;
	for(register int i=1;i<=n;i++)
	{
	    cin>>a[i];
	    s+=a[i];
	}
	s/=2;
	for(register int i=1;i<=n;i++)
	{
		if(o>=s)
		{
			cout<<day;
	        return 0;
		}
		else
		{
			o+=a[i];
			day++;
		}
	}
}


#include<bits/stdc++.h>
using namespace std;
long long a[100001],n,s,ans;
int main()
{
    cin>>n;
    for(int i=1;i<=n;i++)
    {
    	cin>>a[i];
		s=s+a[i];
	}
    s=(s+1)/2;
    for(int i=1;i<=n;i++)
    {
        ans=ans+a[i];
        if(ans>=s)
        {
            cout<<i;
            return 0;
        }
    }
    return 0;
}


#include <cstdio>
using namespace std;
int main()
{
	log long n,sum=0,result=0;
	scanf("%d",&n);
	int a[n+1];
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		sum+=a[i];
	}
	for(int i=1;i<=n;i++)
	{
		result+=a[i];
		if(result>=sum/2)
		{
			printf("%d",i);
			break;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[200000]={0};
int main()
{
	int n,x,ans,mid,l,r;
	float sum;

	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>x;
		a[i]=a[i-1]+x;
	}
	if(a[n]%2==0) sum=a[n]/2;
	else sum=a[n]/2+1;
	l=0;r=n;
	while(l<=r)
	{
	  mid=(l+r)/2;
	  if(a[mid]>=sum){ans=mid;r=mid-1;}
	  else l=mid+1;
	}
	cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int s[200001],i,n,j,k,l,m;

int main(){
cin>>n;
for(i=1;i<=n;i++){
	cin>>m;
	s[i]=s[i-1]+m;
}
l=(s[n]+1)/2;
for(i=1;i<=n;i++)
if(s[i]>=l){
	cout<<i;
	return 0;
}
    return 0;
}


#include<iostream>
/*#define using 你
#define namespace 好
#define std 世
#define int 界
#define main 我
#define cin>>是
#define for 一
#define return 个
#define ; ；
#define if 天天
#define cout<< 待*/
using namespace std;
int main(){
    int n;
    cin>>n;
    int a[n+1],aha;
    int sum=0;
    for(int b=1;b<=n;b++){
        cin>>a[b];
        aha+=a[b];
    }
    aha=(aha+1)/2;
    for(int c=1;c<=n;c++){
        sum+=a[c];
        if(sum>=aha){
            cout<<c;
            return 0;
        }
    }
}


#include <bits/stdc++.h>
using namespace std;
long long n,a[200000],ans,alp;
float all;
int main()
{

 	cin>>n;
 	for(int i=1;i<=n;i++)
 	{
 		cin>>a[i];
 		all=all+a[i];
	}
	all=all/2;
	for(int i=0;i<n;i++)
	{
		ans=ans+a[i];
		if(ans>=all)
		{
			cout<<i;
			return 0;

		}

	}
}


#include<bits/stdc++.h>
using namespace std;
int n,a[10000],h=0,zh;
int main()
{
  cin>>n;
  for(int i=1;i<=n;i++)
  {
  	cin>>a[i];
  	zh=zh+a[i];
  }
  if(zh%2==0) cout<<n/2;
  else cout<<(n+1)/2;
  return 0;
}