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 Python (3.8.2) (judge verdict: Runtime Error)

import sys                                                                                                                                                                                                  
                                                                                                                                                                                                            
kMod = 10**9 + 7                                                                                                                                                                                            
                                                                                                                                                                                                            
def read_int():                                                                                                                                                                                             
    l = sys.stdin.readline().rstrip('\n').split(' ')                                                                                                                                                        
    return int(l[0])                                                                                                                                                                                        
                                                                                                                                                                                                            
def read_int_list():                                                                                                                                                                                        
    l = sys.stdin.readline().rstrip('\n').split(' ')                                                                                                                                                        
    return [int(i) for i in l]                                                                                                                                                                              
                                                                                                                                                                                                            
K = read_int()                                                                                                                                                                                              
S = sys.stdin.readline().rstrip('\n')                                                                                                                                                                       
                                                                                                                                                                                                            
memo = {}                                                                                                                                                                                                   
def cnt(n, rest):                                                                                                                                                                                           
    if n == 0:                                                                                                                                                                                              
        if rest > 0:                                                                                                                                                                                        
            return 0                                                                                                                                                                                        
        else:                                                                                                                                                                                               
            return 1                                                                                                                                                                                        
    key = (n, rest)                                                                                                                                                                                         
    if key in memo:                                                                                                                                                                                         
        return memo[key]                                                                                                                                                                                    
    ans = 0                                                                                                                                                                                                 
    ans += 25 * cnt(n-1, rest)                                                                                                                                                                              
    ans += cnt(n-1, rest-1)                                                                                                                                                                                 
    ans %= kMod                                                                                                                                                                                             
    memo[key] = ans                                                                                                                                                                                         
    return ans                                                                                                                                                                                              
                                                                                                                                                                                                            
print(cnt(K+len(S), len(S)))