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;
#define ll long long int
#define endl "\n"
#define F first
#define S second
#define def(x) cerr << #x << " is " << x << endl;
#define mod 1000000007
#define pb push_back
#define FOR(i,a,n) for(ll i=a;i<n;i++)
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define all(a) a.begin(),a.end()
const int NUM = 2e5 + 5;
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << endl;
    err(++it, args...);
}
ll len,n,ans=0;
ll bp(ll x,ll y,ll MOD){
    ll ans = 1;
    while (y) {
        if (y & 1) ans = ans * x % MOD;
        x = x * x % MOD, y >>= 1;
    }
    return ans;
}
int main(){
    ios
    int num_tests=1; 
    //cin>>num_tests;
    while(num_tests-->0){
        string s; 
        cin>>len>>s;
        n = s.size();
        len+=n;
        vector<ll> comb(len+10,1);
        FOR(i,2,len+5) {comb[i] = comb[i-1]*i; comb[i] = comb[i]%mod;}
        // ans = summation of(C(len,i)*pow(25,len-i))
        for(int i=n;i<=len;i++){
            ll cur = bp(25,len-i,mod);
            // calculating C(len,i)
            cur = cur*comb[len]; cur = cur%mod; // multiply by len!
            cur = cur*bp(comb[i],mod-2,mod); cur = cur%mod; // divided by i!
            cur = cur*bp(comb[len-i],mod-2,mod); cur = cur%mod; // divided by (len-i)!*/
            ans += cur;
            ans = ans%mod;
        }
        cout<<ans;
    }   
}