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++ (Clang 10.0.0) (judge verdict: Runtime Error)

//
// Created by 10034 on 2020/7/29.
//

#include <iostream>
#include <cstring>
using namespace std;
const int mod=1e9+7;
char s[1000100];
typedef long long LL;
int qmi(int a,int b){
    int res=1;
    while(b){
        if(b&1) res=(LL)res*a%mod;
        b>>=1;
        a=(LL)a*a%mod;
    }
    return res;
}
int fac[100010];
int C(int a,int b){
//    cout<<fac[a]<<" "<<qmi(fac[a-b],mod-2)<<" "<<qmi(fac[b],mod-2)<<endl;
    return (LL)fac[a]*qmi(fac[a-b],mod-2)%mod*qmi(fac[b],mod-2)%mod;
}
int main(){
    fac[0]=1;
    for(int i=1;i<100010;++i){
        fac[i]=(LL)fac[i-1]*i%mod;
    }
    int n,m;
    cin>>m;
    cin>>s;
    int res=0;
    n=strlen(s);
    for(int i=0;i<=m;++i){
        res=(LL)(res+(LL)qmi(26,i)*C(n+m-i-1,n-1)%mod*qmi(25,m-i)%mod)%mod;
    }
    cout<<res<<endl;
    return 0;
}