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 = 1000000007;

long f[2000001];
void pre(long n) {
  f[0] = 1;
  for (int i = 0; i < n; ++i) {
    f[i + 1] = f[i] * (i + 1) % mod;
  }
}

long pmod(long b, long e) {
  if (e == 0) return 1;
  if (e % 2 == 1) return b * pmod(b, e - 1) % mod;
  long t = pmod(b, e / 2);
  return t * t % mod;
}

long inv(long n) {
  return pmod(n, mod - 2);
}

long comb(long n, long r) {
  return f[n] * inv(f[r] * f[n - r] % mod) % mod;
}

int main() {
  int k;
  string s;
  cin >> k >> s;
  long n = s.size();
  pre(n + k);
  
  long sum = 0;
  long base = 1;
  for (int i = 0; i <= k; ++i) {
    long res = comb(n + k, i) % mod * base % mod;
    sum = (sum + res) % mod;
    base = base * 25 % mod;
  }
  cout << sum << endl;
}