N = int(eval(input()))

K = int(eval(input()))



min_m = 10 ** 10

for i in range(2 ** N):

    m = 1

    for n in range(N):

        if i & (1 << n):

            m *= 2

        else:

            m += K

    min_m = min(min_m, m)



print(min_m)

N = int(eval(input()))

K = int(eval(input()))



# min_m = 10 ** 10

# for i in range(2 ** N):

#     m = 1

#     for n in range(N):

#         if i & (1 << n):

#             m *= 2

#         else:

#             m += K

#     min_m = min(min_m, m)



m = 1

for i in range(N):

    m = min(m * 2, m + K)



print(m)

N = int(eval(input()))
K = int(eval(input()))
min_m = 10**10
for i in range(2**N):
    m = 1
    for n in range(N):
        if i & (1 << n):
            m *= 2
        else:
            m += K
    min_m = min(min_m, m)
print(min_m)

N = int(eval(input()))
K = int(eval(input()))
# min_m = 10 ** 10
# for i in range(2 ** N):
#     m = 1
#     for n in range(N):
#         if i & (1 << n):
#             m *= 2
#         else:
#             m += K
#     min_m = min(min_m, m)
m = 1
for i in range(N):
    m = min(m * 2, m + K)
print(m)

-min_m = 10**10 -for i in range(2**N): -    m = 1 -    for n in range(N): -        if i & (1 << n): -            m *= 2 -        else: -            m += K -    min_m = min(min_m, m) -print(min_m) +# min_m = 10 ** 10 +# for i in range(2 ** N): +#     m = 1 +#     for n in range(N): +#         if i & (1 << n): +#             m *= 2 +#         else: +#             m += K +#     min_m = min(min_m, m) +m = 1 +for i in range(N): +    m = min(m * 2, m + K) +print(m)