n, k, ans = int(eval(input())), int(eval(input())), 1

for _ in range(n):

    ans += min(ans, k)

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

k = int(eval(input()))

ans = 1

for _ in range(n):

    ans += min(ans, k)

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

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

-n, k, ans = int(eval(input())), int(eval(input())), 1 +n = int(eval(input())) +k = int(eval(input())) +ans = 1