N = int(eval(input()))

K = int(eval(input()))

x = 1

for i in range (N):

    if x*2 < x + K:

        x=x*2

    else:

        x = x + K

print(x)
n=int(input())

k=int(input())

ip=1



for i in range(n):

	if ip*2-ip<k:

		ip=ip*2

	else:

		ip=ip+k

		

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

n = int(input())
k = int(input())
ip = 1
for i in range(n):
    if ip * 2 - ip < k:
        ip = ip * 2
    else:
        ip = ip + k
print(ip)

-N = int(eval(input())) -K = int(eval(input())) -x = 1 -for i in range(N): -    if x * 2 < x + K: -        x = x * 2 +n = int(input()) +k = int(input()) +ip = 1 +for i in range(n): +    if ip * 2 - ip < k: +        ip = ip * 2 -        x = x + K -print(x) +        ip = ip + k +print(ip)