Problem:
Score: 600 points

Problem Statement

How many strings can be obtained by applying the following operation on a string S exactly K times: "choose one lowercase English letter and insert it somewhere"?

The answer can be enormous, so print it modulo (10^9+7).

Constraints

K is an integer between 1 and 10^6 (inclusive).

S is a string of length between 1 and 10^6 (inclusive) consisting of lowercase English letters.

Input

Input is given from Standard Input in the following format:

K
S

Output

Print the number of strings satisfying the condition, modulo (10^9+7).

Sample Input 1

5
oof

Sample Output 1

575111451

For example, we can obtain proofend, moonwolf, and onionpuf, while we cannot obtain oofsix, oofelevennn, voxafolt, or fooooooo.

Sample Input 2

37564
whydidyoudesertme

Sample Output 2

318008117

Solution in C++ (GCC 9.2.1) (judge verdict: Runtime Error)

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


#define ll          long long
#define uint        unsigned int 
#define ld          long double
#define SAM         ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define FOR(i,a,b)  for(ll i=a;i<b;++i)
#define RFOR(i,a,b) for(ll i=a;i>b;--i)
#define mod         1000000007
#define mxn         200005
#define pb          push_back
#define pii         pair<int,int>
#define f           first
#define s           second
#define sz(x)       (int)x.size()
#define all(x)      x.begin(),x.end()

using namespace std;

ll fact[mxn],inv_fact[mxn];

ll power(ll a,ll n)
{
    a %= mod;
    if(n == 1) return a;
    if(n == 0) return 1LL;
    if(n%2) return (a*(power((a*a)%mod,n/2)%mod))%mod;           //n is odd
    return power((a*a)%mod,n/2)%mod;                             //n is even
}

/*int inverse(int x)
{
    return power(x,mod-2)%mod;     //Fermat's little theorem
}*/


/*void factorial()
{
    fact[0]=1;
    FOR(i,1,mxn)
    {
        fact[i]=(i*fact[i-1]);
        fact[i]%=mod;
    }
}*/

/*void inverse_fact()
{
    inv_fact[mxn-1]=inverse(fact[mxn-1]);
    for(ll i=mxn-2;i>=0;--i)
        inv_fact[i]=((i+1)*inv_fact[i+1])%mod;
}*/

ll comb(ll n, ll r)
{
    if(n<0 || r<0)
        return 0LL;
    if(n<r)
        return 0LL;
    return (fact[n]*((inv_fact[r]*inv_fact[n-r])%mod))%mod;
    
}

int main()
{
    SAM;
    
    ll k;
    string s;
    cin>>k>>s;
    ll a = sz(s)+k;
    ll sum=0;
    
    //factorial();
    fact[0]=1;
    FOR(i,1,mxn)
    {
        fact[i]=(i*fact[i-1]);
        fact[i]%=mod;
    }
    
    //inverse_fact();
    inv_fact[mxn-1]=power(fact[mxn-1],mod-2);
    for(ll i=mxn-2;i>=0;--i)
        inv_fact[i]=((i+1)*inv_fact[i+1])%mod;
    
    for(ll i=0;i<=k;i++)
    {
        ll whole = ((power(26,i))*(power(25,k-i)))%mod;
        whole = (comb(a-i-1,sz(s)-1)*whole)%mod;
        sum=(sum+whole)%mod;
    }
    cout<<sum<<" ";
    return 0;
}