N = int(eval(input()))

K = int(eval(input()))



ans = 10**18

for state in range(1 << N):

    now = 1

    for d in range(N):

        if (state & (1 << d)) == 0:

            now *= 2

        else:

            now += K

    ans = min(ans, now)

print(ans)

N = int(eval(input()))

K = int(eval(input()))



ans = 1

for _ in range(N):

    if ans < K:

        ans *= 2

    else:

        ans += K

print(ans)

N = int(eval(input()))
K = int(eval(input()))
ans = 10**18
for state in range(1 << N):
    now = 1
    for d in range(N):
        if (state & (1 << d)) == 0:
            now *= 2
        else:
            now += K
    ans = min(ans, now)
print(ans)

N = int(eval(input()))
K = int(eval(input()))
ans = 1
for _ in range(N):
    if ans < K:
        ans *= 2
    else:
        ans += K
print(ans)

-ans = 10**18 -for state in range(1 << N): -    now = 1 -    for d in range(N): -        if (state & (1 << d)) == 0: -            now *= 2 -        else: -            now += K -    ans = min(ans, now) +ans = 1 +for _ in range(N): +    if ans < K: +        ans *= 2 +    else: +        ans += K