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: Accepted)

#include <bits/stdc++.h>
using namespace std;
const int MOD=1e9+7;
vector<long> fact_inv, inv, Com;
void init_nCk(int n,int k){
  fact_inv.resize(k+5);
  inv.resize(k+5);
  fact_inv[0]=fact_inv[1]=1;
  inv[1]=1;
  for(int i=2;i< k+5;i++){
    inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
    fact_inv[i]=fact_inv[i-1]*inv[i]%MOD;
  }
  Com.resize(k+5);
  Com[0]=1;
  for(int i=1;i<k+5;i++){
    Com[i]=Com[i-1]*((n-i+1)*inv[i]%MOD)%MOD;
  }
}
int K,i,a;
long x=1,ans=0;
int nCk(int k){
    assert(!(k<0));
    return Com[k];
}
int main(){
  string S;
  cin>>K>>S;
  a=K+S.size();
  init_nCk(a,K);
  for(i=0;i<=K;i++){
    ans+=x*nCk(i);
    if(ans>MOD)ans%=MOD;
    x=x*25%MOD;
  }
  cout<<ans<<endl;
}