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<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<stdint.h>
#include<tgmath.h>
#include<stdbool.h>
#include<sys/queue.h>
#include<time.h>
#define ll long long
#define min(a, b) ((a) > (b) ? (b) : (a))
#define max(a, b) ((a) > (b) ? (a) : (b))

const ll mod = 1000000007ll;
const ll nyaaaa = 407182070ll;
ll A[2002002], B[2002002]={1};
ll modpow(ll x, ll y, ll m){
    if(y == 0ll)return 1ll;
    ll res = 1ll, tmp = x;
    while(y){
        if(y&1) res = res * tmp % m;
        tmp = tmp * tmp % m;
        y >>= 1;
    }
    return res;
}
ll pom(ll x, ll y){return modpow(x, y, mod);}
void nyan(){
    ll i = 1;
    for(; i<=2000000; i++){
        B[i] = B[i-1] * i % mod;
    }i--;
    A[i] = nyaaaa;
    for(;i>0; i--){
        A[i-1] = A[i] * i % mod;
    }
}
int k;
char s[1001001];
int main(){
    nyan();
    scanf("%d%s", &k, s);
    int l = strlen(s);
    ll ans = 0;
    for(int i=0; i<=k; i++){
        ans += pom(26, k-i) * pom(25, i) % mod * B[l+i-1] % mod * A[l-1] % mod * A[i] % mod;
        ans %= mod;
    }
    printf("%lld\n", ans);
    return 0;
}