n = int(eval(input()))

k = int(eval(input()))



val = 1

for i in range(n):

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

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

k = int(eval(input()))

p = 1

for _ in range(n):

  if p * 2 < p + k:

    p *= 2

  else:

    p += k

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

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

-val = 1 -for i in range(n): -    val = min(val + k, val * 2) -print(val) +p = 1 +for _ in range(n): +    if p * 2 < p + k: +        p *= 2 +    else: +        p += k +print(p)