N = int(eval(input()))

K = int(eval(input()))



ans = 1

for i in range(N):

  if(ans*2 > ans+K):

    ans += K

  else:

    ans *= 2

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

K = int(eval(input()))

ans = 0

num = 1

for i in range(N):

  if(num*2 < num+K):

    num *= 2

  else:

    num += K

  ans = max(ans, num)

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

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

-ans = 1 +ans = 0 +num = 1 -    if ans * 2 > ans + K: -        ans += K +    if num * 2 < num + K: +        num *= 2 -        ans *= 2 +        num += K +    ans = max(ans, num)