n = int(eval(input()))

k = int(eval(input()))



cnt = 1

for _ in range(n):

    cnt = min(cnt*2, cnt+k)

print(cnt)
n = int(eval(input()))

k = int(eval(input()))



cnt = 1

for _ in range(n):

    if cnt <= k:

        cnt *= 2

    else:

        cnt += k

print(cnt)
n = int(eval(input()))
k = int(eval(input()))
cnt = 1
for _ in range(n):
    cnt = min(cnt * 2, cnt + k)
print(cnt)

n = int(eval(input()))
k = int(eval(input()))
cnt = 1
for _ in range(n):
    if cnt <= k:
        cnt *= 2
    else:
        cnt += k
print(cnt)

-    cnt = min(cnt * 2, cnt + k) +    if cnt <= k: +        cnt *= 2 +    else: +        cnt += k