N,K = int(eval(input())), int(eval(input()))

now = 1

for i in range(N):

    if now*2 < now + K:

        now *= 2

    else:

        now += K

print(now)

N = int(eval(input()))

K = int(eval(input()))

ans = 1

for i in range(N):

    if ans < K:

        ans *= 2

    else:

        ans += K

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

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

-N, K = int(eval(input())), int(eval(input())) -now = 1 +N = int(eval(input())) +K = int(eval(input())) +ans = 1 -    if now * 2 < now + K: -        now *= 2 +    if ans < K: +        ans *= 2 -        now += K -print(now) +        ans += K +print(ans)