k = int(eval(input()))

s = eval(input())

n = len(s)



MOD = 10**9+7

d = pow(26, -1, MOD)

ans = val = pow(26, k, MOD)

for i in range(1, k+1):

    val *= (i+n-1) * 25 * pow(i, -1, MOD) * d % MOD

    val %= MOD

    ans += val

    ans %= MOD

print(ans)
k = int(eval(input()))

s = eval(input())

n = len(s)



MAX = 10**6

MOD = 10**9+7



inv = [0] * (MAX+1)

inv[1] = 1

for i in range(2, MAX+1):

    q, r = divmod(MOD, i)

    inv[i] = -inv[r] * q % MOD



ans = val = pow(26, k, MOD)

for i in range(1, k+1):

    val *= (i+n-1) * 25 * inv[i] * inv[26] % MOD

    val %= MOD

    ans += val

    ans %= MOD

print(ans)

k = int(eval(input()))
s = eval(input())
n = len(s)
MOD = 10**9 + 7
d = pow(26, -1, MOD)
ans = val = pow(26, k, MOD)
for i in range(1, k + 1):
    val *= (i + n - 1) * 25 * pow(i, -1, MOD) * d % MOD
    val %= MOD
    ans += val
    ans %= MOD
print(ans)

k = int(eval(input()))
s = eval(input())
n = len(s)
MAX = 10**6
MOD = 10**9 + 7
inv = [0] * (MAX + 1)
inv[1] = 1
for i in range(2, MAX + 1):
    q, r = divmod(MOD, i)
    inv[i] = -inv[r] * q % MOD
ans = val = pow(26, k, MOD)
for i in range(1, k + 1):
    val *= (i + n - 1) * 25 * inv[i] * inv[26] % MOD
    val %= MOD
    ans += val
    ans %= MOD
print(ans)

+MAX = 10**6 -d = pow(26, -1, MOD) +inv = [0] * (MAX + 1) +inv[1] = 1 +for i in range(2, MAX + 1): +    q, r = divmod(MOD, i) +    inv[i] = -inv[r] * q % MOD -    val *= (i + n - 1) * 25 * pow(i, -1, MOD) * d % MOD +    val *= (i + n - 1) * 25 * inv[i] * inv[26] % MOD