n = int(eval(input()))

k = int(eval(input()))

ans = 10**10

for i in range(2**n):

    m = 1

    for j in range(n):

        if (i>>j)&1 == 1:

            m *= 2

        else:

            m += k

    ans = min(m,ans)

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

k = int(eval(input()))

ans = 1

for i in range(n):

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

print(ans)
n = int(eval(input()))
k = int(eval(input()))
ans = 10**10
for i in range(2**n):
    m = 1
    for j in range(n):
        if (i >> j) & 1 == 1:
            m *= 2
        else:
            m += k
    ans = min(m, ans)
print(ans)

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

-ans = 10**10 -for i in range(2**n): -    m = 1 -    for j in range(n): -        if (i >> j) & 1 == 1: -            m *= 2 -        else: -            m += k -    ans = min(m, ans) +ans = 1 +for i in range(n): +    ans = min(2 * ans, ans + k)