Mislove had an array $a_1$, $a_2$, $\cdots$, $a_n$ of $n$ positive integers, but he has lost it. He only remembers the following facts about it:



 The number of different numbers in the array is not less than $l$ and is not greater than $r$;

 For each array's element $a_i$ either $a_i = 1$ or $a_i$ is even and there is a number $\dfrac{a_i}{2}$ in the array.

For example, if $n=5$, $l=2$, $r=3$ then an array could be $[1,2,2,4,4]$ or $[1,1,1,1,2]$; but it couldn't be $[1,2,2,4,8]$ because this array contains $4$ different numbers; it couldn't be $[1,2,2,3,3]$ because $3$ is odd and isn't equal to $1$; and it couldn't be $[1,1,2,2,16]$ because there is a number $16$ in the array but there isn't a number $\frac{16}{2} = 8$.

According to these facts, he is asking you to count the minimal and the maximal possible sums of all elements in an array. 


-----Input-----

The only input line contains three integers $n$, $l$ and $r$ ($1 \leq n \leq 1\,000$, $1 \leq l \leq r \leq \min(n, 20)$) — an array's size, the minimal number and the maximal number of distinct elements in an array.


-----Output-----

Output two numbers — the minimal and the maximal possible sums of all elements in an array.


-----Examples-----
Input
4 2 2

Output
5 7

Input
5 1 5

Output
5 31



-----Note-----

In the first example, an array could be the one of the following: $[1,1,1,2]$, $[1,1,2,2]$ or $[1,2,2,2]$. In the first case the minimal sum is reached and in the last case the maximal sum is reached.

In the second example, the minimal sum is reached at the array $[1,1,1,1,1]$, and the maximal one is reached at the array $[1,2,4,8,16]$.

Difficulty: EASY

Solutions:
import math
max1 = 0
(n, l, r) = map(int, input().split())
min1 = 1 * (n - l + 1) + 2 * (2 ** (l - 1) - 1)
s = int(math.log(n, 2)) + 1
for i in range(r):
	max1 += 2 ** i
for j in range(n - r):
	max1 += 2 ** i
print(min1, max1)


s = input()
a = s.split()
n = int(a[0])
l = int(a[1])
r = int(a[2])
amin = 0
amax = 0
amax += 2 ** r - 1
amax += 2 ** (r - 1) * (n - r)
amin += 2 ** l - 1
amin += n - l
print(amin, amax)


lst = [int(i) for i in input().split()]
n = lst[0]
l = lst[1]
r = lst[2]
print(2 ** l - 1 + (n - l), 2 ** r - 1 + (n - r) * 2 ** (r - 1))


(N, l, r) = map(int, input().split())
other_elem = l - 1
low = 2 ** (other_elem + 1) - 2 + N - other_elem
other_elem = r - 1
high = 2 ** other_elem - 1 + 2 ** other_elem * (N - other_elem)
print(low, high)


(n, l, r) = input().split()
n = int(n)
l = int(l)
r = int(r)
mn = n - (l - 1)
mx = 0
c = 0
for i in range(1, l):
	mn += 2 ** i
for i in range(n):
	mx += 2 ** c
	if c < r - 1:
		c += 1
print(mn, mx)


def main():
	(n, l, r) = map(int, input().split())
	temp = n
	mn = n - (l - 1)
	temp -= mn
	cnt = 1
	while temp:
		temp -= 1
		mn += 2 ** cnt
		cnt += 1
	cnt = 0
	temp2 = n
	mx = 0
	cnt = 0
	while temp2 > n - (r - 1):
		temp2 -= 1
		mx += 2 ** cnt
		cnt += 1
	mx += (n - (r - 1)) * 2 ** cnt
	print(mn, mx)
	return
main()


(a, b, c) = input().split()
ansaa = 0
ansba = 0
for i in range(0, int(b)):
	ansaa = ansaa + 2 ** i
ansaa = ansaa + (int(a) - int(b))
for i in range(0, int(c)):
	ansba = ansba + 2 ** i
ansba = ansba + 2 ** (int(c) - 1) * (int(a) - int(c))
print(str(ansaa) + ' ' + str(ansba))


(N, l, r) = map(int, input().split())
x = []
y = []
a = 2 ** (l - 1)
for i in range(N):
	if a == 1:
		x.append(a)
	else:
		x.append(a)
		a //= 2
b = 2 ** (r - 1)
c = 1
for i in range(N):
	if b != c:
		y.append(c)
		c *= 2
	else:
		y.append(b)
print(sum(x), sum(y))


(n, l, r) = input().split()
n = int(n)
l = int(l)
r = int(r)
min = n - l
k = 1
for i in range(l):
	min = min + k
	k = 2 * k
max = 0
k = 1
for i in range(r):
	max = max + k
	k = 2 * k
k = int(k / 2)
max = max + (n - r) * k
print(min, end=' ')
print(max)


from sys import stdout
printn = lambda x: stdout.write(x)
inn = lambda : int(input())
inl = lambda : list(map(int, input().split()))
inm = lambda : map(int, input().split())
DBG = True
BIG = 999999999
R = 10 ** 9 + 7

def ddprint(x):
	if DBG:
		print(x)
(n, l, r) = inm()
mn = n - l + 2 ** l - 1
mx = 2 ** r - 1 + 2 ** (r - 1) * (n - r)
print(str(mn) + ' ' + str(mx))


def calculator(n, l, r):
	s = 1
	c = 1
	for i in range(1, l):
		s = 2 * s
		c += s
	c += n - l
	print(c, end=' ')
	s = 1
	c = 1
	for i in range(1, r):
		s = 2 * s
		c += s
	c += s * (n - r)
	print(c)
(n, l, r) = list(map(int, input().split()))
calculator(n, l, r)


(n, l, r) = map(int, input().split())
print(2 ** l - 1 + n - l, (2 + n - r) * 2 ** (r - 1) - 1)


(n, l, r1) = map(int, input().split())
tw = []
r = 1
for i in range(n):
	tw.append(r)
	r = r * 2
sumin = 0
tu = []
for i in range(l):
	tu.append(tw[i])
	sumin += tw[i]
for i in range(n - l):
	sumin += 1
	tu.append(1)
tu1 = []
sumax = 0
for i in range(min(r1, n)):
	tu1.append(tw[i])
	sumax += tw[i]
	r23 = tw[i]
if n - r1 > 0:
	for i in range(n - r1):
		tu1.append(r23)
		sumax += r23
print(sumin, sumax)


ar = input().split(' ')
n = int(ar[0])
l = int(ar[1])
r = int(ar[2])
low = n - l + 1
index = 1
lowsum = low
for i in range(low, n):
	lowsum += 2 ** index
	index += 1
highsum = 0
for i in range(r):
	highsum += 2 ** i
	index = 2 ** i
highsum += index * (n - r)
print(lowsum, highsum)


(n, l, r) = map(int, input().split())
mx = 1 << r
mx -= 1
mx += (1 << r - 1) * (n - r)
mn = 0
mn = 1 << l
mn -= 1
mn += n - l
print(mn, mx)


(n, l, r) = map(int, input().split())
mn = 1
s = 0
for i in range(l):
	s += mn
	mn *= 2
mn = s + n - l
mx = 1
s = 0
for i in range(r - 1):
	s += mx
	mx *= 2
mx = s + (n - r + 1) * mx
print(mn, mx)


(n, l, r) = list(map(int, input().split()))
l1 = [1]
for i in range(1, r):
	l1.append(l1[i - 1] * 2)
s = sum(l1)
maxi = s + (n - r) * l1[-1]
mini = sum(l1[:l]) + (n - l)
print(mini, maxi)


(n, l, r) = map(int, input().split())
mins = 0
maxs = 0
let = []
for p in range(r):
	let.append(2 ** p)
lil = let[:l]
mins = sum(lil) + (n - l)
maxs = sum(let) + (n - r) * let[-1]
print(mins, maxs, sep=' ')


list = [int(x) for x in input().split()]
n = list[0]
min1 = list[1]
max1 = list[2]
p = []
sum1 = 0
for i in range(0, min1):
	p.append(2 ** i)
	sum1 += p[i]
cnt1 = n - len(p)
resmin = sum1 + cnt1 * 1
q = []
sum2 = 0
for i in range(0, max1):
	q.append(2 ** i)
	sum2 += q[i]
cnt2 = n - len(q)
resmax = sum2 + cnt2 * max(q)
print(resmin, resmax)


import math
entry = input().split(' ')
n = int(entry[0])
l = int(entry[1])
r = int(entry[2])
minimo = 0
a = math.pow(2, l - 1)
for i in range(n):
	minimo += a
	if a > 1:
		a /= 2
maximo = 0
k = 1
a = 1
for i in range(n):
	maximo += a
	if k < r:
		a *= 2
		k += 1
print(int(minimo), maximo)


(n, l, r) = map(int, input().split())
mn = mx = 0
a = 1
d = 2
s = a * (d ** l - 1) // (d - 1)
mi = s + 1 * (n - l)
s = a * (d ** r - 1) // (d - 1)
mx = s + 2 ** (r - 1) * (n - r)
print(mi, mx)


(n, l, r) = map(int, input().split())
p = 0
l01 = l
l02 = r
l1 = []
l2 = []
while l > 0:
	l1.append(2 ** (l - 1))
	l -= 1
mi = sum(l1) + (n - l01)
while r > 0:
	l2.append(2 ** p)
	p += 1
	r -= 1
mx = sum(l2) + (n - l02) * l2[-1]
print(mi, mx)


(n, l, r) = [int(x) for x in input().split()]
L1 = [1] * n
counter = 0
x = 1
for i in range(l):
	L1[counter] = x
	x *= 2
	counter += 1
L2 = [1] * n
counter = 0
x = 2 ** (r - 1)
for i in range(r, n + 1):
	L2[counter] = x
	counter += 1
while counter < n:
	x = int(x / 2)
	L2[counter] = x
	counter += 1
mins = sum(L1)
maxs = sum(L2)
print(mins, maxs)


(n, l, r) = map(int, input().split())
(a1, a2) = (0, 0)
max_e = 2 ** (r - 1)
min_e = 1
a1 = n - l + 1
i = 0
t = n - l + 1
while i < n - t:
	a1 += 2 ** (i + 1)
	i += 1
a2 = 1
i = 0
while i < r - 1:
	a2 += 2 ** (i + 1)
	i += 1
a2 += (n - r) * 2 ** i
print(a1, a2)


arr = list(map(int, input().split()))
n = arr[0]
l = arr[1]
r = arr[2]
import math
sum = 0
sum2 = 0
res = pow(2, l - 1)
for i in range(n - l):
	sum += 1
for i in range(l):
	sum += pow(2, i)
for i in range(r):
	sum2 += pow(2, i)
for i in range(n - r):
	sum2 += pow(2, r - 1)
print(sum, end='')
print('', sum2)


(n, l, r) = map(int, input().split())
li1 = []
li2 = []
x1 = 1
x2 = 1
n1 = n
n2 = n
li1.append(x1)
li2.append(x2)
l = l - 1
r = r - 1
n1 = n1 - 1
n2 = n2 - 1
while l != 0:
	x1 = x1 * 2
	li1.append(x1)
	n1 = n1 - 1
	l = l - 1
if n1 != 0:
	for i in range(n1):
		li1.append(1)
summin = 0
for i in range(len(li1)):
	summin = summin + li1[i]
while r != 0:
	x2 = x2 * 2
	li2.append(x2)
	n2 = n2 - 1
	r = r - 1
if n2 != 0:
	for i in range(n2):
		li2.append(x2)
summax = 0
for i in range(len(li2)):
	summax = summax + li2[i]
print(summin, summax, sep=' ')


(n, l, r) = tuple(map(int, input().split()))
mn_sum = max_sum = 0
for i in range(n):
	if i < l:
		mn_sum += 2 ** i
	else:
		mn_sum += 1
	if i < r:
		max_sum += 2 ** i
	else:
		max_sum += 2 ** (r - 1)
print(mn_sum, max_sum)


def run(n, l, r):
	max_result = 0
	num_of_max_num = n - r + 1
	max_num = 2 ** (r - 1)
	max_result = max_num * num_of_max_num
	for i in range(0, r - 1):
		max_result += 2 ** i
	min_result = 0
	num_of_one = n - l + 1
	min_result += num_of_one
	for i in range(1, l):
		min_result += 2 ** i
	print(min_result, max_result)
(n, l, r) = list(map(int, input().split()))
run(n, l, r)


(n, l, r) = map(int, input().split())
oo = n - l
gp = pow(2, l) - 1
minn = oo + gp
mm = (n - r) * pow(2, r - 1)
gpp = pow(2, r) - 1
maxx = mm + gpp
print(minn, maxx)


(n, l, r) = map(int, input().split())
s = 2 ** l - 1
print(s + n - l, end=' ')
s = 2 ** r - 1
print(s + 2 ** (r - 1) * (n - r))


(n, l, r) = list(map(int, input().split()))
(count, cnt) = (0, 0)
lst = []
lst1 = []
for i in range(n - l + 1):
	lst.append(1)
for i in range(l - 1):
	lst.append(1 << i + 1)
for i in range(r):
	lst1.append(1 << i)
for i in range(n - r):
	lst1.append(lst1[-1])
print(sum(lst), sum(lst1))


(n, l, r) = map(int, input().split(' '))
minSum = n - l + 1
t = 2
for i in range(n - l + 1, n):
	minSum += t
	t *= 2
(maxSum, t) = (0, 1)
for i in range(0, r):
	maxSum += t
	t *= 2
maxSum += (n - r) * (t // 2)
print(minSum, maxSum)


(a, b, c) = map(int, input().split())
e = a - (b - 1)
z = 1
h = 0
s = z
while z <= b - 1:
	s *= 2
	h += s
	z += 1
min1 = h + e
z = 1
n = 1
s = z
while z <= c - 2:
	s *= 2
	n += s
	z += 1
h = 2 ** (c - 1)
h *= a - (c - 1)
if a == 1:
	print(1, 1)
elif b == 1 and c == 1:
	print(min1, min1)
else:
	print(min1, h + n)


(N, L, R) = [int(x) for x in input().split()]
mn = N - L + (2 ** L - 1)
mx = (N - R) * 2 ** (R - 1) + (2 ** R - 1)
print(mn, mx)


(n, l, r) = map(int, input().split())
sum = n
diff = 1
cur = 2
while diff != l:
	sum -= 1
	sum += cur
	cur *= 2
	diff += 1
print(sum, end=' ')
sum = 1
diff = 1
len = 1
cur = 2
while diff != r and len != n:
	sum += cur
	cur *= 2
	len += 1
	diff += 1
cur //= 2
while len != n:
	sum += cur
	len += 1
print(sum)


(n, x, y) = map(int, input().split())
mn = 0
k = n
t = 1
for i in range(n - x + 1):
	mn += 1
for i in range(x - 1):
	t *= 2
	mn += t
mx = 0
k = n
t = 1
for i in range(y - 1):
	mx += t
	t *= 2
for i in range(n - y + 1):
	mx += t
print(mn, mx)


(n, l, r) = map(int, input().split())
m = n - l
for k in range(1, l + 1):
	m += 2 ** (k - 1)
M = 0
t = 0
for k in range(1, r + 1):
	t = 2 ** (k - 1)
	M += t
M += (n - r) * t
print(m, M)


(n, l, r) = map(int, input().split())
(s, m) = (0, 0)
for i in range(l):
	s += 2 ** i
for i in range(r):
	m += 2 ** i
print(s + n - l, end=' ')
print(m + 2 ** (r - 1) * (n - r))


from math import *
from itertools import *
from collections import *
from bisect import *
(n, l, r) = map(int, input().split())
a = 2 ** min(l, n) - 1 + max(0, n - l)
b = 2 ** min(r, n) - 1 + max(n - r, 0) * max(0, 2 ** (min(r, n) - 1))
print(a, b)


a = [int(x) for x in input().split()]
(n, l, r) = (a[0], a[1], a[2])

def sequence1(o):
	return max(0, 2 ** o - 1)
sequencer_length = r
sequencel_length = l
commoner = sequence1(r) + (n - r) * 2 ** (r - 1)
commonel = sequence1(l) + n - l
print(commonel, commoner)


(n, l, r) = map(int, input().split())
L = [1]
for i in range(r + 5):
	L.append(L[-1] * 2)
L1 = L[:l]
L2 = L[:r]
L1 = L1[::-1]
c1 = n
ptr = 0
sumu1 = 0
while c1 > 0:
	c1 -= 1
	sumu1 += L1[ptr]
	ptr += 1
	if ptr == len(L1):
		ptr -= 1
c2 = n
ptr1 = 0
sumu2 = 0
while c2 > 0:
	c2 -= 1
	sumu2 += L2[ptr1]
	ptr1 += 1
	if ptr1 == len(L2):
		ptr1 -= 1
print(sumu1, sumu2)


vec = [2 ** x for x in range(0, 22)]
(n, l, r) = map(int, input().split())
mini = []
maxi = []
for x in range(n):
	if x >= l:
		x = 0
	else:
		x = l - x - 1
	mini.append(vec[x])
for x in range(n):
	if x >= r:
		x = r - 1
	else:
		x = r - x - 1
	maxi.append(vec[x])
print(sum(mini), sum(maxi))


(n, l, r) = map(int, input().split())
minm = n - l + 1 + 2 * (2 ** (l - 1) - 1)
maxm = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
print(minm, maxm)


import sys
from collections import defaultdict

def main():
	(n, l, r) = map(int, input().split())

	def _min():
		s = 0
		pow2 = -1
		tot = 0
		diff = 0
		while diff < l:
			pow2 += 1
			diff += 1
			val = 1 << pow2
			s += val
			tot += 1
		while tot < n:
			s += 1
			tot += 1
		return s

	def _max():
		s = 0
		pow2 = -1
		tot = 0
		diff = 0
		while tot < n:
			if diff < r:
				pow2 += 1
				diff += 1
			val = 1 << pow2
			s += val
			tot += 1
		return s
	print(_min(), _max())
main()


(n, l, r) = map(int, input().split())
min = 0
if l == 1:
	min += 1
else:
	min += 2 ** l - 1
min += 1 * (n - l)
max = 0
if r == 1:
	max += 1
else:
	max += 2 ** r - 1
max += 2 ** (r - 1) * (n - r)
print(min, max)


(N, L, R) = map(int, input().split())
minimun = pow(2, L) - 1 + (N - L) * 1
maximum = pow(2, R) - 1 + (N - R) * pow(2, R - 1)
print(minimun, maximum)


(n, l, r) = map(int, input().split())
print(sum([pow(2, l - min(i, l - 1) - 1) for i in range(n)]), sum([pow(2, min(i, r - 1)) for i in range(n)]))


from sys import stdin
from collections import Counter
from math import sqrt, factorial, log10, log, floor, ceil
from itertools import permutations, combinations, combinations_with_replacement
input = stdin.readline

def li():
	return list(map(int, input().split()))

def lis():
	return list(map(str, input().split()))

def mp():
	return map(int, input().split())

def inp():
	return int(input())

def inps():
	return str(input().strip())

def pr(n):
	return stdout.write(str(n) + '\n')
INF = float('inf')

def solve():
	(n, l, r) = mp()
	x = n - l + 1
	y = 1
	for i in range(l - 1):
		x += 2 ** y
		y += 1
	mx = 1
	best = 1
	y = 1
	for i in range(r - 1):
		mx += 2 ** y
		if i == r - 2:
			best = 2 ** y
		y += 1
	for i in range(n - r):
		mx += best
	print(x, mx)
t = 1
for i in range(t):
	solve()


(n, l, r) = input().split()
(n, l, r) = (int(n), int(l), int(r))
x = []
y = []
for i in range(n - l + 1):
	x.append(1)
for j in range(1, n - len(x) + 1):
	x.append(2 ** j)
a = 2 ** (r - 1)
for k in range(0, n - r + 1):
	y.append(a)
c = 1
while len(y) < n:
	y.append(a / 2 ** c)
	c = c + 1
print(int(sum(x)), int(sum(y)))


import sys
import math

def scan(input_type='int'):
	return list(map(int, sys.stdin.readline().strip().split()))

def solution():
	(n, l, r) = scan()
	a = []
	b = []
	d = 2 ** (r - 1)
	for i in range(l):
		a.append(2 ** i)
	for i in range(r):
		b.append(2 ** i)
	for i in range(n - l):
		a.append(1)
	for i in range(n - r):
		b.append(d)
	print(sum(a), sum(b))
solution()


(n, l, r) = list(map(int, input().split()))
s = pow(2, r) - 1 + (n - r) * pow(2, r - 1)
m = pow(2, l) - 1 + (n - l)
print(m, s)


(n, l, r) = map(int, input().split())
mn = (2 ** (l - 1) - 1) * 2 + (n - l + 1)
mx = 2 ** (r - 1) - 1 + (n - r + 1) * 2 ** (r - 1)
print(mn, mx)


(n, l, r) = tuple(map(int, input().split()))
A = [2 ** i for i in range(l)] + [1 for i in range(n - l)]
B = [2 ** i for i in range(r - 1)] + [2 ** (r - 1) for i in range(n - r + 1)]
print(sum(A), sum(B))


(n, l, r) = map(int, input().split())
sum1 = n - l
sum2 = (n - r) * 2 ** (r - 1)
for i in range(l):
	sum1 += 2 ** i
for j in range(r):
	sum2 += 2 ** j
print(sum1, sum2)


(a, b, c) = map(int, input().split())
x = 0
y = 0
for i in range(0, b):
	x = x + 2 ** i
x = x + a - b
for i in range(0, c):
	y = y + 2 ** i
y = y + (a - c) * 2 ** (c - 1)
print(x, y)


(n, l, r) = map(int, input().split())
mi = 0
ma = 0
i = 1
c = 0
while l != 0:
	mi += i
	l -= 1
	c += 1
	i *= 2
mi += n - c
i = 1
c = 0
while r != 0:
	ma += i
	c += 1
	r -= 1
	i *= 2
ma += (n - c) * (i // 2)
print(mi, ma)


(N, L, R) = map(int, input().split())
A = 2 ** L - 1 + (N - L)
B = 2 ** R - 1 + 2 ** (R - 1) * (N - R)
print(A, B)


(n, l, r) = map(int, input().split())
templow = 0
count = 0
now = 1
while count < n:
	if count < l:
		templow += now
	else:
		templow += 1
	count += 1
	now *= 2
print(templow, end=' ')
temphigh = 0
last = 1
count = 0
now = 1
while count < n:
	if count < r:
		temphigh += now
		last = now
	else:
		temphigh += last
	count += 1
	now *= 2
print(temphigh)


from sys import stdin, stdout
(n, l, r) = [int(x) for x in stdin.readline().split()]
mn = 0
mx = 0
mn = (n - l + 1) * 1
p = 1
for i in range(n - l + 2, n + 1):
	mn += 2 ** p
	p += 1
mx = 1
if r > 1:
	l = 2
else:
	l = 1
for i in range(1, r):
	mx += 2 ** i
	l = 2 ** i
for i in range(r + 1, n + 1):
	mx += l
print(f'{mn} {mx}')


(a, b, c) = [int(item) for item in input().split()]
tmp = a
minimal = 0
while b != 1:
	minimal += 2 ** (b - 1)
	tmp -= 1
	b -= 1
minimal += tmp
tmp = a
maximal = 0
pownum = 0
while pownum != c - 1:
	maximal += 2 ** pownum
	pownum += 1
	tmp -= 1
maximal += tmp * 2 ** pownum
print(minimal, maximal)


(n, l, r) = map(int, input().split())
minx = 0
maxx = 0
for i in range(r):
	maxx += 2 ** i
maxx += 2 ** (r - 1) * (n - r)
for i in range(l):
	minx += 2 ** i
minx += 1 * (n - l)
print(minx, maxx)


(n, l, r) = input().strip().split(' ')
(n, l, r) = [int(n), int(l), int(r)]
s1 = 0
s2 = 0
for i in range(1, l):
	s1 += 2 ** i
for i in range(n - l + 1):
	s1 += 1
for i in range(r - 1):
	s2 += 2 ** i
for i in range(n - r + 1):
	s2 += 2 ** (r - 1)
print(s1, s2)


(n, l, r) = map(int, input().split())
min_ = []
max_ = []
while len(min_) < n:
	if l > 1:
		min_.append(2 ** (l - 1))
		l = l - 1
	else:
		min_.append(1)
i = 0
while len(max_) < n:
	if i < r - 1:
		max_.append(2 ** i)
	else:
		max_.append(2 ** (r - 1))
	i += 1
print(sum(min_), sum(max_))


(n, l, r) = map(int, input().split())
minimumArray = []
uniqueNumber = 1
while l > 0:
	minimumArray.append(uniqueNumber)
	uniqueNumber *= 2
	l -= 1
while len(minimumArray) < n:
	minimumArray.append(1)
maximumArray = []
uniqueNumber = 1
while r > 0:
	maximumArray.append(uniqueNumber)
	uniqueNumber *= 2
	r -= 1
while len(maximumArray) < n:
	maximumArray.append(uniqueNumber // 2)
print(sum(minimumArray), sum(maximumArray[0:n]))


(n, l, r) = map(int, input().split())
s = 2 ** min(n, r) - 1
s += 2 ** (min(n, r) - 1) * (n - min(n, r))
ms = 2 ** min(n, l) - 1 + n - min(n, l)
print(ms, s)


ll = lambda : list(map(int, input().split()))
testcases = 1
tp = [1]
for i in range(25):
	tp.append(tp[-1] * 2)
for testcase in range(testcases):
	[n, l, r] = ll()
	print(sum(tp[:l]) + n - l, sum(tp[:r]) + (n - r) * tp[r - 1])


(a, b, c) = map(int, input().split())
print(a - b + 2 ** b - 1, 2 ** c - 1 + (a - c) * 2 ** (c - 1))


from sys import stdin
from sys import setrecursionlimit as SRL
SRL(10 ** 7)
rd = stdin.readline
rrd = lambda : map(int, rd().strip().split())
(n, l, r) = rrd()
mx = 1 << r - 1
mn = 1 << l - 1
sml = 0
smr = 0
for i in range(l):
	sml += 1 << i
for i in range(r):
	smr += 1 << i
print(sml + n - l, smr + mx * (n - r))


import math
(n, l, r) = map(int, input().split())
z = r
min = []
for i in range(l):
	min.append(math.pow(2, i))
for j in range(n - l):
	min.append(1)
max = []
for x in range(n):
	max.append(math.pow(2, x))
	r -= 1
	if r == 0:
		break
if len(max) < n:
	for y in range(n - z):
		max.append(max[-1])
print(int(sum(min)), int(sum(max)), sep=' ')


(n, l, r) = map(int, input().split())
max_sum = 0
curr = 1
for i in range(r):
	max_sum += curr
	curr *= 2
curr //= 2
max_sum += (n - r) * curr
min_sum = 0
curr = 1
for i in range(l):
	min_sum += curr
	curr *= 2
min_sum += n - l
print(str(min_sum) + ' ' + str(max_sum))


def recur_factorial(n):
	if n == -1:
		return 0
	else:
		return 2 ** n + recur_factorial(n - 1)
(n, l, r) = map(int, input().split())
p = recur_factorial(l - 1)
min = n - l + p
q = recur_factorial(r - 1)
max = q + (n - r) * 2 ** (r - 1)
print(min, max)


(n, l, r) = map(int, input().split())
num = n - l
num2 = n - r
num3 = num2 * 2 ** (r - 1)
num += 2 ** l
num3 += 2 ** r
print(num - 1, num3 - 1)


(n, l, r) = map(int, input().split())
min = n - l + 1 + 2 * (2 ** (l - 1) - 1)
a = l - 1
max = 1 + 2 * (2 ** (r - 1) - 1)
max += (n - r) * 2 ** (r - 1)
print(min, max)


(n, l, r) = input().split(' ')
n = int(n)
l = int(l)
r = int(r)
if n >= l:
	if l > 1:
		min = (n - (l - 1)) * 1
		for i in range(1, l):
			min = min + 2 ** i
	else:
		min = n
if n >= r:
	if r > 1:
		max = 2 ** (r - 1) * (n - (r - 1))
		for j in range(r - 1):
			max = max + 2 ** (r - 2 - j)
	else:
		max = n
if n < r:
	max = 2 ** (n - 1) * (n - (n - 1))
	for j in range(n - 1):
		max = max + 2 ** (n - 2 - j)
print(min, end=' ')
print(max)


(n, l, r) = map(int, input().split())
b1 = 0
b2 = 0
a1 = 2 ** (l - 1)
a2 = 2 ** (r - 1)
for i in range(n):
	if 2 ** i <= a1:
		b1 += 2 ** i
	else:
		b1 += 1
	if 2 ** i <= a2:
		b2 += 2 ** i
	else:
		b2 += a2
print(b1, b2, sep=' ')


from __future__ import division, print_function
from sys import stdin, stdout
import itertools, os, sys, threading
from collections import deque, Counter, OrderedDict, defaultdict
import heapq
from math import ceil, floor, log, sqrt, factorial, pow, pi, gcd
from fractions import Fraction

def ii():
	return int(input())

def si():
	return str(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def fii():
	return int(stdin.readline())

def fsi():
	return str(stdin.readline())

def fmi():
	return map(int, stdin.readline().split())

def fli():
	return list(fmi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def dfs(v, c):
	if visited[v]:
		if col[v] != c:
			print('-1')
			exit()
		return
	col[v] = c
	visited[v] = 1
	for i in graph[v]:
		dfs(i, c ^ 1)

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d.keys():
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = {}
	for i in range(n):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans

def primeFactors(n):
	s = set()
	while n % 2 == 0:
		s.add(2)
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			s.add(i)
			n = n // i
	if n > 2:
		s.add(n)
	return s

def find_all(a_str, sub):
	start = 0
	while True:
		start = a_str.find(sub, start)
		if start == -1:
			return
		yield start
		start += len(sub)
(n, l, r) = mi()
a = []
x = 1
b = []
for i in range(n):
	a.append(1)
	b.append(x)
	x = x * 2
x = 2
for i in range(l - 1):
	a[i] = x
	x = x * 2
m = int(pow(2, r - 1))
x = 2
for i in range(1, r - 1):
	b[i] = x
	x = x * 2
for i in range(r - 1, n):
	b[i] = m
print(sum(a), sum(b))


(n, l, r) = map(int, str(input()).split())
a = [1]
b = [1]
dup = [1]
dupb = [1]
while len(b) < n + 1 and len(dupb) < l:
	temp = b.pop()
	b.append(temp)
	b.append(temp * 2)
	dupb.append(temp)
while len(b) < n:
	b.append(1)
while len(a) < n + 1 and len(dup) < r:
	temp = a.pop()
	a.append(temp)
	a.append(temp * 2)
	dup.append(temp)
while len(a) < n:
	temp = a.pop()
	a.append(temp)
	a.append(temp)
print(sum(b), sum(a))


(n, l, r) = map(int, input().split())
c = 1
s = s1 = 0
for i in range(l):
	s += c
	c *= 2
s += n - l
c = 1
for i in range(r):
	s1 += c
	c *= 2
s1 += c // 2 * (n - r)
print(s, s1)


(n, l, r) = (int(i) for i in input().split())
smin = 0
smax = 0
if l == 1:
	smin = n
else:
	smin += n - l
	for i in range(l):
		smin += 2 ** i
if r == 1:
	smax = n
else:
	for i in range(r):
		smax += 2 ** i
	smax += 2 ** i * (n - r)
print(smin, smax)


b = [2 ** i for i in range(1001)]
(n, l, r) = map(int, input().split())
(smin, smax) = (0, 0)
i = 0
smin = n - l + 1
smax = 0
for i in range(1, l):
	smin += b[i]
if r <= n:
	for j in range(r - 1):
		smax += b[j]
	smax += b[r - 1] * (n - (r - 1))
print(smin, smax)


from collections import defaultdict as DD
from bisect import bisect_left as BL
from bisect import bisect_right as BR
from itertools import combinations as IC
from itertools import permutations as IP
from random import randint as RI
import sys
MOD = pow(10, 9) + 7

def IN(f=0):
	if f == 0:
		return [int(i) for i in sys.stdin.readline().split()]
	else:
		return int(sys.stdin.readline())
(n, l, r) = IN()
mx = -166
mi = 9999999990999999
a = [1]
for i in range(23):
	a.append(a[-1] * 2)
for i in range(l, r + 1):
	r = a[:i]
	s = sum(r)
	p = n - len(r)
	if p >= 0:
		mi = min(mi, s + r[0] * p)
		mx = max(mx, s + r[-1] * p)
print(mi, mx)


(n, l, r) = map(int, input().split())
mi = 2 ** l - 1 + n - l
ma = 2 ** r - 1 + 2 ** (r - 1) * (n - r)
print(mi, ma)


(n, l, r) = map(int, input().split())
b = list()
p = 1
for i in range(r):
	b.append(p)
	p *= 2
p = p // 2
for i in range(len(b), n):
	b.append(p)
a = list()
p = 1
for i in range(l):
	a.append(p)
	p *= 2
for i in range(len(a), n):
	a.append(1)
mx = sum(b)
mn = sum(a)
print(mn, mx)


def line():
	return map(int, input().split())
(n, l, r) = line()
print(sum((2 ** i for i in range(l))) + n - l, sum((2 ** i for i in range(min(n, r)))) + (n > r) * 2 ** (r - 1) * (n - r))


(n, l, r) = list(map(int, input().split()))
ans = []
for i in range(l):
	ans.append(2 ** i)
minimum_sum = sum(ans) + (n - l)
for i in range(l, r):
	ans.append(2 ** i)
maximum_sum = sum(ans) + (n - r) * 2 ** (r - 1)
print(minimum_sum, maximum_sum)


(n, l, r) = list(map(int, input().split()))
start = [1]
ans = []
if l == 1:
	mini = start * n
	ans.append(str(sum(mini)))
else:
	add_ones = n - l
	mini = start * (add_ones + 1)
	for x in range(l - 1):
		mini.append(mini[-1] * 2)
	ans.append(str(sum(mini)))
if r == 1:
	maxi = start * n
	ans.append(str(sum(maxi)))
else:
	maxi = start
	add_big = r - 1
	for x in range(r - 1):
		maxi.append(maxi[-1] * 2)
	fill = n - r
	for x in range(fill):
		maxi.append(maxi[-1])
	ans.append(str(sum(maxi)))
print(' '.join(ans))


X = list(map(int, input().split()))
(Min, Max) = (0, 0)
Temp = 1
for i in range(X[1]):
	(Min, Temp) = (Min + Temp, Temp * 2)
Min += X[0] - X[1]
Temp = 1
for i in range(X[2]):
	(Max, Temp) = (Max + Temp, Temp * 2)
Max += Temp // 2 * (X[0] - X[2])
print(Min, Max)


(n, l, r) = map(int, input().split())
mians = 2 ** l - 1
mxans = 2 ** r - 1
mians += n - l
mxans += (n - r) * 2 ** (r - 1)
print(mians, mxans)


inp = input()
(l, mi, ma) = inp.split()
my = [1] * int(l)
my1 = [1] * int(l)
x = 1
i = 1
while x < int(mi):
	i = i * 2
	my[x] = i
	x += 1
mini = sum(my)
while x < int(ma):
	i = i * 2
	my[x] = i
	x += 1
my = my[:x]
maxi = sum(my) + i * (int(l) - len(my))
print(mini, maxi)


for _ in range(1):
	arr = list(map(int, input().strip().split()))
	a = arr[0]
	b = arr[1]
	c = arr[2]
	arr = []
	brr = []
	k = 1
	for i in range(b):
		arr.append(k)
		k = k * 2
	d = 1
	for j in range(c):
		brr.append(d)
		d = d * 2
	x = sum(arr)
	y = sum(brr)
	print(x + a - b, y + (a - c) * brr[c - 1])


(n, l, r) = map(int, input().split())
ans_min = n - l + 1
for i in range(1, l):
	ans_min += 2 ** i
ans_max = 0
for i in range(r):
	ans_max += 2 ** i
ans_max += 2 ** (r - 1) * (n - r)
print(ans_min, ans_max)


def solve(n, l, r):
	k = 1
	mini = 0
	while k <= l - 1:
		mini += 2 ** k
		k += 1
	mini += 1 + (n - l)
	k = 1
	maxi = 0
	while k <= r - 1:
		maxi += 2 ** k
		k += 1
	maxi += 1 + (n - r) * 2 ** (k - 1)
	return (mini, maxi)

def main():
	(n, l, r) = list(map(int, input().split()))
	print(*solve(n, l, r))
main()


(n, l, r) = map(int, input().split())
base = 0
x = 1
min = 2 ** l - 1 + n - l
max = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
print(min, max)


(n, l, r) = map(int, input().split())
(s, s1) = ([], [])
c = 0
for i in range(n):
	s.append(2 ** i)
	l -= 1
	if l == 0:
		break
x = n - len(s)
mi = sum(s) + 1 * x
for j in range(n):
	s1.append(2 ** j)
	r -= 1
	c += 1
	if r == 0:
		break
y = n - len(s1)
mx = sum(s1) + 2 ** (c - 1) * y
print(mi, mx)


def find(n, l, r):
	left = n - l + pow(2, l) - 1
	right = pow(2, r) - 1 + (n - r) * pow(2, r - 1)
	return (left, right)
(n, l, r) = list(map(int, input().strip().split(' ')))
(left, right) = find(n, l, r)
print(left, right)


(n, l, r) = map(int, input().split())
print(max(0, n - l) + pow(2, l) - 1, max(0, n - r) * pow(2, r - 1) + pow(2, r) - 1)


(n, l, r) = list(map(int, input().split()))
d = 0
min = 0
a = [0] * n
for i in range(n):
	if d == 0:
		a[i] = 1
		d += 1
	elif d == l:
		a[i] = 1
	else:
		a[i] = a[i - 1] * 2
		d += 1
min = sum(a)
a = [0] * n
d = 0
for i in range(n):
	if d == 0:
		a[i] = 1
		d += 1
	elif d >= l and d == r:
		a[i] = a[i - 1]
	elif d < r:
		a[i] = a[i - 1] * 2
		d += 1
max = sum(a)
print(min, max)


(n, l, r) = map(int, input().split())
new = n - l + 1
small = new
z = 1
for i in range(n - new):
	small += 2 ** z
	z += 1
z = 0
large = 0
for i in range(n):
	large += 2 ** z
	r -= 1
	if r == 0:
		break
	z += 1
for i in range(n - z - 1):
	large += 2 ** z
print(small, large)


(n, l, r) = map(int, input().split())
result = [1] * n
sums = [0, 0]
if l > 0:
	i = 0
	for j in range(l):
		if i < l - 1:
			i += 1
			result[j] = 2 ** i
	sums[0] = sum(result)
	i = 0
	result = [1] * n
	for j in range(1, n):
		if i < r - 1:
			i += 1
		result[j] = 2 ** i
	sums[1] = sum(result)
else:
	sums[0] = 4
	i = 0
	for j in range(n):
		if i < r - 1:
			i += 1
		result[j] = 2 ** i
	sums[1] = sum(result)
print(str(sums[0]) + ' ' + str(sums[1]))


from sys import stdin

def count(N, l, r):
	(resultmin, resultmax) = (0, 0)
	(fmax, smax) = (1, 1)
	for n in range(N):
		if l:
			resultmin += fmax
			fmax *= 2
			l -= 1
		else:
			resultmin += 1
		if r:
			resultmax += smax
			smax *= 2
			r -= 1
		else:
			resultmax += smax // 2
	return (resultmin, resultmax)

def main():
	num = list(map(int, stdin.readline().split()))
	result = count(num[0], num[1], num[2])
	print(result[0], result[1])
	return
main()


(n, l, r) = map(int, input().split())
p = 0
mis = 0
for i in range(n - l):
	mis += 2 ** 0
for i in range(n - (n - l)):
	mis += 2 ** p
	p += 1
print(mis, end=' ')
mas = 0
p = 0
for i in range(r - 1):
	mas += 2 ** p
	p += 1
for i in range(n - (r - 1)):
	mas += 2 ** p
print(mas)


(n, l, r) = map(int, input().split())
min_elements = list(map(lambda x: 2 ** x, range(1, l)))
max_elements = list(map(lambda x: 2 ** x, range(1, r)))
print(f'{sum(min_elements) + (n - l + 1)}', end=' ')
if n == r:
	print(f'{sum(max_elements) + 1}')
else:
	a = []
	if max_elements:
		a = [max_elements[-1]] * (n - r)
	print(f'{sum(max_elements) + sum(a) + (n - (len(max_elements) + len(a)))}')


(n, l, r) = [int(i) for i in input().split()]
c = 0
s = 1
f = 1
z = [1]
m = [1]
for i in range(l - 1):
	f = f * 2
	m.append(f)
y = len(m)
rem1 = n - l
for j in range(rem1):
	m.append(1)
print(sum(m), end=' ')
for j in range(r - 1):
	s = s * 2
	z.append(s)
lent = len(z)
rem = n - lent
for i in range(rem):
	z.append(z[-1])
print(sum(z))


(n, l, r) = map(int, input().split())
mi = [1] * n
ma = [1] * n
for i in range(1, l):
	mi[n - l + i] = 2 ** i
for i in range(1, n):
	if i < r:
		ma[i] = 2 ** i
	else:
		ma[i] = ma[i - 1]
print(sum(mi), sum(ma))


(n, l, r) = list(map(int, input().split()))
val1 = n - l - 1 + 2 ** l
val2 = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
print(val1, val2)


(n, l, r) = list(map(int, input().split()))
ma = 1
mi = 1
x = min(r - 1, n - 1)
y = min(l - 1, n - 1)
a = pow(2, x + 1) - 2
b = pow(2, y + 1) - 2
ma += a + pow(2, x) * (n - 1 - x)
mi += b + (n - y - 1)
print(mi, ma)


(n, l, r) = map(int, input().strip().split(' '))
min_sum = 0
max_sum = 0
for i in range(l):
	min_sum += 2 ** i
k = n - l
min_sum += k
for i in range(r):
	max_sum += 2 ** i
k = n - r
max_sum += k * 2 ** (r - 1)
print(min_sum, max_sum, end=' ')


(N, L, R) = map(int, input().split())
print(N - L + 2 ** L - 1, 2 ** R - 1 + 2 ** (R - 1) * (N - R))


(n, l, r) = map(int, input().split())
x = n - l + int(2 ** l) - 1
r = min(r, n)
y = (n - r) * int(2 ** (r - 1)) + int(2 ** r) - 1
print(x, y)


asd = str(input())
n = int(asd.split(' ')[0])
l = int(asd.split(' ')[1])
r = int(asd.split(' ')[2])
maximal = (n - (r - 1)) * 2 ** (r - 1) + sum([2 ** x for x in range(r - 1)])
minimal = n - (l - 1) + sum([2 ** x for x in range(1, l)])
print(minimal, end=' ')
print(maximal, end=' ')


(num, min, max) = map(int, input().split())
minimum_sum = 1 * (num - (min - 1))
for x in range(1, min):
	minimum_sum += 2 ** x
maximum_sum = 0
aux = 0
for x in range(0, max):
	aux = 2 ** x
	maximum_sum += aux
maximum_sum += aux * (num - max)
print(minimum_sum, maximum_sum)


def main():
	(n, l, r) = map(int, input().split())
	max_sum = 0
	for i in range(r):
		max_sum += 2 ** i
	max_sum += (n - r) * 2 ** (r - 1)
	min_sum = 0
	for i in range(l):
		min_sum += 2 ** i
	min_sum += n - l
	print(min_sum, max_sum)
main()


from sys import stdin
input = stdin.readline
(n, l, r) = [int(i) for i in input().split()]
min_sum = 2 ** l - 1 + n - l
max_sum = 2 ** (r - 1) * (n - r + 2) - 1
print(min_sum, max_sum)


(n, l, r) = map(int, input().split())
a = [1]
for q in range(l - 1):
	a.append(a[-1] * 2)
print(sum(a) + n - l, end=' ')
a = [1]
for q in range(r - 1):
	a.append(a[-1] * 2)
print(sum(a) + a[-1] * (n - r))


(n, l, r) = [int(x) for x in input().split()]
llst = []
mlst = []
llist = []
flist = []
for i in range(1, l):
	llst.append(int(2 ** i))
for i in range(r):
	mlst.append(int(2 ** i))
for _ in range(n - l + 1):
	llist.append(1)
for i in llst:
	if len(llist) == n:
		break
	llist.append(i)
mi = sum(llist)
t = int(2 ** r)
for _ in range(n):
	if _ >= r - 1:
		flist.append(mlst[r - 1])
	else:
		flist.append(mlst[_])
mx = sum(flist)
print(mi, mx)


(n, l, r) = map(int, input().split())
(elmax, elmin) = ([1], [1])
for i in range(1, r):
	elmax.append(2 * elmax[i - 1])
for i in range(1, l):
	elmin.append(2 * elmax[i - 1])
(min, max, summin, summax) = (0, 0, 0, 0)
for i in elmin:
	summin = summin + i
min = summin + (n - len(elmin))
for i in elmax:
	summax = summax + i
max = summax + (n - len(elmax)) * elmax[-1]
print(min, max, end=' ')


(a, b, c) = input().split()
ansa = 0
ansb = 0
for i in range(0, int(b)):
	ansa = ansa + 2 ** i
ansa = ansa + (int(a) - int(b))
for i in range(0, int(c)):
	ansb = ansb + 2 ** i
ansb = ansb + 2 ** (int(c) - 1) * (int(a) - int(c))
print(str(ansa) + ' ' + str(ansb))


(n, l, r) = map(int, input().split())
a = [1] * n
for i in range(1, l):
	a[i] = a[i - 1] * 2
r1 = sum(a)
a = [1] * n
for i in range(1, r):
	a[i] = a[i - 1] * 2
for i in range(r, n):
	a[i] = a[i - 1]
print(r1, sum(a))


from math import ceil
(n, l, r) = map(int, input().split())
a = []
b = []
num = 2 ** (l - 1)
for i in range(n):
	a.append(num)
	num = ceil(num / 2)
num = 1
for i in range(n):
	b.append(num)
	if num < 2 ** (r - 1):
		num *= 2
print(sum(a), sum(b))


from sys import stdin
(n, l, r) = (int(i) for i in stdin.readline().split())
m = 2 ** l - 1 + n - l
M = 2 ** r - 1 + 2 ** (r - 1) * (n - r)
print(m, M)


(n, l, r) = [int(x) for x in input().split(' ')]
lst_min = []
for i in range(0, l):
	lst_min.append(2 ** i)
lst_max = []
for i in range(0, r):
	lst_max.append(2 ** i)
del lst_min[0]
mini = 1 * (n - len(lst_min)) + sum(lst_min)
a = lst_max.pop()
maxi = a * (n - len(lst_max)) + sum(lst_max)
print(mini, maxi)


s = input().split()
n = int(s[0])
l = int(s[1])
r = int(s[2])
mins = 0
maxs = 0
k = 0
mins = pow(2, l) - 1 + (n - l)
maxs = pow(2, r) - 1 + pow(2, r - 1) * (n - r)
print(mins, maxs)


import os
import sys
import bisect
from math import gcd, ceil
from heapq import heapify, heappop, heappush
from io import BytesIO, IOBase

def main():
	(n, l, r) = map(int, input().split())
	s1 = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
	s2 = 2 ** l - 1 + (n - l)
	print(s2, s1)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = lambda s: self.buffer.write(s.encode()) if self.writable else None

	def read(self):
		if self.buffer.tell():
			return self.buffer.read().decode('ascii')
		return os.read(self._fd, os.fstat(self._fd).st_size).decode('ascii')

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline().decode('ascii')

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

def print(*args, sep=' ', end='\n', file=sys.stdout, flush=False):
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(end)
	if flush:
		file.flush()
(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
sys.setrecursionlimit(10000)
main()


(n, l, r) = map(int, input().split())
minsum = 0
maxsum = 0
for i in range(1, l + 1):
	minsum += 2 ** (i - 1)
minsum += n - l
for j in range(1, r + 1):
	maxsum += 2 ** (j - 1)
maxsum += (n - r) * 2 ** (r - 1)
print(minsum, maxsum)


(n, l, r) = input().split()
n = int(n)
l = int(l)
r = int(r)
m1 = 2 ** l - 1 + (n - l)
m2 = 2 ** r - 1 + 2 ** (r - 1) * (n - r)
print(str(m1) + ' ' + str(m2))


(n, l, r) = map(int, input().split())
a = n * [1]
b = n * [1]
suma = 0
sumb = 0
for i in range(1, r):
	a[i] = 2 * a[i - 1]
for i in range(r, n):
	a[i] = a[i - 1]
for i in range(1, l):
	b[i] = 2 * b[i - 1]
for i in range(n):
	suma += a[i]
	sumb += b[i]
print(sumb, suma)


from array import *
(x, l, r) = map(int, input().split())
z = 1
z1 = 1
sum = 0
sum1 = 0
a = array('i', [])
for i in range(0, min(x, 20) + 1):
	a.append(pow(2, i))
for n in a:
	if z1 <= l:
		sum1 = sum1 + n
	z1 = z1 + 1
sum1 = sum1 + (x - l) * a[0]
for y in a:
	if z <= r:
		sum = sum + y
	z = z + 1
sum = sum + (x - r) * a[r - 1]
print(sum1, sum)


a = [int(x) for x in input().split()]
b = [1] * a[0]
c = [1] * a[0]
mx = []
mn = []
for i in range(a[2]):
	mx.append(2 ** i)
for i in range(a[1]):
	mn.append(2 ** i)
if a[1] != 1:
	for i in range(1, a[0]):
		b[i] = 2 ** i
		if b[i] >= 2 ** a[1]:
			b[i] = mn[0]
if a[0] == a[2]:
	print(sum(b), sum(mx))
else:
	for i in range(1, len(c)):
		if c[i - 1] < mx[len(mx) - 1]:
			c[i] = 2 ** i
		else:
			c[i] = mx[len(mx) - 1]
	print(sum(b), sum(c))


(n, l, r) = map(int, input().split())
minimum = 0
mini = 1 << l - 1
m = n
s1 = 0
while mini > 1:
	s1 = s1 + mini
	mini = mini >> 1
	m -= 1
s1 = s1 + m
m = 1
s2 = 0
maxi = 1
while m < r:
	s2 = s2 + maxi
	maxi = maxi << 1
	m += 1
s2 = s2 + maxi * (n - m + 1)
print(s1, s2)


(n, l, r) = map(int, input().split())
asum = 0
bsum = 0
asum = 2 ** l - 1 + n - l
print(asum, end=' ')
bsum = 2 ** r - 1 + 2 ** (r - 1) * (n - r)
print(bsum)


(n, l, r) = list(map(int, input().split()))
power = 0
minimum = 0
for i in range(n):
	if power < l:
		minimum += 2 ** power
		power += 1
	elif power == l:
		minimum += 1
	else:
		raise Exception()
power = 0
maximum = 0
for i in range(n):
	maximum += 2 ** power
	if power < r - 1:
		power += 1
	elif power == r - 1:
		pass
	else:
		raise Exception()
print(minimum, maximum)


(n, l, r) = map(int, input().split())
a = n - l + (2 ** l - 1)
b = (n - r) * 2 ** (r - 1) + (2 ** r - 1)
print(a, b)


(n, l, r) = map(int, input().split())
t = n
lsum = 0
for i in range(l - 1, -1, -1):
	lsum = lsum + pow(2, i)
	t = t - 1
lsum = lsum + t
rsum = 0
t = n
for i in range(0, r):
	rsum = rsum + pow(2, i)
	t = t - 1
rsum = rsum + t * pow(2, r - 1)
print(lsum, rsum)


import sys
from collections import defaultdict as dc
from collections import Counter
from bisect import bisect_right
import math
(n, l, r) = map(int, input().split())
a = 0
b = 0
for i in range(n - l + 1):
	a += 1
for i in range(1, l):
	a += pow(2, i)
for i in range(r - 1):
	b += pow(2, i)
for i in range(n - r + 1):
	b += pow(2, r - 1)
print(a, b)


(n, l, m) = map(int, input().split())
print(2 ** l - 1 + n - l, 2 ** m - 1 + (n - m) * 2 ** (m - 1))


(n, l, r) = map(int, input().split())
if l == 1:
	min1 = n
if l > 1:
	min1 = 2 ** l - 1
	if n > l:
		min1 = min1 + n - l
max1 = 2 ** r - 1
if n > r:
	c = n - r
	max1 = max1 + 2 ** (r - 1) * c
print(min1, max1)


(n, l, k) = map(int, input().split())
minsum = 2 ** l - 1 + n - l
max_sum = 2 ** k - 1 + 2 ** (k - 1) * (n - k)
print(minsum, max_sum)


import sys
(n, l, r) = list(map(int, sys.stdin.readline().split()))
min_sum = 0
max_sum = 0
for val in range(l):
	min_sum += pow(2, val)
min_sum += n - l
max_sum = 0
for val in range(r):
	max_sum += pow(2, val)
max_sum += pow(2, r - 1) * (n - r)
print(min_sum, max_sum)


from sys import stdin
from math import sqrt, gcd, log10, log, ceil, floor

def ii():
	return int(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def li():
	return list(mi())

def si():
	return stdin.readline()
(n, l, r) = mi()
l -= 1
x = n - l
i = 2
for _ in range(l):
	x += i
	i *= 2
r -= 1
i = 2 ** r
y = i * (n - r)
i //= 2
while i:
	y += i
	i //= 2
print(x, y)


(n, l, r) = map(int, input().split())
arr1 = [1]
for i in range(1, l):
	arr1.append(2 ** i)
size1 = len(arr1)
arr2 = [1]
for i in range(1, r):
	arr2.append(2 ** i)
size2 = len(arr2)
min = sum(arr1) + 1 * (n - size1)
max = sum(arr2) + 2 ** (r - 1) * (n - size2)
print(min, max)


(n, l, r) = map(int, input().split())
degmas = [2 ** x for x in range(0, 21)]
dmin = 0
for i in range(l):
	dmin += degmas[i]
dmin += n - l
dmax = 0
for i in range(r):
	dmax += degmas[i]
dmax += (n - r) * degmas[r - 1]
print(dmin, dmax)


import sys
input = sys.stdin.readline
(n, l, r) = list(map(int, input().split()))
ANS0 = (1 << l) - 1 + (n - l)
ANS1 = (1 << r) - 1 + (n - r) * (1 << r - 1)
print(ANS0, ANS1)


(n, l, r) = list(map(int, input().split()))
ones = n - l + 1
rem = n - ones
dis = l - ones
minA = [1] * n
maxA = [1] * n
for i in range(n):
	if i < r:
		maxA[i] = pow(2, i)
	else:
		maxA[i] = maxA[r - 1]
for i in range(rem):
	minA[i] = pow(2, i + 1)
print(sum(minA), sum(maxA))


row = input()
(n, l, r) = row.split(' ')
n = int(n)
l = int(l)
r = int(r)
mi = 0
ma = 0
t = 1
for i in range(n - l + 1):
	mi += 1
for i in range(n - (n - l + 1)):
	t *= 2
	mi += t
t = 1
for i in range(r - 1):
	ma += t
	t *= 2
for i in range(n - (r - 1)):
	ma += t
print(str(mi) + ' ' + str(ma))


(n, l, r) = map(int, input().split())
(minList, maxList) = ([1], [1])
elem = 1
for i in range(r - 1):
	elem = elem * 2
	maxList.append(elem)
maxList += [elem] * (n - r)
elem = 1
for i in range(l - 1):
	elem = elem * 2
	minList.append(elem)
minList = [1] * (n - l) + minList
print(sum(minList), sum(maxList))


(n, l, r) = map(int, input().split())
t = l - 1
min = n - t
z = 2
for i in range(t):
	min += z
	z *= 2
max = 0
j = 1
i = 0
t = r
while i < n:
	max += j
	t -= 1
	i += 1
	if t > 0:
		j *= 2
	else:
		break
max += j * (n - i)
print(min, max)


(n, l, r) = map(int, input().split())
s = r - l + 1
a = []
i = 1
while i <= l - 1:
	a.append(pow(2, i))
	i += 1
a = a + [1] * (n + 1 - l)
b = [1]
i = 1
while i <= r - 1:
	b.append(pow(2, i))
	i += 1
b = b + [pow(2, r - 1)] * (n - r)
if len(b) != n:
	b = b + [1] * (n - len(b))
if len(a) != n:
	a = a + [1] * (n - len(a))
print(sum(a), sum(b))


(n, l, r) = map(int, input().split())
res = n - l
for i in range(l):
	res = res + (1 << i)
print(res, end=' ')
res = (n - r) * (1 << r - 1)
for i in range(r):
	res = res + (1 << i)
print(res)


(n, l, r) = map(int, input().split())
minimal_num = []
maximal_num = [1]
for _ in range(n - l + 1):
	minimal_num.append(1)
for _ in range(l - 1):
	minimal_num.append(minimal_num[-1] * 2)
for _ in range(1, r):
	maximal_num.append(maximal_num[-1] * 2)
for _ in range(n - r):
	maximal_num.append(maximal_num[-1])
print(sum(minimal_num), sum(maximal_num))


(n, l, r) = map(int, input().split())
q = 2 ** l - 1 + (n - l)
w = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
print(q, w)


cnt = 0
su = 0
r = []
q = []
x = []

def init(a):
	for p in range(len(a)):
		a[p] = int(a[p])
	return a
(n, l, r) = input().split()
n = int(n)
l = int(l)
r = int(r)
p = 1
for i in range(l):
	x.append(p)
	p = p * 2
mi = sum(x) + (n - l) * int(min(x))
p = 1
for j in range(r):
	q.append(p)
	p = p * 2
ma = sum(q) + (n - r) * int(max(q))
print(mi, ma)


(n, l, r) = map(int, input().split())
mini = n - l + 1 + 2 * (2 ** (l - 1) - 1)
maxe = (n - r + 1) * 2 ** (r - 1) + 1 * (2 ** (r - 1) - 1)
print(mini, maxe)


from sys import stdin
input = stdin.readline
(n, l, r) = map(int, input().split())
mi = 0
ma = 0
if l == 1:
	a = [1]
	mi = n
	ma = n
	if r != 1:
		k = 2
		for i in range(r - 1):
			a.append(k)
			k *= 2
		while len(a) < n:
			a.append(a[-1])
		ma = sum(a)
else:
	a = [1]
	k = 2
	for i in range(l - 1):
		a.append(k)
		k *= 2
	mi = sum(a) + (n - len(a))
	while len(a) < r:
		a.append(a[-1] * 2)
	while len(a) < n:
		a.append(a[-1])
	ma = sum(a)
print(mi, ma)


(n, l, r) = map(int, input().strip().split())
min_sum = 2 ** l - 1 + (n - l)
max_sum = 2 ** r - 1 + 2 ** (r - 1) * (n - r)
print(min_sum, max_sum)


(n, l, r) = map(int, input().split())
k = 0
max_sum = 0
min_sum = 0
maxi = n - r + 1
while k < r - 1:
	max_sum = max_sum + 2 ** k
	k += 1
max_sum += 2 ** k * maxi
k = l - 1
mini = n - l + 1
while k > 0:
	min_sum += 2 ** k
	k -= 1
min_sum += 2 ** k * mini
print(min_sum, max_sum)


def fmin(n, l):
	temp = 0
	for i in range(1, l):
		temp = temp + 2 ** i
	ans = n - l + 1 + temp
	return ans

def fmax(n, r):
	temp = 0
	for i in range(r - 1):
		temp = temp + 2 ** i
	ans = (n - r + 1) * 2 ** (r - 1) + temp
	return ans
a = list(map(int, input().split()))
strans = str(fmin(a[0], a[1]))
strans = strans + ' ' + str(fmax(a[0], a[2]))
print(strans)


(n, l, r) = [int(x) for x in input().split()]
a = 0
b = 0
for i in range(n - l + 1):
	a = a + 1
p = 2
x = n - l + 1
while x < n:
	a = a + p
	p = 2 * p
	x += 1
t = 1
for j in range(r):
	if j < r - 1:
		b = b + t
		t = 2 * t
	else:
		b = b + t
y = r
while y < n:
	b = b + t
	y += 1
print(a, b)


from math import pow
(n, l, r) = map(int, input().split())
minu = n - l
for i in range(l):
	minu += pow(2, i)
maxu = 0
while n > 0:
	maxu += pow(2, r - 1)
	if (r > 1) & (r == n):
		r -= 1
	n -= 1
print(int(minu), int(maxu))


import sys
import math
from collections import defaultdict
from collections import Counter
(n, l, r) = map(int, input().split())
a = []
a.append(1)
for i in range(1, 21):
	a.append(a[i - 1] * 2)
b = []
b.append(0)
for i in range(len(a)):
	b.append(b[i] + a[i])
m1 = b[l] + (n - l) * 1
m2 = b[r] + (n - r) * (b[r] - b[r - 1])
print(m1, m2)


(n, l, r) = list(map(int, input().split()))
m = [1 for i in range(n)]
for i in range(l):
	m[i] = 2 ** i
a = sum(m)
m = [2 ** (r - 1) for i in range(n)]
for i in range(r):
	m[i] = 2 ** i
b = sum(m)
print(a, b)


(n, l, r) = map(int, input().split())
if l == 1 and r == 1:
	print(n, n)
else:
	s1 = n - l + 1
	for i in range(1, n - s1 + 1):
		s1 += 2 ** i
	s2 = 0
	p = 0
	for i in range(0, r - 1):
		s2 += 2 ** i
		p = i
	print(s1, s2 + (n - r + 1) * 2 ** (p + 1))


x = [int(x) for x in input().split()]
n = x[0]
l = x[1]
r = x[2]
mina = []
maxa = []
a = 1
while len(mina) != l:
	mina.append(a)
	a *= 2
while len(mina) != n:
	mina.append(1)
a = 1
while len(maxa) != r:
	maxa.append(a)
	a *= 2
while len(maxa) != n:
	maxa.append(maxa[-1])
answer1 = 0
answer2 = 0
for i in mina:
	answer1 += i
for i in maxa:
	answer2 += i
print(answer1, answer2)


(n, l, r) = list(map(int, input().split()))
minsum = 0
maxsum = 0
t = 0
if l == 1:
	minsum = n
else:
	t = n - l + 1
	minsum = t
	for i in range(1, l):
		minsum = pow(2, i) + minsum
if r == 1:
	maxsum = n
else:
	maxsum = pow(2, r - 1) * (n - r + 1)
	for i in range(0, r - 1):
		maxsum = maxsum + pow(2, i)
print(minsum, end=' ')
print(maxsum)


(n, l, r) = map(int, input().split())
lower = 2 ** l + n - l - 1
upper = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
print(lower, upper)


l = list(map(int, input('').split()))
lent = l[0]
mino = l[1]
maxo = l[2]
minl = []
maxl = []
for i in range(mino):
	minl.append(2 ** i)
for i in range(maxo):
	maxl.append(2 ** i)
for i in range(lent - mino):
	minl.append(1)
for i in range(lent - maxo):
	maxl.append(maxl[-1])
print(sum(minl), sum(maxl))


s = list(map(int, input().split()))
(n, l, r) = (s[0], s[1], s[2])
min = 1 * (n - l + 1) + 2 ** l - 2
max = 1 + 2 ** r - 2 + (n - r) * 2 ** (r - 1)
print(min, max)


(n, l, r) = map(int, input().split())
mini = 0
i = 0
nn = 0
maxi = 0
while nn < l:
	mini += pow(2, nn)
	nn += 1
mini += n - l
nn = 0
while nn < r:
	maxi += pow(2, nn)
	nn += 1
maxi += (n - r) * pow(2, nn - 1)
print(mini, maxi)


def min_max(n, l, r):
	mini = n - (l - 1)
	rcopy = r
	while l - 1 > 0:
		mini += pow(2, l - 1)
		l -= 1
	maxi = 1
	lst = pow(2, r - 1)
	while r - 1 > 0:
		maxi += pow(2, r - 1)
		r -= 1
	return (mini, maxi + (n - rcopy) * lst)
(n, l, r) = map(int, input().split())
for result in min_max(n, l, r):
	print(result, end=' ')


(n, l, r) = map(int, input().split())
a = []
for i in range(n - l + 1):
	a.append(1)
k = n - len(a)
for i in range(1, k + 1):
	a.append(pow(2, i))
mini = sum(a)
b = []
maxi = 0
for i in range(0, r):
	b.append(pow(2, i))
	maxi = pow(2, i)
kk = len(b)
for i in range(n - kk):
	b.append(maxi)
maxi = sum(b)
print(mini, maxi)


(n, l, r) = [int(x) for x in input().split()]
minsum = n - l + 1
maxsum = 0
for i in range(1, l):
	minsum += 2 ** i
for i in range(0, r - 1):
	maxsum += 2 ** i
maxsum += 2 ** (r - 1) * (n - r + 1)
print(minsum, maxsum)


(n, l, r) = [int(i) for i in input().split()]
mx = 1 << r - 1
mn = 1 << l - 1
print(mn * 2 - 1 + n - l, mx * (2 + n - r) - 1)


x = input().split()
n = int(x[0])
l = int(x[1])
r = int(x[2])
min = n - l + 2 ** l - 1
max = (n - r) * 2 ** (r - 1) + 2 ** r - 1
out = str(min) + ' ' + str(max)
print(out)


a = input().split()
n = int(a[0])
l = int(a[1])
r = int(a[2])
cmin = 0
cmax = 0
cmin = n - l
rc = n
defff = 0
for i in range(r):
	cmax += 2 ** i
	rc -= 1
	rc1 = i
for i in range(rc):
	cmax += 2 ** rc1
for i in range(l):
	cmin += 2 ** i
print(cmin, cmax)


(n, l, r) = map(int, input().split())
min_sum = 0
min_sum += n - l + 1
current = 2
for x in range(n - min_sum):
	min_sum += current
	current *= 2
max_sum = 0
current = 1
for x in range(r):
	max_sum += current
	current *= 2
current //= 2
max_sum += (n - r) * current
print(min_sum, max_sum)


(n, l, r) = map(int, input().split())
mi = n - l
for i in range(l):
	mi += 2 ** i
ma = 0
co = 0
for i in range(r):
	co = 2 ** i
	ma += co
ma += co * (n - r)
print(mi, ma)


def sumgp(n):
	su = 2 ** n - 1
	return su

def nth(n):
	return 2 ** (n - 1)
(n, l, r) = map(int, input().split())
minans = sumgp(l) + (n - l)
maxans = sumgp(r) + nth(r) * (n - r)
print(minans, maxans)


(n, l, r) = list(map(int, input().split()))
mini = 0
if l >= n:
	mini = 2 ** l - 1
else:
	mini = 2 ** l - 1 + (n - l)
maxi = 0
if r <= n:
	maxi = 2 ** r - 1 + 2 ** (r - 1) * (n - r)
else:
	maxi = 2 ** n - 1
print(mini, maxi)


(n, l, r) = map(int, input().split())
if l == 1:
	mn = n * 1
else:
	mn = n - l + 1
	i = 2
	diff = 1
	while diff < l:
		mn += i
		i *= 2
		diff += 1
mx = 1
diff = 1
i = 1
while diff < r:
	i *= 2
	mx += i
	diff += 1
mx += (n - r) * i
print(mn, mx)


(n, l, r) = map(int, input().split())
sn = 0
sx = 0
f = n - l + 1
ix = 1
iy = 2 ** (r - 1)
z = n - r + 1
for i in range(f):
	sn += 1
for i in range(f, n):
	ix = ix * 2
	sn += ix
for i in range(z):
	sx += iy
for i in range(z, n):
	iy = iy // 2
	sx += iy
print(sn, sx)


(n, l, r) = (int(i) for i in input().split())
l = min(l, n)
r = min(r, n)
mn = n - l + 2 ** l - 1
mx = 2 ** r - 1 + 2 ** (r - 1) * (n - r)
print(mn, mx)
exit()
import math
s = input()
n = int(s, 2)
r = math.log(n, 4)
r = r // 1 + (r % 1 > 0)
print(int(r))


(n, l, r) = input().split()
(n, l, r) = [int(n), int(l), int(r)]
a = []
j = 1
for i in range(0, r):
	a.append(j)
	j *= 2
b = []
for i in range(0, l):
	b.append(a[i])
if len(b) != n:
	for i in range(len(b), n):
		b.append(1)
min = sum(b)
b = []
a = sorted(a, reverse=True)
for i in range(0, r):
	b.append(a[i])
if len(b) != n:
	for i in range(len(b), n):
		b.append(a[0])
max = sum(b)
print(min, max)


from sys import stdin, stdout
import math
[n, l, r] = [int(i) for i in stdin.readline().split()]
max = 0
min = 0
x = 1
min += n - l + 1
for i in range(l - 1):
	x = x * 2
	min += x
x = 1
for i in range(r):
	max += x
	x = x * 2
max += (n - r) * int(x / 2)
print('{} {}'.format(min, max))


(n, l, r) = [int(ele) for ele in input().split()]
min_s = n - l + 1
ele = 2
max_s = 0
while l > 1:
	min_s += ele
	ele *= 2
	l -= 1
ele = 1
R = r
while r > 0:
	max_s += ele
	ele *= 2
	r -= 1
ele /= 2
max_s += (n - R) * ele
print(min_s, int(max_s))


MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
(n, l, r) = I()
print(2 ** l - 1 + max(0, n - l), 2 ** min(n, r) - 1 + 2 ** (r - 1) * max(0, n - r))


(x, y, z) = input().split()
x = int(x)
y = int(y)
z = int(z)
t = 2 ** y - 1 + x - y
r = 2 ** z - 1 + (x - z) * 2 ** (z - 1)
print(t, r)


(a, b, c) = map(int, input().split())
v = [1]
for i in range(1, min(b, c)):
	v.append(2 ** i)
for i in range(a - len(v)):
	v.append(1)
x = [1]
for i in range(1, max(b, c)):
	x.append(2 ** i)
for i in range(a - len(x)):
	x.append(max(x))
print(sum(v), sum(x))


(n, l, r) = [int(i) for i in input().split()]
mi = 0
for i in range(l):
	mi += 2 ** i
mi += n - l
ma = 0
for i in range(r):
	ma += 2 ** i
ma += (n - r) * 2 ** (r - 1)
print('{:d} {:d}'.format(mi, ma))


def get_min(n, l):
	sum = 0
	for i in range(l):
		sum += pow(2, i)
	return sum + (n - l)

def get_max(n, r):
	sum = 0
	for i in range(r):
		sum += pow(2, i)
	return sum + (n - r) * pow(2, r - 1)
(n, l, r) = map(int, input().split())
print(get_min(n, l), get_max(n, r))


(n, l, r) = list(map(int, input().split()))
val = 1
i = 0
minn = 0
while i < l:
	minn += val
	val *= 2
	i += 1
minn += n - i
maxx = 0
val = 1
i = 0
while i < r:
	maxx += val
	val *= 2
	i += 1
val //= 2
maxx += (n - i) * val
print(minn, maxx)


arr = [int(t) for t in input().split()]
n = arr[0]
l = arr[1]
r = arr[2]
m = 1
j = 0
z = 1
b = list()
while j < n:
	if j >= n - l + 1:
		m *= 2
	b.append(m)
	j += 1
a = list()
v = r - 1
t = 2 ** (r - 1)
i = 0
while i < n:
	if i >= n - r + 1:
		v -= 1
		t = 2 ** v
	a.append(t)
	i += 1
print(sum(b), sum(a))


import os
import sys
debug = True
if debug and os.path.exists('input.in'):
	input = open('input.in', 'r').readline
else:
	debug = False
	input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())
test_count = 1
for t in range(test_count):
	if debug:
		print('Test Case #', t + 1)
	(n, l, r) = invr()
	min_x = 2 ** l - 1 + n - l
	max_x = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
	print(min_x, max_x)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
(n, l, r) = map(int, input().split())
minny = 0
cv0 = 0
for s in range(l):
	minny += 2 ** s
	cv0 += 1
minny += n - cv0
maxy = 1
maxsofar = 1
cv = 1
for s in range(1, r):
	maxy += 2 ** s
	cv += 1
	if 2 ** s > maxsofar:
		maxsofar = 2 ** s
maxy += maxsofar * (n - cv)
print(minny, maxy)


(n, l, r) = (int(i) for i in input().split())
a1 = [0 for i in range(n)]
a2 = [0 for i in range(n)]
for i in range(l):
	a1[i] = 1 << i
for i in range(l, n):
	a1[i] = 1
for i in range(r):
	a2[i] = 1 << i
for i in range(r, n):
	a2[i] = 1 << r - 1
print(str(sum(a1)) + ' ' + str(sum(a2)))


(a, b, c) = list(map(int, input().split()))
i = 1
d = []
while b != 1:
	i *= 2
	d.append(i)
	b -= 1
e = a - len(d)
while e != 0:
	d.append(1)
	e -= 1
j = 1
c -= 1
f = []
while c >= 1:
	f.append(j)
	c -= 1
	j *= 2
k = a - len(f)
while k != 0:
	f.append(j)
	k -= 1
print(sum(d), sum(f))


(n, l, r) = map(int, input().split())
min1 = n - l + 1
max1 = 0
i = 2
for j in range(l - 1):
	min1 += i
	i = i * 2
i = 1
for j in range(r - 1):
	max1 += i
	i = i * 2
max1 += (n - r + 1) * i
print(min1, max1)


k = []
for e in input().split(' '):
	k.append(int(e))
n = k[0]
l = k[1]
r = k[2]
minsum = 0
maxsum = 0
a = l - 1
b = 0
for i in range(0, n):
	minsum += 2 ** a
	if a != 0:
		a -= 1
	maxsum += 2 ** b
	if b != r - 1:
		b += 1
print(minsum, maxsum)


(n, l, r) = map(int, input().split())
x = n - l
for i in range(l):
	x += 2 ** i
y = 0
for i in range(r):
	y += 2 ** i
if n >= r:
	y += (n - r) * 2 ** (r - 1)
print(x, y)


(n, l, r) = map(int, input().split())
(mini, maxi) = (0, 0)
mini = 2 ** l - 1 + (n - l)
maxi = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
print(mini, maxi)


a = list(map(int, input().split()))[:3]
(n, l, r) = (a[0], a[1], a[2])
Min = n - l
i = 0
while i != l:
	Min += 2 ** i
	i += 1
Max = (n - r) * 2 ** (r - 1)
i = 0
while i != r:
	Max += 2 ** i
	i += 1
print(Min, Max)


def f(n, l, r):
	ma = []
	t = l
	while 2 ** (t - 1) > 1:
		ma.append(2 ** (t - 1))
		t -= 1
	for i in range(n - len(ma)):
		ma.append(1)
	la = []
	i = 0
	while len(la) < n:
		if len(set(la)) <= r:
			la.append(2 ** i)
			if len(set(la)) != r:
				i += 1
		else:
			la.append(2 ** i)
	print(sum(ma), sum(la))
(a, b, c) = input().split(' ')
f(int(a), int(b), int(c))


import sys
(n, l, r) = map(int, sys.stdin.readline().split())
a = list()
b = list()
for i in range(0, n):
	if i < l:
		a.append(2 ** i)
	else:
		a.append(1)
for i in range(n, 0, -1):
	if i >= r:
		b.append(2 ** (r - 1))
	else:
		b.append(2 ** (i - 1))
print(sum(a), sum(b))


(n, l, r) = map(int, input().split())
sm = 0
curr = 1
for _ in range(l):
	sm += curr
	curr *= 2
curr //= 2
for _ in range(n - l):
	sm += 1
sm2 = 0
curr2 = 1
for _ in range(r):
	sm2 += curr2
	curr2 *= 2
curr2 //= 2
for _ in range(n - r):
	sm2 += curr2
print(sm, sm2)


import sys
from collections import defaultdict
input = lambda : sys.stdin.readline().rstrip()
(n, l, r) = map(int, input().split())
print(n - l + 2 ** l - 1, end=' ')
print(2 ** (r - 1) * (n - r) + 2 ** r - 1)


def genMin(n, l):
	a = [2 ** x for x in range(1, l)]
	return sum(a) + (n - len(a))

def genMax(n, r):
	maxes = [2 ** x for x in range(0, n)]
	maxes = [maxes[r - 1] if x >= r - 1 else maxes[x] for x in range(0, n)]
	return sum(maxes)
(n, l, r) = input().split()
(n, l, r) = (int(n), int(l), int(r))
print(genMin(n, l), genMax(n, r))


(n, l, r) = map(int, input().split())
print(n - l + 1 + sum([2 ** i for i in range(1, l)]), end=' ')
print(sum([2 ** i for i in range(r)]) + max(n - r, 0) * 2 ** (r - 1))


a = list(map(int, input().split()))
n = a[0]
l = a[1]
r = a[2]
mi = 0
ma = 0
p = n
if l == 1:
	mi = n
else:
	mi = n
	for i in range(1, l):
		mi = mi - 1 + 2 ** i
if r == 1:
	ma = n
else:
	for i in range(0, r):
		ma += 2 ** i
	ma = ma + 2 ** i * (n - r)
print(mi, ma)


(n, l, r) = map(int, input().split())
minRes = 0
maxRes = 0
minRes = 1 * (n - l + 1)
temp = 2
for i in range(l - 1):
	minRes += temp
	temp *= 2
temp = 1
for i in range(r):
	maxRes += temp
	temp *= 2
maxRes += (n - r) * (temp // 2)
print(minRes, maxRes)


(n, l, r) = map(int, input().split())
(MIN, MAX, itr, tn, tl, tr) = (0, 0, 0, n, l - 1, r - 1)
l -= 1
r -= 1
while tn >= 0:
	if tl == 0:
		MIN += tn
		tn = 0
	else:
		MIN += 2 ** tl
	tl -= 1
	tn -= 1
while itr <= r:
	if itr == r:
		MAX += n * 2 ** r
		n = 0
	else:
		MAX += 2 ** itr
	n -= 1
	itr += 1
print(MIN, MAX)


(n, l, r) = list(map(int, input().split()))
sum1 = 2 ** l - 1 + (n - l)
sum2 = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
print(sum1, sum2)


(n, l, r) = input().split()
(sum1, sum2) = (0, 0)
(n, l, r) = (int(n), int(l), int(r))
if l == 1:
	sum1 = n
else:
	k = 2
	for i in range(l - 1):
		sum1 += k
		k *= 2
	sum1 += n - l + 1
p = 1
for i in range(r):
	sum2 += p
	p *= 2
p //= 2
sum2 += p * (n - r)
print(sum1, sum2)


(n, l, r) = map(int, input().split())
arr = [1] * n
mini = 0
maxi = 0
for i in range(l):
	mini += 2 ** i
mini += n - l
for i in range(r):
	maxi += 2 ** i
maxi += (n - r) * 2 ** i
print(mini, maxi)


(n, l, r) = tuple(map(int, input().split(' ')))
pows2 = [0] * 21
pows2[0] = 1
for i in range(1, 21):
	pows2[i] = pows2[i - 1] * 2
maxm = 0
maxm += pows2[r] - 1
maxm += (n - r) * pows2[r - 1]
minm = 0
minm += pows2[l] - 1
minm += n - l
print(str(minm) + ' ' + str(maxm))


(n, l, r) = map(int, input().split())
(s, k) = (1, [])
for i in range(l):
	k.append(s)
	s *= 2
p = sum(k) + (n - l)
for i in range(r - l):
	k.append(s)
	s *= 2
q = sum(k) + (n - r) * k[-1]
print(p, q)


(n, l, r) = map(int, input().split())
n1 = []
for i in range(n - l + 1):
	n1.append(1)
for i in range(1, l):
	n1.append(pow(2, i))
n2 = []
for i in range(r):
	n2.append(pow(2, i))
for i in range(n - r):
	n2.append(n2[r - 1])
print(str(sum(n1)) + ' ' + str(sum(n2)))


(n, l, r) = list(map(int, input().split()))
minlist = [1] * (n - l + 1)
maxlist = []
tmp = n - len(minlist)
cnt = 1
for i in range(tmp):
	cnt = cnt << 1
	minlist.append(cnt)
cnt = 1
for i in range(r):
	maxlist.append(cnt)
	cnt = cnt << 1
for i in range(n - r):
	maxlist.append(cnt >> 1)
minsum = 0
maxsum = 0
for i in range(n):
	minsum += minlist[i]
	maxsum += maxlist[i]
print(minsum, maxsum)


(n, l, r) = map(int, input().split())
s = n - l + 1
for i in range(l - 1):
	s += 2 ** (i + 1)
t = 2 ** (r - 1) * (n - r + 1)
for i in range(r - 1):
	t += 2 ** i
print(s, t)


z1 = []
z2 = []
(n, l, r) = map(int, input().split())
for x in range(l):
	z1.append(1 << x)
for x in range(r):
	z2.append(1 << x)
mn = sum(z1 + [1] * (n - l))
mx = sum(z2 + [z2[-1]] * (n - r))
print(mn, mx)


(n, l, r) = map(int, input().split())
(ans1, ans2) = (0, 0)
t = 1
for i in range(l):
	ans1 += t
	t *= 2
ans1 += n - l
t = 1
for i in range(r):
	ans2 += t
	t *= 2
ans2 += (n - r) * (t // 2)
print(ans1, ans2)


(n, l, r) = map(int, input().split())
low = 0
he = 0
low = n - l + 1
ii = 2
for i in range(low, n):
	low = low + ii
	ii = ii * 2
jj = 1
las = 0
for i in range(r):
	he += jj
	las = jj
	jj = jj * 2
he = he + las * (n - r)
print(low, he)


(n, l, r) = list(map(int, input().split(' ')))
mnres = 0
mxres = 0
mnres = 2 ** l - 1 + (n - l)
mxres = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
print(mnres, mxres)


(n, l, r) = map(int, input().split())
mini = [1]
x = 2
while len(mini) < l:
	mini.append(x)
	x *= 2
mini = mini + [1] * (n - len(mini))
maxi = []
x = 1
while len(maxi) < r:
	maxi.append(x)
	x *= 2
x //= 2
maxi = maxi + [x] * (n - len(maxi))
print(sum(mini), sum(maxi))


def lost(n, l, r):
	s1 = 0
	s2 = 0
	for j in range(l):
		s1 = s1 + 2 ** j
	for i in range(r):
		s2 = s2 + 2 ** i
	s1 = s1 + (n - l)
	s2 = s2 + (n - r) * 2 ** (r - 1)
	return str(s1) + ' ' + str(s2)
a = input().split()
n = int(a[0])
l = int(a[1])
r = int(a[2])
print(lost(n, l, r))


import math
q = 1
for i in range(q):
	(n, l, r) = map(int, input().split())
	min_sum = 0
	for i in range(l):
		min_sum += 2 ** i
	min_sum += n - l
	max_sum = 0
	for j in range(r):
		max_sum += 2 ** j
	max_sum += (n - r) * 2 ** (r - 1)
	print(min_sum, max_sum)


l = list(map(int, input().split()))
sum1 = 0
sum2 = 0
(n, a, b) = (l[0], l[1], l[2])
i = 0
while i < a:
	sum1 += 2 ** i
	i += 1
sum1 += n - a
i = 0
x = 1
while i < min(n, b):
	sum2 += 2 ** i
	x = 2 ** i
	i += 1
if n - b > 0:
	sum2 += x * (n - b)
print(sum1, sum2)


mod = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
(n, l, r) = f()
mnw = 0
if l == 1:
	mnw = n
else:
	q = 2 ** (l - 1)
	for i in range(n):
		mnw += q
		if q != 1:
			q //= 2
mxw = 0
x = 1
z = 1
for i in range(n):
	mxw += x
	if z < r:
		x *= 2
		z += 1
print(mnw, mxw)


(n, l, r) = list(map(int, input().split()))
upv = 1 + (2 ** (r - 1) * (n - r) + sum([2 ** item for item in range(1, r)]))
dv = 1 + (1 * (n - l) + sum([2 ** item for item in range(1, l)]))
print(dv, upv)


def solve(n, l, r):
	least = 2 ** l - 1 + (n - l)
	greatest = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
	return (least, greatest)
(n, l, r) = map(int, input().split())
print(' '.join([str(x) for x in solve(n, l, r)]))


(n, l, r) = map(int, input().split())
mn = n - l
for i in range(l):
	mn += 2 ** i
count_mx = n - r + 1
mx = 0
k = 0
for j in range(r - 1):
	mx += 2 ** j
	k = j + 1
mx += 2 ** k * (n - r + 1)
print(mn, mx)


(n, l, r) = input().split()
n = int(n)
l = int(l)
r = int(r)
arr = [1] * (n - l + 1)
num = 2
for i in range(l - 1):
	arr.append(num)
	num = num * 2
mini = sum(arr)
brr = []
cntr = r
num1 = 1
while cntr > 0:
	brr.append(num1)
	num1 = num1 * 2
	cntr = cntr - 1
final = brr[len(brr) - 1]
for i in range(n - len(brr)):
	brr.append(final)
maxi = sum(brr)
print(mini, maxi)


string = input().split(' ')
n = int(string[0])
l = int(string[1])
r = int(string[2])
arr = []
for i in range(r):
	arr.append(2 ** i)
for i in range(r, n):
	arr.append(arr[r - 1])
max = 0
for i in arr:
	max += i
arr2 = []
for i in range(l):
	arr2.append(2 ** i)
for i in range(l, n):
	arr2.append(arr2[0])
min = 0
for i in arr2:
	min += i
print(min, max)


(n, l, r) = map(int, input().split())
min = 0
max = 0
count1 = 0
for i in range(1, n + 1):
	if count1 < l:
		min += 2 ** count1
		count1 += 1
	else:
		min += 1
count2 = 0
for i in range(1, n + 1):
	if count2 < r - 1:
		max += 2 ** count2
		count2 += 1
	else:
		max += 2 ** count2
print(min, max)


(n, l, r) = [int(i) for i in input().strip().split()]
x = pow(2, l) - 1 + (n - l)
y = pow(2, r) - 1 + (n - r) * pow(2, r - 1)
print(x, y)


(n, L, R) = map(int, input().split())
print(n - L + sum((2 ** i for i in range(L))), 2 ** (R - 1) * (n - R) + sum((2 ** i for i in range(R))))


from sys import stdin
(n, l, r) = map(int, stdin.readline().split())
a = pow(2, l) - 1 + n - l
b = pow(2, r) - 1 + (n - r) * pow(2, r - 1)
print(a, b)


(n, l, r) = map(int, str(input()).strip().split())
minimum = 2 ** l - 1 + 1 * (n - l)
if n <= r:
	maximum = 2 ** n - 1
else:
	maximum = 2 ** r - 1 + 2 ** (r - 1) * (n - r)
print(minimum, maximum)


d = input()
d = d.split()
n = eval(d[0])
l = eval(d[1])
r = eval(d[2])
a = [1] * n
b = [1] * n
s = 0
q = 0
for i in range(0, l):
	a[i] = 2 ** i
for i in range(0, r):
	b[i] = 2 ** i
for i in range(l, n):
	a[i] = 1
for i in range(r, n):
	b[i] = 2 ** (r - 1)
for i in range(0, n):
	s = s + a[i]
	q = q + b[i]
print(s, q)


(n, l, r) = map(int, input().split())
s1 = 0
s2 = 0
for i in range(r):
	s2 += pow(2, i)
s2 += (n - r) * pow(2, i)
for i in range(l):
	s1 += pow(2, i)
s1 += n - l
print(s1, s2)


(n, l, r) = map(int, input().split(' '))
ans = []
minimum = []
p = n - l
while p > 0:
	minimum.append(1)
	p -= 1
while l > 0:
	minimum.append(2 ** (l - 1))
	l -= 1
maximum = []
q = n - r
c = 0
while r > 0:
	maximum.append(2 ** c)
	c += 1
	r -= 1
while q > 0:
	maximum.append(max(maximum))
	q -= 1
print(sum(minimum), sum(maximum))


(n, l, r) = map(int, input().split())
mn = n - l + 1
t = 2
ctmn = mn
while ctmn < n:
	mn += t
	ctmn += 1
	t = t * 2
mx = 1
t = 2
ctmx = 1
while ctmx < r:
	mx += t
	ctmx += 1
	t = t * 2
mx += t // 2 * (n - ctmx)
print(mn, mx)


import os
import sys
from math import *
from collections import *
from heapq import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
M = 998244353
EPS = 1e-06

def Ceil(a, b):
	return a // b + int(a % b > 0)

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
(n, l, r) = value()
mi = 1
ma = 1
c = 1
for i in range(l - 1):
	c *= 2
	mi += c
c = 1
for i in range(r - 1):
	c *= 2
	ma += c
mi += 1 * (n - l)
ma += c * (n - r)
print(mi, ma)


nlr = input().split()
(n, l, r) = (int(nlr[0]), int(nlr[1]), int(nlr[2]))
(a, b) = (0, 0)
for i in range(l):
	a += 1 << l - i - 1
a += n - l
for i in range(r):
	b += 1 << i
b += (n - r) * (1 << r - 1)
print(a, b)


po = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576]
(n, l, r) = map(int, input().split())
print(po[l] - 1 + n - l, end=' ')
print(po[r] - 1 + po[r - 1] * (n - r))


q = list(map(int, input().split()))
e = []
for i in range(q[0]):
	if q[2] == i + 1:
		r = [2 ** i] * (q[0] - i)
		break
	e.append(2 ** i)
e += r
t = [1] * (q[0] - q[1] + 1)
k = 1
for i in range(q[0] - q[1] + 2, q[0] + 1):
	t.append(2 ** k)
	k += 1
print(sum(t), sum(e))


(n, x, y) = map(int, input().split())
l = [1] * n
for i in range(1, x):
	l[i] = l[i - 1] * 2
xx = sum(l)
l = [1] * n
for i in range(1, y):
	l[i] = l[i - 1] * 2
for i in range(y, n):
	l[i] = l[i - 1]
print(xx, sum(l))


x = input().split()
n = int(x[0])
l = int(x[1])
r = int(x[2])
min1 = n - l
max1 = (n - r) * 2 ** (r - 1)
for i in range(0, max(l, r) + 1):
	if i < l:
		min1 += 2 ** i
	if i < r:
		max1 += 2 ** i
print(min1, max1)


import math
(n, l, r) = map(int, input().split())
max = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
min = 2 ** l + n - l - 1
print(min, max)


x = input().split()
n = int(x[0])
l = int(x[1])
r = int(x[2])
a = []
t = 1
for i in range(l):
	a.append(t)
	t = t * 2
b = [] * n
i = 0
while i < n - l + 1:
	b.append(a[0])
	i = i + 1
j = 1
for j in range(l - 1):
	b.append(a[j + 1])
sum = 0
for i in range(len(b)):
	sum = sum + b[i]
c = []
k = 1
for i in range(r):
	c.append(k)
	k = k * 2
u = [] * n
y = 0
while y < n - r + 1:
	u.append(c[len(c) - 1])
	y = y + 1
for g in range(r - 1):
	u.append(c[g])
sums = 0
for i in range(len(u)):
	sums = sums + u[i]
print(sum, sums)


a = [int(i) for i in input().split()]
sum1 = 0
sum2 = 0
for i in range(0, a[1]):
	sum1 = sum1 + 2 ** i
c = a[0] - (i + 1)
for i in range(0, a[2]):
	sum2 = sum2 + 2 ** i
b = a[0] - (i + 1)
while c != 0:
	sum1 = sum1 + 1
	c -= 1
while b != 0:
	sum2 = sum2 + 2 ** i
	b -= 1
print(sum1, sum2)


def main():
	data = input()
	(n, l, r) = map(int, data.split(' '))
	if n == 1:
		print(1, 1)
		return
	array = [1]
	value = 1
	for array_length in range(1, n + 1):
		if array_length == l:
			preliminary_sum = sum(array)
			min_sum = preliminary_sum + n - array_length
		if array_length == r:
			preliminary_sum = sum(array)
			max_sum = preliminary_sum + value * (n - array_length)
			break
		value = value * 2
		array.append(value)
	print(min_sum, max_sum)
main()


(n, l, r) = map(int, input().split())
ansmin = 0
ma = 1
for i in range(l):
	ansmin += ma
	if i != l - 1:
		ma *= 2
ansmin += n - l
ansmax = 0
ma = 1
for i in range(r):
	ansmax += ma
	if i != r - 1:
		ma *= 2
ansmax += (n - r) * ma
print(ansmin, ansmax)


(n, l, r) = list(map(int, input().split()))
k = [2 ** i for i in range(r)]
print(sum(k[:l]) + (n - l), sum(k) + (n - r) * k[r - 1])


data = [int(a) for a in input().split()]
maxim = 1 << data[1] - 1
a = 0
count = data[0]
while count:
	a += maxim
	if maxim > 2:
		maxim = maxim >> 1
	else:
		maxim = 1
	count -= 1
maxim = 1 << data[2] - 1
minis = 1
b = 0
count = data[0]
while count:
	b += minis
	if minis >= maxim:
		minis = maxim
	else:
		minis = minis << 1
	count -= 1
print(a, b)


(a, b, c) = list(map(int, input().split()))
d = a - (b - 1)
e = 1 * d
f = 0
for i in range(1, b):
	f = f + 2 ** i
small = e + f
g = 0
h = 0
for i in range(c):
	g = g + 2 ** i
	h = 2 ** i
k = a - c
large = g + k * h
print(small, large)


a = list(map(int, input().split()))
x = a[0] - (a[1] - 1)
d = x
for i in range(a[1] - 1):
	d = d + 2 ** (i + 1)
m = 0
for j in range(a[2]):
	m = m + 2 ** j
	c = 2 ** j
k = a[0] - a[2]
m = m + k * c
print(d, m)


b = input()
d = [int(x) for x in b.split()]
n = d[0]
l = d[1]
r = d[2]
mini = [1] * n
maxi = [1] * n
x = l - 1
z = r - 1
for i in range(1, n, 1):
	if x == 0:
		break
	else:
		mini[i] = 2 ** i
		x = x - 1
k = mini.index(max(mini))
for i in range(k + 1, n, 1):
	mini[i] = 1
for j in range(1, n, 1):
	if z == 0:
		break
	maxi[j] = 2 ** j
	z = z - 1
m = maxi.index(max(maxi))
for i in range(m, n, 1):
	maxi[i] = maxi[m]
print(sum(mini), sum(maxi))


lis = input().split()
(n, l, r) = (int(lis[0]), int(lis[1]), int(lis[2]))
l2 = pow(2, l)
lr = pow(2, r - 1)
ans1 = l2 - 1 + n - l
ans2 = 2 * lr - 1 + (n - r) * lr
print(ans1, ans2)


(n, a, b) = map(int, input().split())
print(2 ** a - 1 + n - a, 2 ** b - 1 + (n - b) * 2 ** (b - 1))


(n, l, r) = map(int, input().split())
mi = 0
for i in range(l):
	mi += 2 ** i
mi += n - l
mx = 0
for i in range(r - 1):
	mx += 2 ** i
mx += (n - r + 1) * 2 ** (r - 1)
print(mi, mx)


(n, l, r) = map(int, input().split())
m = n
a = 1
x = 0
A = []
B = []
while n > 0:
	if l == 1:
		A.append(1)
		n -= 1
	else:
		A.append(2 ** (l - 1))
		l -= 1
		n -= 1
while x < m:
	if a == r:
		B.append(2 ** (a - 1))
		x += 1
	else:
		B.append(2 ** (a - 1))
		x += 1
		a += 1
print(sum(A), sum(B))


[n, l, r] = list(map(int, input().split()))
arr1 = []
arr2 = []
for i in range(l):
	arr1.append(2 ** i)
s = []
arr3 = arr1.copy()
arr4 = arr1.copy()
t = max(arr1)
for j in range(n - l):
	arr3.append(1)
	arr4.append(t)
s.append(sum(arr3))
s.append(sum(arr4))
arr3 = []
arr4 = []
arr1 = []
for i in range(r):
	arr1.append(2 ** i)
arr3 = arr1.copy()
arr4 = arr1.copy()
t = max(arr1)
for j in range(n - r):
	arr3.append(1)
	arr4.append(t)
s.append(sum(arr3))
s.append(sum(arr4))
print(min(s), max(s))


nlr = list(map(int, input().split()))
n = nlr[0]
l = nlr[1]
r = nlr[2]
li = [0] * 2
if l == 1:
	li[0] = n * 1
else:
	for i in range(0, l):
		li[0] = li[0] + pow(2, i)
	li[0] = li[0] + (n - l)
for i in range(0, r):
	li[1] = li[1] + pow(2, i)
if r < n:
	li[1] = li[1] + (n - r) * pow(2, i)
print(li[0], end=' ')
print(li[1])


a = []
p = input()
p = p.split()
for i in p:
	a.append(int(i))
n = a[0]
l = a[1]
r = a[2]
min_sum = 0
max_sum = 0
x = 1
for i in range(1, n + 1):
	min_sum += x if i <= l else 1
	max_sum += x
	x *= 2 if i < r else 1
print(min_sum, max_sum)


(n, l, r) = map(int, input().split())
min_1 = 2 ** l - 1 + n - l
max_1 = 2 ** r - 1 + 2 ** (r - 1) * (n - r)
print(min_1, max_1)


def rint():
	return int(input())

def rints():
	return list(map(int, input().split()))
(n, l, r) = rints()
mi = 2 ** l - 1 + (n - l)
ma = 2 ** (r - 1) - 1 + (n - r + 1) * 2 ** (r - 1)
print(mi, ma)


(n, l, r) = list(map(int, input().split(' ')))
result = ''
minnum = 2 ** (l - 1)
maxnum = 2 ** (r - 1)
curr = 1
sum = 0
for m in range(n):
	sum += curr
	if curr < minnum and n - m <= l:
		curr *= 2
result += str(sum) + ' '
curr = 1
sum = 0
for m in range(n):
	sum += curr
	if curr < maxnum:
		curr *= 2
result += str(sum)
print(result)


(n, l, r) = map(int, input().split(' '))
a1 = 2 ** l - 1
a2 = n - l
b1 = 2 ** r - 1
b2 = (n - r) * 2 ** (r - 1)
print(a1 + a2, b1 + b2)


(n, a, b) = [int(i) for i in input().split()]
min = 2 ** a - 1 + (n - a)
max = 2 ** b - 1 + (n - b) * 2 ** (b - 1)
print(min, max)


(n, l, r) = map(int, input().split())
a = []
a.append(1)
x = 1
for i in range(int(r) - 1):
	x = x * 2
	a.append(x)

def minSum(n, l):
	min = []
	temp = n - l + 1
	j = 0
	while l - 1 > 0:
		min.append(a[j + 1])
		j += 1
		l -= 1
	tSum = temp + sum(min)
	return tSum

def maxSum(n, r, a):
	max = []
	temp = a[r - 1] * (n - r + 1)
	j = 0
	while r - 1 > 0:
		max.append(a[j])
		j += 1
		r -= 1
	tSum = temp + sum(max)
	return tSum
print(minSum(n, l), maxSum(n, r, a))


import bisect
import math
import collections
import sys
import copy
from functools import reduce
import decimal
from io import BytesIO, IOBase
import os
sys.setrecursionlimit(10 ** 9)
decimal.getcontext().rounding = decimal.ROUND_HALF_UP
graphDict = collections.defaultdict
queue = collections.deque

class Graphs:

	def __init__(self):
		self.graph = graphDict(list)

	def add_edge(self, u, v):
		self.graph[u].append(v)

	def dfs_utility(self, nodes, visited_nodes):
		visited_nodes.add(nodes)
		for neighbour in self.graph[nodes]:
			if neighbour not in visited_nodes:
				self.dfs_utility(neighbour, visited_nodes)
			else:
				return neighbour

	def dfs(self, node):
		Visited = set()
		self.dfs_utility(node, Visited)

	def bfs(self, node):
		visited = set()
		if node not in visited:
			queue.append(node)
			visited.add(node)
		while queue:
			parent = queue.popleft()
			print(parent)
			for item in self.graph[parent]:
				if item not in visited:
					queue.append(item)
					visited.add(item)

def rounding(n):
	return int(decimal.Decimal(f'{n}').to_integral_value())

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def inp():
	return sys.stdin.readline().strip()

def map_inp(v_type):
	return map(v_type, inp().split())

def list_inp(v_type):
	return list(map_inp(v_type))
(n, l, r) = map_inp(int)
minimum = 0
maximum = 0
for i in range(l):
	minimum += 1 << i
minimum += n - l
for j in range(r):
	maximum += 1 << j
maximum += (n - r) * (1 << r - 1)
print(minimum, maximum)


(n, mn, mx) = map(int, input().split())
smmn = 0
smmx = 0
for i in range(mn - 1, -1, -1):
	smmn += 2 ** i
smmn += n - mn
for i in range(mx - 1, -1, -1):
	smmx += 2 ** i
smmx += (n - mx) * 2 ** (mx - 1)
print(smmn, smmx)


(n, l, r) = map(int, input().split())
min = max = 0
for i in range(l):
	min += 2 ** i
for i in range(r):
	max += 2 ** i
min += n - l
max += (n - r) * 2 ** (r - 1)
print(min, max)


(n, l, r) = [int(x) for x in input().split()]
minnolist = []
for i in range(0, l):
	minnolist.append(2 ** i)
count = n - len(minnolist)
for j in range(0, count):
	minnolist.append(1)
maxnolist = []
for i in range(0, r):
	maxnolist.append(2 ** i)
count2 = n - len(maxnolist)
no = max(maxnolist)
for j in range(0, count2):
	maxnolist.append(no)
print(sum(minnolist), sum(maxnolist))


def f(l):
	(n, l, r) = l
	return [2 ** l - 1 + (n - l), 2 ** r - 1 + (n - r) * 2 ** (r - 1)]
l = list(map(int, input().split()))
print(*f(l))


def Sum(n):
	return int(pow(2, n)) - 1
(n, l, r) = map(int, input().split())
small = 0
if l < n:
	small = n - l + Sum(l)
elif l == n:
	small = Sum(l)
else:
	small = Sum(n)
large = 0
if r < n:
	large = (n - r) * int(pow(2, r - 1)) + Sum(r)
elif r == n:
	large = Sum(r)
else:
	large = Sum(n)
print(small, large)


(n, l, r) = map(int, input().split())
(min_list, max_list) = ([], [])
abc = 1
for i in range(n):
	if i < n - l + 1:
		min_list.append(1)
	else:
		min_list.append(2 ** abc)
		abc += 1
abc = 0
for j in range(n):
	max_list.append(2 ** abc)
	if j < r - 1:
		abc += 1
print(sum(min_list), sum(max_list))


(n, l, r) = map(int, input().split())
l = min(l, n)
r = min(n, r)
start = []
x = 1
for i in range(l):
	start.append(x)
	x *= 2
mn = sum(start) + (n - l)
start = []
x = 1
for i in range(r):
	start.append(x)
	x *= 2
mx = sum(start) + (n - r) * start[-1]
print(mn, mx)


(n, l, r) = map(int, input().split())

def min_sum(n, l):
	arr = []
	while len(arr) != n - l + 1:
		arr.append(1)
	for i in range(l - 1):
		arr.append(2 ** (i + 1))
	return sum(arr)

def max_sum(n, r):
	arr = []
	if r <= n:
		for i in range(r):
			arr.append(2 ** i)
		for j in range(n - r):
			arr.append(arr[-1])
	else:
		for i in range(n):
			arr.append(2 ** i)
	return sum(arr)
print(min_sum(n, l), max_sum(n, r))


(n, l, r) = map(int, input().split())
amin = 0
amin += n - (l - 1)
x = 2
for i in range(1, l):
	amin += x
	x *= 2
amax = 0
x = 1
for i in range(r - 1):
	amax += x
	x *= 2
amax += x * (n - r + 1)
print(amin, amax)


(n, l, r) = map(int, input().split())
mi = [0] * n
mx = [0] * n
a = 2 ** (r - 1)
for i in range(n):
	if i <= n - l:
		mi[i] = 1
	else:
		mi[i] = mi[i - 1] * 2
for i in range(n):
	if i <= n - r:
		mx[i] = a
	else:
		mx[i] = mx[i - 1] // 2
print(sum(mi), sum(mx))


(n, l, r) = map(int, input().split())
ansMin = 2 ** l - 1 + (n - l)
ansMax = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
print(ansMin, ansMax)


x = input()
xx = x.split()
n = int(xx[0])
l = int(xx[1])
r = int(xx[2])
s = []
p = 0
for i in range(0, l):
	p += 2 ** i
p = p + (n - l)
s.append(p)
p = 0
for i in range(0, r):
	p += 2 ** i
n -= r
p = p + n * 2 ** (r - 1)
s.append(p)
for i in s:
	print(i, end=' ')


(n, l, r) = map(int, input().split())
ans1 = n - (l - 1)
a = 1
for j in range(l - 1):
	a *= 2
	ans1 += a
ans2 = 1
a = 1
for j in range(r - 1):
	a *= 2
	ans2 += a
ans2 += a * (n - r)
print(str(ans1) + ' ' + str(ans2))


(n, l, r) = map(int, input().split())
ans1 = []
ans2 = []
k = 0
for i in range(n - l + 1):
	ans1.append(1)
for i in range(1, n - len(ans1) + 1):
	ans1.append(2 ** i)
for i in range(r):
	ans2.append(2 ** i)
	k = i
for i in range(n - r):
	ans2.append(2 ** k)
print(sum(ans1), sum(ans2))


import sys
input = sys.stdin.readline
(n, l, r) = map(int, input().split())
ans1 = n - (l - 1) + 2 ** l - 2
ans2 = 2 ** (r - 1) * (n - (r - 1)) + 2 ** (r - 1) - 1
print(ans1, ans2)


(len_arr, min_kind, max_kind) = map(int, input().split(' '))
if len_arr == 1:
	print('1 1')
	exit(0)
possible_min = len_arr - (min_kind - 1) + sum([2 ** x for x in range(1, min_kind)])
possible_max = sum([2 ** x for x in range(0, max_kind)]) + 2 ** (max_kind - 1) * (len_arr - max_kind)
print(f'{possible_min} {possible_max}')
exit(0)


smallest = 0
largest = 0
number = 1
array1 = [1]
array2 = [1]
while True:
	(n, l, r) = input().split()
	if 1 <= int(n) <= 1000 and 1 <= int(l) <= int(r) <= min(int(n), 20):
		break
while len(array1) <= int(n) - int(l):
	array1.append(1)
for i in range(int(l) - 1):
	number = number * 2
	array1.append(number)
number = 1
for i in range(int(r) - 1):
	number = number * 2
	array2.append(number)
while len(array2) < int(n):
	array2.append(number)
for i in range(int(n)):
	smallest = array1[i] + smallest
	largest = array2[i] + largest
print(str(smallest) + ' ' + str(largest))


(n, l, r) = [int(x) for x in input().split()]
x = int(2 ** l - 1 + (n - l))
print(x, end=' ')
x = int(2 ** r - 1)
y = int((n - r) * 2 ** (r - 1))
z = x + y
print(f'{z}')


from math import *
(n, l, r) = map(int, input().split(' '))
minSum = 0
maxSum = 0
for x in range(n):
	minSum += 2 ** max(l - x - 1, 0)
	maxSum += 2 ** min(x, r - 1)
print(minSum, maxSum)


(n, l, r) = list(map(int, input().split()))
mi = 2 ** l - 1 + (n - l)
mx = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
print(mi, mx)


def main():
	(n, l, r) = map(int, input().split())
	sum1 = 0
	sum2 = 0
	for i in range(r):
		sum1 += pow(2, i)
	for i in range(l):
		sum2 += pow(2, i)
	print(sum2 + (n - l), sum1 + (n - r) * pow(2, r - 1))
main()


(n, l, r) = eval(', '.join(input().split()))
(max_list, min_list) = ([1], [1])
min_list += [1] * (n - l)
while len(min_list) != n:
	min_list.append(min_list[-1] * 2)
for i in range(r - 1):
	max_list.append(max_list[-1] * 2)
while len(max_list) != n:
	max_list.append(max_list[-1])
print(sum(min_list), sum(max_list))


import math
(n, l, r) = input().split()
n = int(n)
l = int(l)
r = int(r)
i = 0
li = []
while i < l:
	li.append(int(math.pow(2, i)))
	i += 1
for i in range(n - l):
	li.append(int(math.pow(2, 0)))
j = 0
temp = []
while j < r:
	temp.append(int(math.pow(2, j)))
	j += 1
for k in range(n - r):
	temp.append(int(math.pow(2, r - 1)))
print(sum(li), sum(temp))


(n, l, r) = map(int, input().split())
c = 0
d = 0
for i in range(l):
	c = c + pow(2, i)
min = c + n - l
for i in range(r):
	d = d + pow(2, i)
f = pow(2, r - 1)
max = d + f * (n - r)
print(min, max)


(n, l, r) = map(int, input().split())
mn = n - l + 1
mx = 0
i = n - mn
a = 1
b = 1
for _ in range(i):
	a *= 2
	mn += a
for _ in range(r - 1):
	mx += b
	b *= 2
j = n - (r - 1)
mx += b * j
print(mn, mx)


import sys
from collections import defaultdict as dd
from itertools import permutations as pp
from itertools import combinations as cc
from collections import Counter as ccd
from random import randint as rd
from bisect import bisect_left as bl
from heapq import heappush as hpush
from heapq import heappop as hpop
mod = 10 ** 9 + 7

def ri(flag=0):
	if flag == 0:
		return [int(i) for i in sys.stdin.readline().split()]
	else:
		return int(sys.stdin.readline())
(n, l, r) = ri()
mi = []
get = min(l - 1, 20)
for i in range(n):
	if get < 0:
		mi.append(1)
	else:
		mi.append(max(2 ** get, 1))
	get -= 1
ma = []
get = 0
for i in range(n):
	ma.append(pow(2, min(get, r - 1)))
	get += 1
print(sum(mi), sum(ma))


(n, l, r) = [int(x) for x in input().split()]
minsum = n - (l - 1)
while l - 1 > 0:
	minsum += pow(2, l - 1)
	l -= 1
print(minsum, end=' ')
maxsum = (n - (r - 1)) * pow(2, r - 1)
while r - 2 >= 0:
	maxsum += pow(2, r - 2)
	r -= 1
print(maxsum)


def find_min(n, l, r):
	return 2 ** l - 1 + (n - l)

def find_max(n, l, r):
	return 2 ** r - 1 + (n - r) * 2 ** (r - 1)

def main():
	(n, l, r) = map(int, input().split())
	print(find_min(n, l, r), find_max(n, l, r))
main()


import sys

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
(n, l, r) = get_ints()
min = n - l + 1
max = 0
p = 1
d = l - 1
while d > 0:
	min += p << 1
	p = p << 1
	d -= 1
p = 1
d = r
while d > 0:
	max += p
	p = p << 1
	d -= 1
p = p >> 1
max += p * (n - r)
print(min, max)


(n, t, r) = map(int, input().split())
l = [int('1' + '0' * i, 2) for i in range(n)]
ma = sum(l[:r]) + l[r - 1] * (n - r)
mi = sum(l[:t]) + 1 * (n - t)
print(mi, ma)


from math import pow
(n, l, r) = map(int, input().split())
c = pow(2, r - 1)
d = pow(2, l) - 1
e = pow(2, r) - 1
maxm = (n - r) * c + e
minm = n - l + d
print(int(minm), end=' ')
print(int(maxm))


(a, b, c) = map(int, input().split())
m = 2 ** b - 1 + (a - b)
n = 2 ** c - 1 + (a - c) * 2 ** (c - 1)
print(str(m) + ' ' + str(n))


(n, l, r) = map(int, input().split())
min_one = n - (l - 1)
p = n - min_one
ans_min = min_one
t = 1
while p > 0:
	t = t * 2
	ans_min += t
	p -= 1
ans_max = 0
t = 1
max_count = n - (r - 1)
q = r - 1
while q > 0:
	ans_max += t
	t *= 2
	q -= 1
ans_max += max_count * t
print(ans_min, end=' ')
print(ans_max)


inp = input().split()
(inp[0], inp[1], inp[2]) = (int(inp[0]), int(inp[1]), int(inp[2]))
minimum = 0
for i in range(inp[1]):
	minimum += 2 ** i
minimum += inp[0] - inp[1]
maximum = 0
for i in range(inp[2]):
	maximum += 2 ** i
maximum += (inp[0] - inp[2]) * 2 ** (inp[2] - 1)
print(minimum, maximum)


(n, l, r) = map(int, input().split())
print(sum((1 << i for i in range(l))) + n - l, sum((1 << i for i in range(r))) + (n - r) * (1 << r - 1))


def main():
	line = input().split()
	n = int(line[0])
	l = int(line[1])
	r = int(line[2])
	s1 = 0
	s2 = 0
	p = 1
	for i in range(l):
		s1 += p
		p *= 2
	s1 += n - l
	p = 1
	for i in range(r):
		s2 += p
		p *= 2
	p //= 2
	s2 += (n - r) * p
	print(str(s1) + ' ' + str(s2))
main()


(n, l, r) = map(int, input().split())
(a, b) = (n - l + 1, (n - r + 1) * 2 ** (r - 1))
for i in range(1, l):
	a += 2 ** i
for i in range(r - 1):
	b += 2 ** i
print(a, b)


(n, l, r) = map(int, input().split())
minsum = n - l + 2 ** l - 1
maxsum = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
print(minsum, maxsum)


(n, l, r) = [int(x) for x in input().split()]
mn = 0
ll = l - 1
nn = n
while nn > 0:
	mn += 2 ** ll
	ll = max(ll - 1, 0)
	nn = nn - 1
mx = 0
rr = 0
nn = n
while nn > 0:
	mx += 2 ** rr
	rr = min(rr + 1, r - 1)
	nn = nn - 1
print(mn, mx)


(n, l, r) = list(map(int, input().split()))
mn = (1 << l) - 1 + (n - l)
mx = (1 << r) - 1 + (n - r) * (1 << r - 1)
print(str(mn) + ' ' + str(mx))


from bisect import *
from collections import *
from itertools import *
import functools
import sys
from math import *
from decimal import *
from copy import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 10 ** 5 + 10
MOD = 10 ** 9 + 7

def isprime(n):
	n = abs(int(n))
	if n < 2:
		return False
	if n == 2:
		return True
	if not n & 1:
		return False
	for x in range(3, int(n ** 0.5) + 1, 2):
		if n % x == 0:
			return False
	return True

def mhd(a, b):
	return abs(a[0] - b[0]) + abs(b[1] - a[1])

def charIN(x=' '):
	return sys.stdin.readline().strip().split(x)

def arrIN(x=' '):
	return list(map(int, sys.stdin.readline().strip().split(x)))

def eld(x, y):
	a = y[0] - x[0]
	b = x[1] - y[1]
	return (a * a + b * b) ** 0.5

def lgcd(a):
	g = a[0]
	for i in range(1, len(a)):
		g = math.gcd(g, a[i])
	return g

def ms(a):
	msf = -MAX
	meh = 0
	st = en = be = 0
	for i in range(len(a)):
		meh += a[i]
		if msf < meh:
			msf = meh
			st = be
			en = i
		if meh < 0:
			meh = 0
			be = i + 1
	return (msf, st, en)

def ncr(n, r):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % MOD
		den = den * (i + 1) % MOD
	return num * pow(den, MOD - 2, MOD) % MOD

def flush():
	return sys.stdout.flush()

def fac(n):
	ans = 1
	for i in range(1, n + 1):
		ans *= i
		ans %= MOD
	return ans
(n, l, r) = map(int, input().split())
mn = 2 ** l - 1 + 1 * (n - l)
mx = 0
l = []
for i in range(21):
	l.append(1 << i)
mx = sum(l[:r])
print(mn, mx + l[r - 1] * (n - r))


(n, l, r) = map(int, input().split())
min_ans = 0
max_ans = 0
for counter in range(1, n + 1):
	if counter < l:
		min_ans += 2 ** counter
	else:
		min_ans += 1
	if counter < r:
		max_ans += 2 ** (counter - 1)
	else:
		max_ans += 2 ** (r - 1)
print(min_ans, max_ans)


(n, l, r) = [int(s) for s in input().split(' ')]
min_val = 2 ** l - 2 + (n - l + 1)
max_val = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
print(min_val, max_val)


import sys
import math
from itertools import combinations

def get_line():
	return list(map(int, sys.stdin.readline().strip().split()))

def in1():
	return int(input())
(n, l, r) = get_line()
i = 1
b = []
c = []
while True:
	t1 = int(math.pow(2, i - 1))
	if i <= l:
		b.append(t1)
		c.append(t1)
	elif i > l and i <= r:
		c.append(t1)
	else:
		break
	i += 1
t1 = sum(b)
t2 = n - len(b) + t1
t3 = sum(c)
t4 = (n - len(c)) * c[-1] + t3
print(t2, t4)


(N, L, R) = map(int, input().split())
Min = N - L + (2 ** L - 1)
Max = 2 ** R - 1 + (N - R) * 2 ** (R - 1)
print(Min, Max)


(n, l, r) = map(int, input().split())
Min = 0
Max = 0
for i in range(l):
	Min += 2 ** i
Min += n - l
for i in range(r):
	Max += 2 ** i
	k = 2 ** i
Max += (n - r) * k
print(Min, Max)


pot = [2 ** i for i in range(0, 20)]
(n, l, r) = map(int, input().split(' '))
min_sum = n - (l - 1) + sum(pot[1:1 + (l - 1)])
max_sum = sum(pot[:r - 1]) + pot[r - 1] * (n - r + 1)
print(min_sum, max_sum)


def min_max(n, left, r):
	s = 0
	lt = left
	s += n - (lt - 1)
	s_m = (n - (r - 1)) * 2 ** (r - 1)
	lt -= 1
	r -= 1
	s += 2 * (2 ** lt - 1)
	s_m += 1 * (2 ** r - 1)
	return (s, s_m)
print(*min_max(*map(int, input().strip().split())))


from sys import stdin, stdout
import sys
INF = 100000000000.0
import bisect

def get_int():
	return int(stdin.readline().strip())

def get_ints():
	return map(int, stdin.readline().strip().split())

def get_array():
	return list(map(int, stdin.readline().strip().split()))

def get_string():
	return stdin.readline().strip()

def op(c):
	return stdout.write(c)
from collections import defaultdict
import math
(n, l, r) = get_ints()
ar1 = []
ar1.append(1)
r -= 1
ar2 = []
ar2.append(1)
l -= 1
(ans1, ans2) = (1, 1)
for i in range(1, n):
	if r >= 1:
		ar1.append(ar1[i - 1] * 2)
	else:
		ar1.append(ar1[i - 1])
	if l >= 1:
		ar2.append(ar2[i - 1] * 2)
	else:
		ar2.append(1)
	ans1 += ar1[i]
	ans2 += ar2[i]
	l -= 1
	r -= 1
print(ans2, ans1)


def get_max(n, l, r):
	max_ans = 0
	i = 0
	while r:
		max_ans += pow(2, i)
		i += 1
		r -= 1
	val = pow(2, i - 1)
	while n - i > 0:
		max_ans += val
		i += 1
	return max_ans

def get_min(n, l, r):
	min_val = n - l + 1
	x = n - min_val
	i = 1
	while x:
		min_val += pow(2, i)
		i += 1
		x -= 1
	return min_val
(n, l, r) = map(int, input().split())
print('{} {}'.format(get_min(n, l, r), get_max(n, l, r)))


(n, l, r) = [int(x) for x in input().split()]
arr = [2 ** i for i in range(21)]
ans1 = n - l + 1
for i in range(1, l):
	ans1 += arr[i]
ans2 = 0
for i in range(r - 1):
	ans2 += arr[i]
ans2 += arr[r - 1] * (n - r + 1)
print(ans1, ans2)


(n, l, r) = map(int, input().split())
g = n - l + 1
o = 1
a = []
b = []
for i in range(g):
	a.append(1)
for i in range(g, n):
	p = 2 ** o
	a.append(p)
	o = o + 1
min = sum(a)
k = n - r + 1
z = 2 ** (r - 1)
for i in range(k):
	b.append(z)
for i in range(k, n):
	z = z // 2
	b.append(z)
max = sum(b)
print(min, max)


(n, l, r) = map(int, input().split())
mini = 0
i = 0
nn = 0
maxi = 0
for i in range(100):
	pass
while nn < l:
	mini += pow(2, nn)
	nn += 1
mini += n - l
nn = 0
while nn < r:
	maxi += pow(2, nn)
	nn += 1
maxi += (n - r) * pow(2, nn - 1)
print(mini, maxi)


import sys
import math
(n, l, r) = map(int, input().strip().split(' '))

def fsum(i, rem=0):
	(s, ans) = (1, 0)
	for a in range(i):
		ans += s
		s *= 2
	ans += s // 2 * rem
	return ans
(minsum, maxsum) = (1, 1)
minsum = n - l + fsum(l)
maxsum = fsum(r, n - r)
print(minsum, maxsum)


def gpSum(n, a, r):
	return a * (r ** n - 1) / (r - 1)
(n, l, r) = [int(x) for x in input().split()]
ones = n - l + 1
mores = n - r + 1
minSum = ones
maxSum = mores * 2 ** (r - 1)
if l > 1:
	minSum += gpSum(n - ones, 2, 2)
if r > 1:
	maxSum += gpSum(n - mores, 1, 2)
print('%d %d' % (minSum, maxSum))


(n, l, r) = map(int, input().split())
mn = 1
cnt = 1
i = 2
while True:
	if cnt >= l:
		break
	mn = mn + i
	i = i * 2
	cnt = cnt + 1
mn = mn + (n - l)
mx = 1
cnt = 1
m = 1
i = 2
while True:
	if cnt >= r:
		break
	mx = mx + i
	cnt = cnt + 1
	if i > m:
		m = i
	i = i * 2
mx = mx + (n - r) * m
print(mn, mx)


(n, l, r) = [int(i) for i in input().split()]
s = 0
s1 = 0
for i in range(r):
	s += 2 ** i
for j in range(n - r):
	s += 2 ** (r - 1)
for k in range(l):
	s1 += 2 ** k
for l in range(n - l):
	s1 += 1
print(s1, s)


(a, b, c) = map(int, input().split())
d = []
(sum, sum1) = (0, 0)
for x in range(a):
	d.append(pow(2, x))
for x in range(b):
	sum = sum + d[x]
for x in range(c):
	sum1 = sum1 + d[x]
print(sum + (a - b), sum1 + d[x] * (a - c))


(n, l, r) = map(int, input().split())
mx = 0
if l == 1:
	mn = n
else:
	mn = n - l + 1
	p = mn
	q = 1
	for i in range(p, n):
		mn += 2 ** q
		q += 1
if r >= n:
	q = 0
	for i in range(n):
		mx += 2 ** q
		q += 1
else:
	for i in range(r):
		mx += 2 ** i
		p = 2 ** i
	for i in range(r, n):
		mx += p
print(mn, mx)


(n, l, r) = map(int, input().split())
minimum = 1
ans1 = 0
count = l
while count != 0:
	ans1 = ans1 + minimum
	minimum = minimum * 2
	count = count - 1
extra = n - l
ans1 = ans1 + extra
ans2 = 0
minimum = 1
count = r
while count != 0:
	ans2 = ans2 + minimum
	minimum = minimum * 2
	count = count - 1
extra = n - r
ans2 = ans2 + extra * (minimum // 2)
print(ans1, ans2)


(n, l, r) = [int(s) for s in input().split()]
(m1, m2) = (0, 0)
i = 1
(L, R) = (2 ** l, 2 ** r)
m1 = L - 1
m2 = R - 1
m1 += n - l
m2 += (n - r) * R // 2
print(m1, m2)


import math as mt
import sys, string
from collections import Counter, defaultdict
input = sys.stdin.readline
I = lambda : int(input())
M = lambda : map(int, input().split())
ARR = lambda : list(map(int, input().split()))

def printARR(arr):
	for e in arr:
		print(e, end=' ')
	print()

def main():
	(n, l, r) = M()
	num1 = {1}
	i = 1
	while len(num1) < l:
		num1.add(2 * i)
		i = i * 2
	num2 = set(list(num1).copy())
	while len(num2) < r:
		num2.add(2 * i)
		i = i * 2
	(a, b) = (0, 0)
	(num1, num2) = (list(num1), list(num2))
	num1.sort()
	num2.sort()
	a = sum(num1)
	b = sum(num2)
	a += (n - len(num1)) * num1[0]
	b += (n - len(num2)) * num2[-1]
	print(a, b)
tc = 1
for _ in range(tc):
	main()


(n, l, r) = map(int, input().split())

def mins():
	lx = 2 ** (l - 1)
	res = 0
	for i in range(n):
		res += lx
		if lx > 1:
			lx //= 2
	return res

def maxs():
	rmx = 2 ** (r - 1)
	rx = 1
	res = 0
	for i in range(n):
		res += rx
		if rx < rmx:
			rx *= 2
	return res
print(mins(), maxs())


(n, l, r) = map(int, input().split())
ans = 2 ** l - 1
ans1 = 2 ** r - 1
te = 2 ** (r - 1)
print(ans + (n - l), ans1 + (n - r) * te)


from sys import stdin
(n, l, r) = map(int, stdin.readline().strip().split())
lim = n - l + 1
mn = 0
for i in range(lim):
	mn += 1
x = 1
for i in range(lim, n):
	mn += 2 ** x
	x += 1
x = 1
mx = 0
for i in range(r):
	mx += x
	x = x * 2
x = x // 2
for i in range(r, n):
	mx += x
print(mn, mx)


(n, l, r) = list(map(int, input().split()))
pow = lambda y: 2 ** (y - 1)
(l, r) = (pow(l), pow(r))
ll = [l // 2 ** i if l // 2 ** i > 1 else 1 for i in range(n)]
rr = [2 ** i if 2 ** i <= r else r for i in range(n)]
print(sum(ll), sum(rr))


(n, l, r) = [int(i) for i in input().split()]
arr = [1] * n
l -= 1
curr = 2
for i in range(n - 1, n - 1 - l, -1):
	arr[i] = curr
	curr *= 2
mi = sum(arr)
arr = [1] * n
diff = 1
curr = 2
i = 0
for i in range(1, n):
	if diff == r:
		break
	arr[i] = curr
	curr *= 2
	diff += 1
while i < n:
	arr[i] = curr // 2
	i += 1
print(mi, sum(arr))


(n, l, r) = map(int, input().split())
mins = n - (l - 1)
t = 1
for i in range(l - 1):
	t *= 2
	mins += t
maxs = 1
t = 1
for i in range(r - 1):
	t *= 2
	maxs += t
maxs += (n - r) * t
print(mins, maxs)


(n, a, b) = map(int, input().split())
su = 0
for i in range(a - 1, 0, -1):
	su += 2 ** i
su += n - (a - 1)
print(su, end=' ')
su = 0
for i in range(n - b + 1, 0, -1):
	su += 2 ** (b - 1)
for i in range(0, b - 1):
	su += 2 ** i
print(su, end='')


l = list(map(int, input().split()))
s1 = 0
s2 = 0
s1 = l[0] - l[1] + 1
t = l[1] - 1
k = 1
while t > 0:
	s1 += 2 ** k
	k += 1
	t -= 1
k = 0
x = 0
t = l[2]
while x < l[0] and t > 0:
	s2 += 2 ** k
	k += 1
	x += 1
	t -= 1
if x < l[0]:
	s2 += (l[0] - x) * 2 ** (k - 1)
print(s1, end=' ')
print(s2)


(n, l, r) = map(int, input().split())
yy = l
yy -= 1
MIN = n - yy
MIN += 2 ** (yy + 1) - 2
MAX = 0
d = 1
c = 0
for i in range(n):
	if c != r:
		MAX += d
		d *= 2
		c += 1
	else:
		MAX += d // 2
print(MIN, MAX)


(n, l, r) = list(map(int, input().split()))
a = [1] * n
k = l - 1
for i in range(0, n):
	if k >= 0:
		a[i] = 2 ** k
		k = k - 1
	else:
		a[i] = 1
s1 = sum(a)
k = 0
for i in range(0, n):
	a[i] = 2 ** k
	if k < r - 1:
		k = k + 1
s2 = sum(a)
print(s1, s2)


li = list(map(int, input().split()))
n = li[0]
l = li[1]
r = li[2]
m1 = 1
m2 = 1
z = 1
a = 1
for i in range(l - 1):
	m1 = m1 + a * 2
	a = a * 2
for j in range(r - 1):
	m2 = m2 + z * 2
	z = z * 2
print(m1 + (n - li[1]), m2 + (n - r) * z)


(n, l, r) = map(int, input().split())
low = n - l + 1
high = (n - r + 1) * pow(2, r - 1)
for j in range(1, l):
	low += pow(2, j)
for i in range(r - 1):
	high += pow(2, i)
print(low, high)


(n, l, r) = [int(j) for j in input().split()]
mins = n - l + 1
prod = 1
for i in range(l - 1):
	prod *= 2
	mins += prod
maxs = 0
prod = 1
for i in range(r - 1):
	maxs += prod
	prod *= 2
maxs += prod * (n - r + 1)
print(mins, maxs)


x = [int(i) for i in input().split()]
(n, l, r) = (x[0], x[1], x[2])
minim = 0
if r > 20:
	r = min(n, 20)
	l = min(l, r)
(x1, y1) = (l, r)
x1 -= 1
for i in range(n - x1):
	minim = minim + 1
p = 2
for i in range(x1):
	minim += p
	p += p
start = 1
maxim = 0
x = 1
for i in range(y1 - 1):
	maxim += x
	x *= 2
for i in range(n - (y1 - 1)):
	maxim += x
print(minim, maxim)


(n, l, r) = map(int, input().split())
x = []
y = []
z = []
p = 0
for i in range(0, r):
	z.append(2 ** p)
	p = p + 1
for i in range(0, n - l + 1):
	x.append(z[0])
for i in range(1, l):
	x.append(z[i])
for i in range(0, n - r):
	y.append(z[len(z) - 1])
for i in range(0, r):
	y.append(z[i])
print(sum(x), sum(y))


import sys
Input = sys.stdin.readline
(n, l, r) = map(int, Input().split())
(Min, Max) = (0, 0)
(tmp1, tmp2) = (0, 0)
for i in range(0, l):
	Min += 2 ** i
Min += n - l
for i in range(r):
	Max += 2 ** i
Max += (n - r) * 2 ** i
print(Min, Max)


import math
I = lambda : int(input())
ID = lambda : map(int, input().split())
IL = lambda : list(ID())
(n, l, r) = ID()
arr1 = [0] * n
arr2 = [0] * n
i = n - 1
p = l
k = 0
j = 0
while i >= 0:
	arr1[i] = math.ceil(2 ** (p - 1))
	i -= 1
	p -= 1
	if p < 0:
		p = 1
while j < n:
	arr2[j] = math.ceil(2 ** k)
	j += 1
	k += +1
	if k >= r:
		k = r - 1
print(sum(arr1), sum(arr2))


mem = input().split()
n = int(mem[0])
l = int(mem[1])
r = int(mem[2])
minlist = [1]
element = 1
for i in range(1, l):
	element *= 2
	minlist.append(element)
minsum = sum(minlist) + n - l
maxlist = [1]
element = 1
for i in range(1, r):
	element *= 2
	maxlist.append(element)
maxsum = sum(maxlist) + element * (n - r)
print(minsum, maxsum)


from sys import stdin, stdout
from collections import defaultdict as df
import bisect
import math
(n, l, r) = list(map(int, input().split()))
mini = []
maxi = []
for i in range(l):
	mini.append(2 ** i)
for i in range(r):
	maxi.append(2 ** i)
sum1 = 0
count = 0
i = l - 1
for j in range(l):
	sum1 += 2 ** i
	i -= 1
	count += 1
if count < n:
	sum1 += n - count
sum2 = 0
count = 0
k = r - 1
for i in range(r):
	sum2 += 2 ** i
	count += 1
if count < n:
	sum2 = sum2 + (n - r) * 2 ** i
print(sum1, sum2)


(n, l, r) = map(int, input().split())
sum_min = 0
sum_max = 0
j = 1
for i in range(l):
	sum_min += j
	j = j * 2
sum_min += 1 * (n - l)
j = 1
for i in range(r):
	sum_max += j
	if i == r - 1:
		break
	j = j * 2
sum_max += j * (n - r)
print(sum_min, sum_max)


inp = input()
(n, l, r) = map(int, inp.split())
maximum = (n - r) * 2 ** (r - 1)
maximum += 2 ** r - 1
minimum = n - l
minimum += 2 ** l - 1
print(minimum, maximum)


(n, l, r) = map(int, input().split())
minimum = 0
maximum = 0
u1 = l
u2 = r
x1 = 1
x2 = 1
for i in range(n):
	if i > n - l:
		x1 *= 2
		minimum += x1
	else:
		minimum += x1
	if i < r - 1:
		maximum += x2
		x2 *= 2
	else:
		maximum += x2
print(f'{minimum} {maximum}')


(n, l, r) = map(int, input().split())
s1 = 0
k = 0
while k < n - l + 1:
	s1 += 1
	k += 1
cur = 2
for i in range(k, n):
	s1 += cur
	cur *= 2
s2 = 0
k = 0
cur = 1
while k < r - 1:
	s2 += cur
	cur *= 2
	k += 1
for i in range(k, n):
	s2 += cur
print(s1, s2)


from math import *
from collections import *

def getl(t=int):
	return [t(x) for x in input().split()]

def get(t=int):
	return t(input())
alphabet = [chr(x) for x in range(ord('a'), ord('z') + 1)]
(n, l, r) = getl()
x = n - l + 1
y = n - x
minimal = x
a = 1
b = 0
while y > 0:
	y -= 1
	a *= 2
	b += a
	minimal += a
x = n - r + 1
y = n - x
a = 1
b = 0
while y > 0:
	y -= 1
	a *= 2
	b += a
maximal = b + 1 + a * (x - 1)
print(minimal, maximal)


x = input()
(n, l, r) = x.split()
z = [0 for y in range(int(n))]
for i in range(int(n)):
	length = i
	p = 0
	for j in range(int(n)):
		z[i] += 2 ** p
		if length > 0:
			length -= 1
			p += 1
k = [0 for y in range(int(n))]
for i in range(int(n)):
	length = i
	p = 0
	for j in range(int(n)):
		k[i] += 2 ** p
		if length > 0:
			length -= 1
			p += 1
		else:
			p = 0
print(k[int(l) - 1], z[int(r) - 1])


(n, l, r) = map(int, input().split())
mi = []
ma = []
for i in range(l):
	mi.append(2 ** i)
for i in range(r):
	ma.append(2 ** i)
minSum = min(mi) * (n - l) + sum(mi)
maxSum = max(ma) * (n - r) + sum(ma)
print(minSum, maxSum)


(n, l, r) = map(int, input().split())
min_s = 2 ** l - 1 + n - l
max_s = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
print(min_s, max_s)


(n, l, r) = map(int, input().split())
arr = [1] * n
brr = [1] * n
v = 0
x = 1
while x < n:
	if v < r - 1:
		arr[x] = arr[x - 1] * 2
		v += 1
	else:
		arr[x] = arr[x - 1]
	x += 1
v = 0
x = 1
while x < n:
	if v < l - 1:
		brr[x] = brr[x - 1] * 2
		v += 1
	else:
		pass
	x += 1
print(str(sum(brr)) + ' ' + str(sum(arr)))


(n, l1, r) = map(int, input().split())
l = [1 for i in range(n)]
k = [2 ** (r - 1) for i in range(n)]
c = int(l1)
a = 1
for i in range(c - 1):
	a *= 2
	l[i] = a
mn = sum(l)
b = 2 ** (r - 1)
for i in range(r - 1):
	b /= 2
	k[i] = b
mx = sum(k)
print(int(mn), int(mx))


(n, l, r) = [int(x) for x in input().split()]
mmin = n - (l - 1)
cur = 1
for _ in range(l - 1):
	cur *= 2
	mmin += cur
mmax = (n - (r - 1)) * 2 ** (r - 1)
cur = 1
for _ in range(r - 1):
	mmax += cur
	cur *= 2
print(mmin, mmax)


(n, l, r) = [int(i) for i in input().split()]
print((1 << l) - 1 + n - l, (1 << r) - 1 + (n - r) * (1 << r - 1))


(n, l, r) = map(int, input().split())
minn = 0
maxx = 0
minn += n - l + 1
l -= 1
while l > 0:
	minn += 2 ** l
	l -= 1
temp = r
r -= 1
while r >= 0:
	maxx += 2 ** r
	r -= 1
n -= temp
maxx += n * 2 ** (temp - 1)
print('{} {}'.format(minn, maxx))


gi = lambda : list(map(int, input().split()))
(n, l, r) = gi()
mians = 2 ** l - 1 + n - l
maans = 2 ** r - 1 + 2 ** (r - 1) * (n - r)
print(mians, maans)


import math
(n, l, r) = input().split()
n = int(n)
l = int(l)
r = int(r)
l = l - 1
r = r - 1
ls = []
rs = []
d = 1
for i in range(n - l):
	ls.append(d)
for i in range(l):
	j = int(math.pow(2, i + 1))
	ls.append(j)
rs.append(d)
for i in range(r):
	j = int(math.pow(2, i + 1))
	rs.append(j)
for i in range(n - (r + 1)):
	if r == 0:
		j = 1
	rs.append(j)
print(sum(ls), end=' ')
print(sum(rs))


(n, l, r) = map(int, input().split())
ans1 = n - l + 1
val = 2
for i in range(1, l):
	ans1 += val
	val *= 2
print(ans1, end=' ')
val = 1
ans1 = 0
for i in range(0, r):
	ans1 += val
	val *= 2
val /= 2
for i in range(r, n):
	ans1 += val
ans1 = int(ans1)
print(ans1)


(n, l, r) = map(int, input().split())
(minz, maxz) = ([], [])
for i in range(l):
	minz.append(2 ** i)
minz.append(n - l)
for i in range(r):
	maxz.append(2 ** i)
maxz.append(max(maxz) * (n - r))
print(sum(minz), sum(maxz))


(n, l, r) = [int(i) for i in input().split(' ')]
min_arr = []
max_arr = [1]
for i in range(n - (l - 1)):
	min_arr.append(1)
for i in range(l - 1):
	x = min_arr[-1] * 2
	min_arr.append(x)
for i in range(n - 1):
	if len(set(max_arr)) < r:
		max_arr.append(max_arr[-1] * 2)
	else:
		max_arr.append(max_arr[-1])
print(sum(min_arr), sum(max_arr))


(n, l, r) = map(int, input().split())
min_sum = []
k = 1
for i in range(l):
	min_sum.append(k)
	k *= 2
odds = n - len(min_sum)
for odd in range(odds):
	min_sum.append(min_sum[0])
max_sum = []
k = 1
for i in range(r):
	max_sum.append(k)
	k *= 2
odds = n - len(max_sum)
for odd in range(odds):
	max_sum.append(max_sum[-1])
print(sum(min_sum), sum(max_sum))


import math
(n, l, r) = map(int, input().split())
minimal = 0
maximal = 0
minimal = int(math.pow(2, l) - 1 + n - l)
if r > n:
	r = n
maximal = int((n - r + 2) * math.pow(2, r - 1) - 1)
print(minimal, maximal)


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
import sys
input = sys.stdin.readline
scanner = lambda : int(input())
string = lambda : input().rstrip()
get_list = lambda : list(read())
read = lambda : map(int, input().split())
get_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // math.gcd(a, b)

def is_integer(n):
	return math.ceil(n) == math.floor(n)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(beauty, s, n, count):
	pass
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
alphs = 'abcdefghijklmnopqrstuvwxyz'
from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect

def solve():
	(n, l, r) = read()
	leftans = n - l + 1
	rightans = 0
	val = 2
	for i in range(l - 1):
		leftans += val
		val *= 2
	val = 1
	for i in range(r):
		rightans += val
		val *= 2
	val //= 2
	for i in range(r, n):
		rightans += val
	print(leftans, rightans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for i in range(1):
	solve()


(n, l, r) = list(map(int, input().split()))
min_l = [1]
max_num = 1
for i in range(n - 1):
	if i < l - 1:
		min_l.append(max_num * 2)
		max_num = max_num * 2
	else:
		min_l.append(1)
max_l = [1]
max_num = 1
for i in range(n - 1):
	if i < r - 1:
		max_l.append(max_num * 2)
		max_num = max_num * 2
	else:
		max_l.append(max_num)
print(sum(min_l), sum(max_l))


(n, l, r) = [int(x) for x in input().split(' ')]
s_min = 2 ** l - 1 + n - l
s_max = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
print(s_min, s_max)


(n, l, r) = [int(x) for x in input().split()]
print(pow(2, l) + n - l - 1, pow(2, r - 1) * (n - r + 2) - 1)


def naiveSolve(n):
	return

def main():
	(n, l, r) = readIntArr()
	ans1 = 0
	sameElements = n - l + 1
	ans1 += sameElements
	x = 2
	for _ in range(l - 1):
		ans1 += x
		x *= 2
	ans2 = 0
	x = 1
	for _ in range(r):
		ans2 += x
		x *= 2
	x //= 2
	sameElements = n - r + 1
	ans2 += x * (sameElements - 1)
	print('{} {}'.format(ans1, ans2))
	return
import sys
input = sys.stdin.buffer.readline

def oneLineArrayPrint(arr):
	print(' '.join([str(x) for x in arr]))

def multiLineArrayPrint(arr):
	print('\n'.join([str(x) for x in arr]))

def multiLineArrayOfArraysPrint(arr):
	print('\n'.join([' '.join([str(x) for x in y]) for y in arr]))

def readIntArr():
	return [int(x) for x in input().split()]

def makeArr(defaultValFactory, dimensionArr):
	dv = defaultValFactory
	da = dimensionArr
	if len(da) == 1:
		return [dv() for _ in range(da[0])]
	else:
		return [makeArr(dv, da[1:]) for _ in range(da[0])]

def queryInteractive(l, r):
	print('? {} {}'.format(l, r))
	sys.stdout.flush()
	return int(input())

def answerInteractive(x):
	print('! {}'.format(x))
	sys.stdout.flush()
inf = float('inf')
MOD = 10 ** 9 + 7
from math import gcd, floor, ceil
for _abc in range(1):
	main()


(n, a, b) = map(int, input().split())
m = 1
s = 0
d = 1
ma = 1
e = 1
for j in range(1, a):
	s = s + 2 * d
	d = 2 * d
m = m + s + (n - a)
c = 1
for j in range(1, b):
	ma += 2 * e
	e = 2 * e
	c = c + 1
ma = ma + e * (n - c)
print(m, ma)


(n, l, r) = map(int, input().split())
p = 2
rr = r
mins = maxs = 0
wax = l - 1
while wax:
	mins += p
	p *= 2
	wax -= 1
p = 1
while r:
	maxs += p
	p *= 2
	r -= 1
p //= 2
print(mins + n - (l - 1), maxs + p * (n - rr))


(n, l, r) = map(int, input().split())
summ = 2 ** l
summ += n - l - 1
summ2 = 2 ** r - 1
summ2 += (n - r) * 2 ** (r - 1)
print(summ, end=' ')
print(summ2)


(n, l, r) = map(int, input().split())
(mi, ma) = ([], [])
du = n - l
mi += du * [1]
i = 1
while l > 0:
	mi += [i]
	l -= 1
	i *= 2
du = n - r
i = 1
while r > 0:
	ma.append(i)
	r -= 1
	i *= 2
i /= 2
for j in range(du):
	ma.append(int(i))
print(sum(mi), sum(ma))


import math
(n, l, r) = map(int, input().split())
k = pow(2, l - 1)
k2 = pow(2, r - 1)
(min1, max1) = (0, 0)
for i in range(l):
	min1 += pow(2, i)
min1 += n - l
if r < n:
	for i in range(r):
		max1 += pow(2, i)
	max1 += (n - r) * pow(2, r - 1)
else:
	for i in range(r):
		max1 += pow(2, i)
print(min1, max1)


data = input()
split = data.split()
n = int(split[0])
l = int(split[1])
r = int(split[2])
minimum = n - l + 2 ** l - 1
maximum = (n - r) * 2 ** (r - 1) + 2 ** r - 1
print(minimum, maximum)


(n, l, r) = map(int, input().split())
a = [1 << i for i in range(20)]
x = a[:l]
y = a[:r]
amin = sum(x) + (n - l)
amax = sum(y) + (n - r) * y[-1]
print(amin, amax)


import sys
input = sys.stdin.readline

def getInt():
	return int(input())

def getVars():
	return map(int, input().split())

def getArr():
	return list(map(int, input().split()))

def getStr():
	return input().strip()
(N, L, R) = getVars()
minSum = 2 ** L - 1 + (N - L)
maxElem = 2 ** (R - 1)
maxSum = 2 ** R - 1 + (N - R) * maxElem
print(minSum, maxSum)


import math
(n, l, r) = input().split()
n = int(n)
l = int(l)
r = int(r)
M = (n - r) * int(math.pow(2, r - 1)) + int(math.pow(2, r)) - 1
m = n - l + int(math.pow(2, l)) - 1
print(m, end=' ')
print(M)


def func(a, b):
	c = 2 ** b - 1
	d = (a - b) * 2 ** (b - 1)
	return c + d

def fun(a, b):
	c = 2 ** b - 1
	d = a - b
	return c + d
(n, l, r) = list(map(int, input().strip().split()))
print(fun(n, l), func(n, r))


(n, l, r) = map(int, input().split())
a = []
p = 1
for k in range(l):
	a.append(p)
	p *= 2
for k in range(l, n):
	a.append(1)
mn = sum(a)
mx = 0
b = []
v = 2 ** (r - 1)
for i in range(r):
	b.append(v)
	v //= 2
for i in range(r, n):
	b.append(2 ** (r - 1))
mx = sum(b)
print(mn, mx)


def f(x):
	r = 1
	for i in range(1, x):
		r += 2 ** i
	return r
(n, l, r) = map(int, input().split())
print(n - l + f(l), f(r) + 2 ** (r - 1) * (n - r))


(n, l, r) = input().split()
(n, l, r) = (int(n), int(l), int(r))
minlst = [1]
while len(minlst) < n:
	if l > n - len(minlst):
		for i in range(1, n - len(minlst) + 1):
			minlst.append(2 ** i)
		break
	else:
		minlst.append(1)
maxlst = [1]
while len(maxlst) < n:
	if r > len(maxlst):
		maxlst.append(2 ** len(maxlst))
	else:
		maxlst.append(maxlst[-1])
sum1 = sum(minlst)
sum2 = sum(maxlst)
print(f'{sum1} {sum2}')


import sys
sys.setrecursionlimit(10 ** 5 + 1)
inf = int(10 ** 20)
max_val = inf
min_val = -inf
RW = lambda : sys.stdin.readline().strip()
RI = lambda : int(RW())
RMI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
RWI = lambda : [x for x in sys.stdin.readline().strip().split()]
(given, left, rite) = RMI()
mins = [1]
for i in range(2, left + 1):
	mins.append(mins[-1] * 2)
for i in range(left + 1, given + 1):
	mins.append(1)
maxs = [1]
for i in range(2, rite + 1):
	maxs.append(maxs[-1] * 2)
for i in range(rite + 1, given + 1):
	maxs.append(maxs[-1])
print(sum(mins), sum(maxs))


(n, l, r) = map(int, input().split())
p = 2 ** l
s = p - 1
num = n - l
minsum = s + num
p = 2 ** r
s = p - 1
num = n - r
maxsum = s + num * (p // 2)
print(minsum, maxsum)


(n, l, r) = [int(x) for x in input().split()]
a = []
i = 0
for i in range(22):
	a.append(2 ** i)
min_sum = 0
max_sum = 0
for j in range(l - 1, 0, -1):
	min_sum += a[j]
min_sum += n - l + 1
for i in range(r):
	j = i
	max_sum += a[i]
p = n - r
max_sum += p * a[j]
print(min_sum, max_sum)


def li():
	return list(map(int, input().split()))

def num():
	return map(int, input().split())

def nu():
	return int(input())

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
mm = 1000000007

def solve():
	t = 1
	for tt in range(t):
		(n, l, r) = num()
		mn = [0] * n
		cc = 0
		pp = 1
		while cc < l:
			mn[cc] = pp
			pp *= 2
			cc += 1
		ox = 0
		for i in range(cc, n):
			mn[i] = 1
		mx = [0] * n
		cc = 0
		pp = 1
		while cc < r:
			mx[cc] = pp
			cc += 1
			pp *= 2
		for i in range(cc, n):
			mx[i] = pp // 2
		print(sum(mn), sum(mx))
solve()


(n, l, r) = map(int, input().split())
minSum = 2 ** l - 1 + (n - l)
maxSum = 2 ** r - 1 + 2 ** (r - 1) * (n - r)
print(minSum, maxSum)


inp = input().split()
n = int(inp[0])
l = int(inp[1])
r = int(inp[2])
mn = 2 ** l - 1 + n - l
mx = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
print(mn, mx)


(n, L, R) = map(int, input().split())
minn = (1 << L) - 1 + (n - L)
maxx = (1 << R) - 1 + (n - R) * (1 << R - 1)
print(minn, maxx)


list1 = [int(x) for x in input().split()]
N = list1[0]
l = list1[1]
r = list1[2]
listf = []
listm = []
k = 1
for i in range(l):
	listf.append(k)
	k = k * 2
for i in range(N - l):
	listf.insert(0, 1)
minsum = sum(listf)
j = 1
list_ex = []
for i in range(r):
	list_ex.append(j)
	j = j * 2
listm.extend(list_ex)
ele = listm[-1]
for i in range(N - r):
	listm.append(ele)
maxsum = sum(listm)
print(minsum, maxsum, end=' ')


(n, l, r) = map(int, input().split())
mnm = n - l + pow(2, l) - 1
mxm = (n - r) * pow(2, r - 1) + pow(2, r) - 1
print(mnm, mxm)


import math
import sys

def mislove(n, l, r):
	minSum = 0
	maxSum = 0
	maxNum = 0
	for i in range(0, r):
		if i == r - 1:
			maxNum = 2 ** i
		maxSum += 2 ** i
		if i == l - 1:
			minSum = maxSum
	minSum += n - l
	maxSum += (n - r) * maxNum
	print('{} {}'.format(minSum, maxSum))
nums = sys.stdin.readline().split(' ')
mislove(int(nums[0]), int(nums[1]), int(nums[2]))


import math

def main():
	(n, l, r) = tuple([int(x) for x in input().split()])
	min = 2 ** l - 1 + (n - l)
	max = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
	print(str(min) + ' ' + str(max))
main()


from collections import defaultdict, Counter
import copy, math
from copy import deepcopy
i = 0
ar = []
while i <= 50:
	ar.append(2 ** i)
	i += 1
(n, l, r) = map(int, input().split())
lmi = [1] * (n - l) + ar[:l]
lma = ar[:r]
lma += [lma[-1]] * (n - r)
print(sum(lmi), sum(lma))


import math
(n, l, r) = map(int, input().split())
arr = []
ans = []
for i in range(l):
	arr.append(math.pow(2, i))
ans.append(int(sum(arr) + n - l))
brr = []
for i in range(r):
	brr.append(math.pow(2, i))
ans.append(int(sum(brr) + math.pow(2, r - 1) * (n - r)))
print(' '.join((str(elem) for elem in ans)))


(n, l, r) = [int(x) for x in input().split()]
minn = 0
ma = 2 ** (l - 1)
for i in range(n):
	if ma == 1:
		minn += 1
	else:
		minn += ma
		ma = ma // 2
ma = 2 ** (r - 1)
if ma == 1:
	maxx = n
	print(minn, maxx)
	exit()
maxx = 0
x = ma
i = 0
while ma != 1:
	i += 1
	maxx += ma
	ma = ma // 2
maxx += 1
i += 1
z = n - i
maxx += x * z
print(minn, maxx)


def main_function():
	(n, l, r) = [int(i) for i in input().split(' ')]
	min_a_sum = n - l + 2 ** l - 1
	max_a_sum = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
	return f'{min_a_sum} {max_a_sum}'
print(main_function())


import os
import sys
from io import BytesIO, IOBase

def solution(n, l, r):
	if n == 1:
		write(1, 1)
		return
	power = set()
	for i in range(r):
		power.add(2 ** i)
	power = sorted(power)
	if len(power) < n:
		power.extend([power[-1]] * (n - len(power)))
	high_res = sum(power)
	power = set()
	for i in range(l):
		power.add(2 ** i)
	power = sorted(power)
	lower = [1] * (n - len(power)) + power
	low_res = sum(lower)
	write(low_res, high_res)

def main():
	(n, l, r) = r_array()
	solution(n, l, r)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def write(*args, end='\n'):
	for x in args:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(end)

def r_array():
	return [int(x) for x in input().split()]

def r_int():
	return int(input())

def w_array(arr):
	for x in arr:
		write(x, end=' ')
	write()
main()


(n, l, r) = map(int, input().split())
t = []
m = []
k = 0
for j in range(0, n):
	if j + 1 <= n - l + 1:
		m.append(1)
	else:
		k = k + 1
		m.append(2 ** k)
for i in range(0, n):
	if i + 1 <= r:
		t.append(2 ** i)
	else:
		t.append(2 ** (r - 1))
print('%d %d' % (sum(m), sum(t)))


def mp():
	return map(int, input().split())
(n, l, r) = mp()
min_s = n - l + 2 ** l - 1
max_s = (n - r) * 2 ** (r - 1) + 2 ** r - 1
print(min_s, max_s)


(a, b, c) = list(map(int, input().split()))
minimal = 0
arr5 = []
val = 1
elements = 0
while b != 0:
	arr5.append(val)
	val *= 2
	elements += 1
	b -= 1
while a - elements != 0:
	arr5.append(1)
	elements += 1
maximal = 0
arr6 = []
val = 1
elements = 0
while c != 0:
	arr6.append(val)
	val *= 2
	elements += 1
	c -= 1
val = int(val / 2)
while a - elements != 0:
	arr6.append(val)
	elements += 1
print(sum(arr5), sum(arr6))


(n, l, r) = [int(x) for x in input().split()]

def s(x):
	return sum((2 ** k for k in range(x)))
mn = s(l) + n - l
mx = s(r) + (n - r) * 2 ** (r - 1)
print(mn, mx)


(n, l, r) = map(int, input().split())
cmini = []
for i in range(l - 1, -1, -1):
	cmini.append(pow(2, i))
cmini += [1] * (n - len(cmini))
cmaxi = []
for i in range(r):
	cmaxi.append(pow(2, i))
cmaxi += [cmaxi[-1]] * (n - len(cmaxi))
print(sum(cmini), sum(cmaxi))


import math
l1 = list(map(int, input().split()))
(n, l, r) = (l1[0], l1[1], l1[2])
p = pow(2, r - 1)
s = 0
for i in range(r):
	s += pow(2, i)
for i in range(n - r):
	s += p
s1 = 0
for i in range(l):
	s1 += pow(2, i)
for i in range(n - l):
	s1 += 1
print(s1, s)


from sys import stdin
(n, l, r) = map(int, stdin.readline().rstrip().split(' '))
min_sum = (1 - 2 ** l) // (1 - 2) + n - l
max_sum = (1 - 2 ** r) // (1 - 2) + (n - r) * 2 ** (r - 1)
print(min_sum, max_sum)


(n, l, r) = map(int, input().split())
minvals = sum([2 ** i for i in range(l)])
minvals += n - l
maxvals = sum([2 ** i for i in range(r)])
maxvals += (n - r) * 2 ** (r - 1)
print(minvals, maxvals)


(a, b, c) = map(int, input().split())
d = [1]
e = [1]
i = 1
while len(d) < a:
	if i < b:
		d.append(d[i - 1] * 2)
		i += 1
	else:
		d.append(1)
i = 1
while len(e) < a:
	if i < c:
		e.append(e[i - 1] * 2)
		i += 1
	else:
		e.append(e[i - 1])
print(sum(d), sum(e))


n = list(map(int, input().split()))
a = 0
b = 0
c = 0
if n[1] == 1:
	a = n[0]
else:
	a = 2 ** n[1] - 1 + (n[0] - n[1]) * 1
if n[0] == n[2]:
	b = 2 ** n[0] - 1
else:
	b = 2 ** n[2] - 1 + 2 ** (n[2] - 1) * (n[0] - n[2])
print(a, b)


(n, l, r) = list(map(int, input().split()))
a = 0
for i in range(0, l):
	x = pow(2, i)
	a = a + x
a = a + 1 * (n - l)
b = 0
for i in range(0, r):
	x = pow(2, i)
	b = b + x
b = b + (n - r) * pow(2, r - 1)
print(str(a) + ' ' + str(b))


(n, l, r) = map(int, input().split())
a = 1
b = 1
l1 = []
l2 = []
for i in range(0, l):
	l1.append(a)
	a = a * 2
for i in range(0, n - l):
	l1.append(1)
minsum = sum(l1)
for j in range(0, r):
	l2.append(b)
	b = b * 2
for j in range(0, n - r):
	l2.append(b // 2)
maxsum = sum(l2)
print(minsum, maxsum)


(n, l, r) = map(int, input().split())
mini = 1
maxi = 1
mini_2 = 1
maxi_2 = 1
for i in range(1, l):
	mini_2 *= 2
	mini += mini_2
for i in range(1, r):
	maxi_2 *= 2
	maxi += maxi_2
mini = mini + (n - l)
maxi = maxi + (n - r) * maxi_2
print(mini, maxi)


(n, l, r) = [int(x) for x in input().split()]
counter = 0
arr = 0
for i in range(l - 1):
	counter += 2 ** (i + 1)
counter += n - l + 1
for i in range(r):
	arr += 2 ** i
arr += 2 ** i * (n - r)
print(counter, arr)


inp = input()
inp = inp.split()
n = int(inp[0])
l = int(inp[1])
r = int(inp[2])
mintot = n - l + 1
number = 1
for i in range(l - 1):
	number *= 2
	mintot += number
maxtot = 2 ** (r - 1) * (n - r + 1)
number = 2 ** (r - 1)
for i in range(r - 1):
	number /= 2
	maxtot += number
print(str(mintot) + ' ' + str(int(maxtot)))


def main():
	import sys
	input = sys.stdin.readline
	(n, l, r) = map(int, input().split())
	mi = 0
	curr = 1 << l - 1
	for i in range(n):
		mi += curr
		if curr != 1:
			curr >>= 1
	ma = 0
	curr = 1
	for i in range(n):
		ma += curr
		if curr != 1 << r - 1:
			curr <<= 1
	print(mi, ma)
	return 0
main()


(n, l, r) = map(int, input().split())
x = 2 ** (r - 1)
y = 2 ** (l - 1)
m = n
smax = count = 0
while x != 0:
	smax += x
	x = x // 2
	count += 1
if count < n:
	while count != n:
		smax += 2 ** (r - 1)
		count += 1
smin = count = 0
while y != 0:
	smin += y
	y = y // 2
	count += 1
if count < n:
	while count != m:
		smin += 1
		count += 1
print(smin, smax)


ar = []
for t in input().split(' '):
	ar.append(int(t))
n = ar[0]
l = ar[1]
r = ar[2]
temp = []
curr = 1
curr2 = 1
for x in range(0, n):
	if curr == l:
		temp.append(1)
	else:
		curr2 = 2 * curr2
		temp.append(curr2)
		curr = curr + 1
out1 = sum(temp)
temp = []
curr = 1
curr2 = 1
for x in range(0, n):
	if r != curr2:
		temp.append(curr)
		curr = curr * 2
		curr2 = curr2 + 1
	else:
		temp.append(curr)
out2 = sum(temp)
print(out1, out2)


(n, l, r) = map(int, input().split(' '))
lo = 2 ** l - 1 + n - l
hi = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
print(lo, hi)


(n, l, r) = [int(x) for x in input().split()]
min = 1
max = 1
ways = 1
num = 1
for i in range(2, n + 1):
	if ways < l:
		ways += 1
		num *= 2
		min += num
	else:
		min += 1
ways = 1
num = 1
for i in range(2, n + 1):
	if ways < r:
		ways += 1
		num *= 2
		max += num
	else:
		max += num
print(min, max)


import sys
(n, l, r) = input().split()
n = int(n)
l = int(l)
r = int(r)
min_a = []
max_a = []
for i in range(l):
	min_a.append(i)
while len(min_a) < n:
	min_a.append(0)
for i in range(r):
	max_a.append(i)
while len(max_a) < n:
	max_a.append(r - 1)
min_ans = int(0)
max_ans = int(0)
for x in min_a:
	min_ans += pow(2, x)
for x in max_a:
	max_ans += pow(2, x)
print(min_ans, end=' ')
print(max_ans)


(n, l, r) = [int(x) for x in input().split()]
output = [0, 0]
least = 1
for least in range(1, l):
	output[0] += 2 ** least
for least in range(1, r):
	output[1] += 2 ** least
else:
	if r != 1:
		output[1] += 2 ** least * (n - r) + 1
	else:
		output[1] = n
print(output[0] + n - l + 1, output[1])


a = input().split(' ')
n = int(a[0])
l = int(a[1])
r = int(a[2])
max = 1
c = 1
i = 1
while i < n:
	if i < r:
		c = c * 2
		max = max + c
	else:
		max = max + c
	i = i + 1
min = 1
c = 1
i = 1
while i < n:
	if i < l:
		c = c * 2
		min = min + c
	else:
		min = min + 1
	i = i + 1
print(min, max)


import math
(n, l, r) = map(int, input().split())
minsum = 0
maxsum = 0
if l >= n:
	minsum = 2 ** n - 1
elif l == 1:
	minsum = n
else:
	k = n - l
	for i in range(n - k):
		minsum += 2 ** i
	minsum += k * 1
if r >= n:
	maxsum = 2 ** n - 1
elif r == 1:
	maxsum = n
else:
	m = n - r
	for i in range(n - m):
		maxsum += 2 ** i
	maxsum += m * 2 ** (r - 1)
print(minsum, maxsum)


arr = list(map(int, input().split()))
x = arr[0]
l = arr[1]
r = arr[2]
su = [1]
i = 0
n = 0
val1 = 1
while i < x - 1:
	if n < l - 1:
		val1 = val1 * 2
		su.append(val1)
		n = n + 1
	else:
		su.append(1)
	i = i + 1
y = sum(su)
i = 0
su2 = [1]
val = 1
j = 0
while i < x - 1:
	if j < r - 1:
		val = val * 2
		su2.append(val)
	else:
		su2.append(val)
	j = j + 1
	i = i + 1
c = sum(su2)
print(y, c)


(n, r, l) = map(int, input().split())
s = pow(2, r) + n - r - 1
t = (n - l) * pow(2, l - 1) + pow(2, l) - 1
print(min(s, t), max(s, t))


from sys import stdin, stdout
import math
import copy
(N, L, R) = [int(x) for x in stdin.readline().split()]
mini = 0
num = 1
for i in range(L):
	mini += num
	num *= 2
maxi = 0
num = 1
for i in range(R):
	maxi += num
	num *= 2
maxi += (N - R) * (num // 2)
mini += N - L
print(mini, maxi)


(n, l, r) = map(int, input().split())
(a, b) = ([], [])
for i in range(r):
	t = 2 ** i
	a.append(t)
max = sum(a) + (n - r) * 2 ** (r - 1)
for i in range(l):
	s = 2 ** i
	b.append(s)
min = sum(b) + (n - l) * 1
print(min, max)


(n, l, r) = map(int, input().split())
minimum = n - l
tmp = 1
for i in range(l):
	minimum += tmp
	tmp *= 2
maximum = 0
tmp = 1
for i in range(r):
	maximum += tmp
	tmp *= 2
tmp //= 2
maximum += tmp * (n - r)
print(minimum, maximum)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def main():
	t = 1
	rr = []
	for _ in range(t):
		(n, l, r) = LI()
		t = 2 ** l - 1 + n - l
		u = 2 ** r - 1 + 2 ** (r - 1) * (n - r)
		rr.append(JA([t, u], ' '))
	return JA(rr, '\n')
print(main())


(n, l, r) = list(map(int, input().split()))
s1 = 0
s2 = 1
s1 += n - l + 1
c = 2
for j in range(n - l + 1, n):
	s1 += c
	c *= 2
d = 1
r -= 1
for j in range(1, n):
	if r > 0:
		d *= 2
		r -= 1
	s2 += d
print(s1, s2)


(n, l, r) = map(int, input().split())
min_sum = 0
ones = n - l + 1
for i in range(n - ones):
	min_sum += 2 ** (i + 1)
min_sum += ones
max_sum = 0
max_pow = 0
for i in range(r):
	max_pow = 2 ** i
	max_sum += max_pow
for i in range(n - r):
	max_sum += max_pow
print(min_sum, max_sum)


import bisect
import decimal
from decimal import Decimal
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate
decimal.getcontext().prec = 46

def primeFactors(n):
	prime = set()
	while n % 2 == 0:
		prime.add(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			prime.add(i)
			n = n // i
	if n > 2:
		prime.add(n)
	return list(prime)

def getFactors(n):
	factors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				factors.append(i)
			else:
				factors.append(i)
				factors.append(n // i)
		i = i + 1
	return factors

def modefiedSieve():
	mx = 10 ** 7 + 1
	sieve = [-1] * mx
	for i in range(2, mx):
		if sieve[i] == -1:
			sieve[i] = i
			for j in range(i * i, mx, i):
				if sieve[j] == -1:
					sieve[j] = i
	return sieve

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	num = []
	for p in range(2, n + 1):
		if prime[p]:
			num.append(p)
	return num

def lcm(a, b):
	return a * b // math.gcd(a, b)

def sort_dict(key_value):
	return sorted(key_value.items(), key=lambda kv: (kv[1], kv[0]), reverse=True)

def list_input():
	return list(map(int, input().split()))

def num_input():
	return map(int, input().split())

def string_list():
	return list(input())

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def binaryToDecimal(n):
	return int(n, 2)

def DFS(n, s, adj):
	visited = [False for i in range(n + 1)]
	stack = []
	stack.append(s)
	while len(stack):
		s = stack[-1]
		stack.pop()
		if not visited[s]:
			visited[s] = True
		for node in adj[s]:
			if not visited[node]:
				stack.append(node)

def maxSubArraySum(a, size):
	maxint = 10 ** 10
	max_so_far = -maxint - 1
	max_ending_here = 0
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_so_far < max_ending_here:
			max_so_far = max_ending_here
		if max_ending_here < 0:
			max_ending_here = 0
	return max_so_far

def solve():
	(n, l, r) = num_input()
	N = n
	ans1 = 0
	for i in range(l):
		ans1 += 2 ** i
		N -= 1
	print(ans1 + N, end=' ')
	N = n
	ans2 = 0
	for i in range(r):
		ans2 += 2 ** i
		N -= 1
	for i in range(N):
		ans2 += 2 ** (r - 1)
	print(ans2)
t = 1
for _ in range(t):
	solve()


(n, L, R) = map(int, input().split())
print(2 ** L - 1 + n - L, 2 ** R - 1 + (n - R) * 2 ** (R - 1))


import math
a = list(map(int, input().split()))
mini = a[0] - a[1] + 1
tmp = 1
maxi = 0
flg = 0
for j in range(1, a[1]):
	tmp = 2 * tmp
	mini += tmp
tmp = 1
maxi = 1
for j in range(1, a[2]):
	tmp = 2 * tmp
	maxi += tmp
print(mini, maxi + (a[0] - a[2]) * tmp)


from sys import stdin

def main():
	(n, l, r) = map(int, stdin.readline().strip().split())
	min_ = n - l + 1
	ac = 1
	for i in range(l - 1):
		ac *= 2
		min_ += ac
	(max_, ac) = (0, 1)
	for i in range(r):
		max_ += ac
		ac *= 2
	max_ += ac / 2 * (n - r)
	print(min_, int(max_))
main()


(n, l, r) = input().split()
n = int(n)
l = int(l)
r = int(r)
ans = [1 for i in range(n)]
num = 1
count = 0
for i in range(n - l, n):
	ans[i] = num
	num *= 2
s_min = sum(ans)
num = 1
s_max = 0
for i in range(n):
	s_max += num
	count += 1
	if count < r:
		num *= 2
print(s_min, s_max)


import math, sys
from collections import Counter, defaultdict
from sys import stdin, stdout
input = stdin.readline
lili = lambda : list(map(int, sys.stdin.readlines()))
li = lambda : list(map(int, input().split()))
(n, l, r) = li()
s = 1
m = 1
for i in range(1, l):
	m = m + 2 ** i
m = m + (n - l)
for i in range(1, r):
	s = s + 2 ** i
s = s + (n - r) * 2 ** (r - 1)
print(m, s)


def main():
	(n, l, r) = map(int, input().split())
	arr = []
	k = 0
	for i in range(l):
		arr.append(2 ** k)
		k += 1
	for i in range(n - l):
		arr.append(1)
	min_sum = sum(arr)
	arr = []
	k = 0
	for i in range(r):
		arr.append(2 ** k)
		k += 1
	for i in range(n - r):
		arr.append(arr[-1])
	max_sum = sum(arr)
	print(min_sum, max_sum)
main()


(n, l, r) = map(int, input().split())
a = 1
b = 1
i = 1
while True:
	if i == r:
		break
	else:
		if i < l:
			a *= 2
		if i < r:
			b *= 2
	i += 1
x = a * 2 - 1 + (n - l)
y = b * 2 - 1 + (n - r) * b
print(x, y)


(n, l, r) = map(int, input().split())
min_elements = list(map(lambda x: 2 ** x, range(l)))
max_elements = list(map(lambda x: 2 ** x, range(r)))
print(f'{sum(min_elements) + (n - l)}', end=' ')
print(f'{sum(max_elements) + 2 ** (r - 1) * (n - r)}')


(n, l, r) = map(int, input().split())
a = 1
mn = 0
mx = 0
for i in range(r):
	x = 2 ** i
	if i < l:
		mn = mn + x
	if i < r:
		mx = mx + x
for t1 in range(n - l):
	mn = mn + 1
for t2 in range(n - r):
	mx = mx + x
print(mn, mx)


import sys
input = lambda : sys.stdin.readline().strip()
from math import log
(N, L, R) = map(int, input().split())
print(N - L + 2 ** L - 1, (N - R) * 2 ** (R - 1) + 2 ** R - 1)


import collections
(n, l, r) = map(int, input().split())
a = [2 ** i for i in range(r)]
print(sum(a[:l]) + n - l, sum(a) + (n - r) * a[-1])


def main():
	(l, mn, ma) = list(map(int, input().split()))
	if mn > l:
		mn = l
	if ma > l:
		ma = l
	mn_sum = l - mn + 1
	c = 1
	for i in range(mn - 1):
		c *= 2
		mn_sum += c
	c = 1
	mx_sum = 1
	for i in range(1, ma):
		c *= 2
		mx_sum += c
	mx_sum += (l - ma) * c
	print(mn_sum, mx_sum)
main()


s = input().split()
n = int(s[0])
l = int(s[1])
r = int(s[2])
lst = []
for i in range(l):
	lst.append(2 ** i)
print(n - l + sum(lst), end=' ')
lst = []
for i in range(r):
	lst.append(2 ** i)
print(sum(lst) + 2 ** (r - 1) * (n - r))


from sys import stdin
(n, l, r) = list(map(int, stdin.readline().split()))
min_sum = n
for i in range(1, l):
	min_sum -= 1
	min_sum += 2 ** i
max_sum = n * 2 ** (r - 1)
for i in range(r):
	max_sum -= 2 ** (r - 1)
	max_sum += 2 ** i
print(min_sum, max_sum)


(n, l, h) = map(int, input().split())
(Min, Max) = (0, 0)
(tmp1, tmp2) = (0, 0)
for i in range(l):
	Min += 2 ** i
Min += n - l
for i in range(h):
	Max += 2 ** i
Max += (n - h) * 2 ** i
print(Min, Max)


from sys import stdin, stdout
import heapq
import cProfile, math
from collections import Counter, defaultdict, deque
from bisect import bisect_left, bisect, bisect_right
import itertools
from copy import deepcopy
from fractions import Fraction
import sys, threading
import operator as op
from functools import reduce
import sys
sys.setrecursionlimit(10 ** 6)
threading.stack_size(2 ** 27)
fac_warm_up = False
printHeap = str()
memory_constrained = False
P = 10 ** 9 + 7

class MergeFind:

	def __init__(self, n):
		self.parent = list(range(n))
		self.size = [1] * n
		self.num_sets = n
		self.lista = [[_] for _ in range(n)]

	def find(self, a):
		to_update = []
		while a != self.parent[a]:
			to_update.append(a)
			a = self.parent[a]
		for b in to_update:
			self.parent[b] = a
		return self.parent[a]

	def merge(self, a, b):
		a = self.find(a)
		b = self.find(b)
		if a == b:
			return
		if self.size[a] < self.size[b]:
			(a, b) = (b, a)
		self.num_sets -= 1
		self.parent[b] = a
		self.size[a] += self.size[b]
		self.lista[a] += self.lista[b]

	def set_size(self, a):
		return self.size[self.find(a)]

	def __len__(self):
		return self.num_sets

def display(string_to_print):
	stdout.write(str(string_to_print) + '\n')

def prime_factors(n):
	factors = dict()
	for i in range(2, math.ceil(math.sqrt(n)) + 1):
		while n % i == 0:
			if i in factors:
				factors[i] += 1
			else:
				factors[i] = 1
			n = n // i
	if n > 2:
		factors[n] = 1
	return factors

def all_factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def fibonacci_modP(n, MOD):
	if n < 2:
		return 1
	return (cached_fn(fibonacci_modP, (n + 1) // 2, MOD) * cached_fn(fibonacci_modP, n // 2, MOD) + cached_fn(fibonacci_modP, (n - 1) // 2, MOD) * cached_fn(fibonacci_modP, (n - 2) // 2, MOD)) % MOD

def factorial_modP_Wilson(n, p):
	if p <= n:
		return 0
	res = p - 1
	for i in range(n + 1, p):
		res = res * cached_fn(InverseEuler, i, p) % p
	return res

def binary(n, digits=20):
	b = bin(n)[2:]
	b = '0' * (digits - len(b)) + b
	return b

def is_prime(n):
	if n < 4:
		return True
	if n % 2 == 0:
		return False
	if n % 3 == 0:
		return False
	i = 5
	w = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += w
		w = 6 - w
	return True

def generate_primes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	return prime
factorial_modP = []

def warm_up_fac(MOD):
	global factorial_modP, fac_warm_up
	if fac_warm_up:
		return
	factorial_modP = [1 for _ in range(fac_warm_up_size + 1)]
	for i in range(2, fac_warm_up_size):
		factorial_modP[i] = factorial_modP[i - 1] * i % MOD
	fac_warm_up = True

def InverseEuler(n, MOD):
	return pow(n, MOD - 2, MOD)

def nCr(n, r, MOD):
	global fac_warm_up, factorial_modP
	if not fac_warm_up:
		warm_up_fac(MOD)
		fac_warm_up = True
	return factorial_modP[n] * (pow(factorial_modP[r], MOD - 2, MOD) * pow(factorial_modP[n - r], MOD - 2, MOD) % MOD) % MOD

def test_print(*args):
	if testingMode:
		print(args)

def display_list(list1, sep=' '):
	stdout.write(sep.join(map(str, list1)) + '\n')

def display_2D_list(li):
	for i in li:
		print(i)

def prefix_sum(li):
	sm = 0
	res = []
	for i in li:
		sm += i
		res.append(sm)
	return res

def get_int():
	return int(stdin.readline().strip())

def get_tuple():
	return map(int, stdin.readline().split())

def get_list():
	return list(map(int, stdin.readline().split()))
memory = dict()

def clear_cache():
	global memory
	memory = dict()

def cached_fn(fn, *args):
	global memory
	if args in memory:
		return memory[args]
	else:
		result = fn(*args)
		memory[args] = result
		return result

def ncr(n, r):
	return math.factorial(n) / (math.factorial(n - r) * math.factorial(r))

def binary_search(i, li):
	fn = lambda x: li[x] - x // i
	x = -1
	b = len(li)
	while b >= 1:
		while b + x < len(li) and fn(b + x) > 0:
			x += b
		b = b // 2
	return x
TestCases = False
fac_warm_up_size = 10 ** 5 + 100
optimise_for_recursion = False

def main():
	(n, l, r) = get_tuple()
	print(2 ** l - 1 + (n - l), 2 ** r - 1 + 2 ** (r - 1) * (n - r))
if TestCases:
	for i in range(get_int()):
		main()
else:
	main() if not optimise_for_recursion else threading.Thread(target=main).start()


(n, a, b) = map(int, input().split(' '))
sum = 0
sum += n - a + 1
p = 2
for i in range(1, a):
	sum += p
	p *= 2
print(sum, end=' ')
sum = 1
p = 2
for i in range(1, b):
	sum += p
	p *= 2
print(sum + (n - b) * p // 2)


(n, l, r) = map(int, input().split())
min_sum = (1 << l) - 1 + n - l
max_sum = (1 << r) - 1 + (n - r) * (1 << r - 1)
print(min_sum, max_sum)


(a, b, c) = [int(v) for v in input().split()]
data = []
for i in range(0, 21):
	data.append(2 ** i)
print(sum(data[0:b]) + (a - b), sum(data[0:c]) + (a - c) * data[c - 1])


minn = int(0)
maxx = int(0)
er = 1
(n, l, r) = map(int, input().split())
while n:
	if l > 0:
		minn += er
	if r > 0:
		maxx += er
	er *= 2
	n -= 1
	l -= 1
	r -= 1
	if l == 0:
		minn += n
	if r == 0:
		maxx += n * (er / 2)
		break
print('%d %d' % (minn, maxx))


def inp_n():
	return int(input())

def inp_list():
	return list(map(int, input().split()))

def inp_mul_num():
	return map(int, input().split())

def is_odd(n):
	if n & 1:
		return True
	return False
(n, l, r) = inp_mul_num()
a = [0] * 21
for i in range(21):
	a[i] = 2 ** i
t = 1
s = 0
c = 0
while t < l:
	s += a[t]
	c += 1
	t += 1
i = 0
while i < n - c:
	s += 1
	i += 1
j = 0
s1 = 0
c = 0
while j < r - 1:
	s1 += a[j]
	c += 1
	j += 1
i = 0
while i < n - c:
	s1 += a[r - 1]
	i += 1
print(s, s1)


(n, l, r) = input().split()
n = int(n)
l = int(l)
r = int(r)
count = n
summ = 0
j = 1
while l > 0:
	summ = summ + j
	l = l - 1
	count = count - 1
	j = j * 2
while count > 0:
	summ = summ + 1
	count = count - 1
sumb = 0
count = n
j = 1
while r > 0:
	sumb = sumb + j
	r = r - 1
	count = count - 1
	j = j * 2
j = j // 2
while count > 0:
	sumb = sumb + j
	count = count - 1
print(summ, sumb)


(n, l, r) = map(int, input().split())
minsum = sum([2 ** n for n in range(l)]) + n - l
maxsum = sum([2 ** n for n in range(r)]) + (n - r) * 2 ** (r - 1)
print(minsum, maxsum)


(n, l, r) = map(int, input().split())
j = 1
a = b = []
s1 = j * (n - l + 1)
for i in range(l - 1):
	s1 += j * 2
	j *= 2
s2 = 1
j = 1
for i in range(r - 1):
	s2 += j * 2
	j *= 2
s2 += (n - r) * j
print(s1, s2)


def main():
	(n, l, r) = map(int, input().split())
	res1 = 2 ** l - 1 + 1 * (n - l)
	res2 = 2 ** r - 1 + 2 ** (r - 1) * (n - r)
	print(min(res1, res2), max(res1, res2))
	return 0
main()


(n, l, r) = map(int, input().split())
menor = n - l + 1
for i in range(l - 1):
	menor += pow(2, i + 1)
mayor = 1
for j in range(r - 1):
	mayor += pow(2, j + 1)
sobra = n - r
mayor += pow(2, r - 1) * sobra
print(menor, mayor)


(n, l, r) = [int(x) for x in input().split()]
possiblenumbers = []
possiblenumbers.append(1)
for i in range(1, r):
	possiblenumbers.append(2 ** i)
minimumsum = []
for i in range(l):
	minimumsum.append(possiblenumbers[i])
diff = n - len(minimumsum)
s1 = sum(minimumsum) + diff
maximumsum = []
for i in range(r):
	maximumsum.append(possiblenumbers[i])
diff = n - len(maximumsum)
s2 = sum(maximumsum) + maximumsum[-1] * diff
print(s1, s2)


l = list(map(int, input().split()))
d = l[1]
n = l[0]
sm = 0
x = 1
for i in range(d - 1):
	x *= 2
	sm += x
sm += n - (d - 1)
d = l[2]
sn = 1
x = 1
for i in range(d - 1):
	x *= 2
	sn += x
sn += (n - d) * x
print(sm, sn)


a = list(map(int, input().split()))
n = a[0]
l = a[1]
r = a[-1]
s = pow(2, r) - 1
s1 = pow(2, r - 1)
sum_c = s + s1 * (n - r)
max1 = sum_c
s = pow(2, l) - 1
sum_b1 = s + n - l
min1 = sum_b1
print(min1, max1)


(n, l, r) = map(int, input().split())
(x, y) = ([1], [1])
(i, j) = (2, 2)
while l - 1 > 0:
	x.append(i)
	i = x[-1] * 2
	l -= 1
while r - 1 > 0:
	y.append(j)
	j = y[-1] * 2
	r -= 1
if len(x) < n:
	m = sum(x) + (n - len(x))
	print(m, end=' ')
else:
	print(sum(x), end=' ')
if len(y) < n:
	k = sum(y) + (n - len(y)) * y[-1]
	print(k)
else:
	print(sum(y))


(n, l, r) = map(int, input().split())
m = sum((2 ** i for i in range(1, l))) + n - l + 1
M = sum((2 ** i for i in range(r - 1))) + (n - r + 1) * 2 ** (r - 1)
print(m, M)


def sum_of_table_of_2(index):
	table = [1]
	for i in range(index - 1):
		table.append(2 * table[i])
	return table

def max_min_sum(number_of_elements, not_less_than, not_more_than):
	Minimum = number_of_elements - not_less_than + sum(sum_of_table_of_2(not_less_than))
	Maximum = (number_of_elements - not_more_than) * sum_of_table_of_2(not_more_than)[-1] + sum(sum_of_table_of_2(not_more_than))
	return str(Minimum) + ' ' + str(Maximum)
(n, l, r) = map(int, input().split())
print(max_min_sum(n, l, r))


(n, l, r) = (int(x) for x in input().split())
temp = n
min = n - (l - 1)
n = l - 1
min += 2 * (2 ** n - 1)
n = temp
max = (n - (r - 1)) * 2 ** (r - 1)
n = r - 1
max += 2 ** n - 1
print(min, max)


(n, l, r) = list(map(int, input().split()))
minn = 1
k = n - l
l = l - 1
t = 1
while l > 0:
	l -= 1
	t *= 2
	minn += t
minn = minn + k
maxx = 1
t = 1
k = n - r
r = r - 1
while r > 0:
	r -= 1
	t = t * 2
	maxx += t
maxx = maxx + k * t
print(minn, maxx)


(n, l, r) = map(int, input().split())
a = []
suml = 0
sumh = 0
suml += n - l + 1
for i in range(1, l):
	suml += pow(2, i)
sumh += pow(2, r - 1) * (n - r + 1)
for i in range(r - 1):
	sumh += pow(2, i)
print(suml, sumh)


(n, l, r) = map(int, input().split(' '))
ansr = 2 ** r - 1 + 2 ** (r - 1) * (n - r)
ansl = 2 ** l - 1 + n - l
print(ansl, ansr)


a = input()
b = list(map(int, a.split()))
c = b[0]
d = b[1]
e = b[2]
mincount = 0
maxcount = 0
mincount += c - d
for i in range(d):
	mincount += 2 ** i
for i in range(e):
	maxcount += 2 ** i
maxcount += (c - e) * 2 ** (e - 1)
print(str(mincount) + ' ' + str(maxcount))


def do():
	(n, l, r) = map(int, input().split(' '))
	mi = sum((1 << i for i in range(l))) + 1 * (n - l)
	ma = sum((1 << i for i in range(r))) + (1 << r - 1) * (n - r)
	return str(mi) + ' ' + str(ma)
print(do())


(n, l, r) = [int(x) for x in input().split()]
minimum = 2 ** l + n - l - 1
maximum = (n - r + 2) * 2 ** (r - 1) - 1
print(minimum, maximum)


(a, b, c) = list(map(int, input().split()))
d = 0
f = 0
for i in range(1, b + 1):
	d = d + 2 ** (i - 1)
d = d + (a - b)
for j in range(1, c + 1):
	f = f + 2 ** (j - 1)
f = 2 ** (c - 1) * (a - c) + f
print(str(d) + ' ' + str(f))


(n, l, r) = map(int, input().split())
a = []
(tl, tr) = (l, r)
sm = n - l + 1
j = 2
for i in range(l - 1):
	sm += j
	j *= 2
j = 2
sm2 = 1
for i in range(r - 1):
	sm2 += j
	j *= 2
sm2 += j // 2 * (n - r)
print(sm, sm2)


(n, l, r) = map(int, input().split())
minimal = n - l + 1
l -= 1
x = 2
while l > 0:
	minimal += x
	x *= 2
	l -= 1
maxi = 0
x = 1
while r > 0:
	maxi += x
	r -= 1
	x *= 2
	n -= 1
x = x // 2
maxi += n * x
print(minimal, maxi)


import math
import sys
(n, l, r) = map(int, sys.stdin.readline().split())
limit = pow(2, r - 1)
min_sum = n - l + pow(2, l) - 1
max_sum = pow(2, r) - 1 + limit * (n - r)
print(min_sum, max_sum)


import math
(n, l, r) = map(int, input().split())
arr = [1] * n
msum = 0
for i in range(l):
	msum += 2 ** i
msum += n - l
high = 0
for i in range(r):
	high += 2 ** i
high += (n - r) * 2 ** (r - 1)
print(msum, high)


(n, l, r) = map(int, input().strip().split())
(mn, mx) = (0, 0)
(ele_mn, ele_mx) = (1, 1)
while n:
	mn += ele_mn
	mx += ele_mx
	n -= 1
	if n < l:
		ele_mn *= 2
	r -= 1
	if r > 0:
		ele_mx *= 2
print(mn, mx)


(n, l, r) = map(int, input().split())
minn = 2 ** l - 1 + n - l
maxx = 2 ** r - 1 + 2 ** (r - 1) * (n - r)
print(minn, maxx)


import math
from collections import deque, defaultdict
from sys import stdin, stdout
input = stdin.readline
listin = lambda : list(map(int, input().split()))
mapin = lambda : map(int, input().split())
(n, l, r) = mapin()
ansmin = [1 for i in range(n)]
ansmax = [1 for i in range(n)]
for i in range(1, l):
	ansmin[-i] = ansmin[-i + 1] * 2
for i in range(1, r):
	ansmax[i] = ansmax[i - 1] * 2
for i in range(r, n):
	ansmax[i] = ansmax[i - 1]
print(sum(ansmin), sum(ansmax))


from math import *
from collections import *
from itertools import *
from functools import *
from random import *

def getl(t=int):
	return [t(x) for x in input().split()]

def get(t=int):
	return t(input())
alphabet = [chr(x) for x in range(ord('a'), ord('z') + 1)]
alnum = lambda x: ord(x) - ord('a')

def main():
	(n, l, r) = getl()
	a1 = 2 ** l - 1 + (n - l) * 1
	a2 = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
	print(a1, a2)
main()


(n, l, r) = map(int, input().split())
a = 1
A = [1]
for i in range(l - 1):
	A += [a * 2]
	a *= 2
mi = sum(A) + 1 * (n - len(A))
for i in range(r - l):
	A += [a * 2]
	a *= 2
ma = sum(A) + A[-1] * (n - len(A))
print(mi, ma)


(n, l, r) = map(int, input().split())
c = 0
h = 1
m = n - r
d = 0
j = r
p = n
c = c + n - (l - 1)
n = n - c
o = 1
while n > 0:
	o = o * 2
	c = c + o
	n = n - 1
while r > 0:
	d = d + h
	h = h * 2
	p = p - 1
	r = r - 1
x = pow(2, j - 1)
d = d + x * m
print(c, d)


(n, l, r) = input().split(' ')
n = int(n)
l = int(l)
r = int(r)
minimal = n - (l - 1)
for i in range(1, l):
	minimal += pow(2, i)
maximal = 0
for i in range(n):
	if i < r:
		maximal += pow(2, i)
		if r - i == 1:
			x = pow(2, i)
		continue
	maximal += x
print(minimal, maximal)


from sys import stdin, stdout
input = stdin.readline
t = 1
for _ in range(t):
	(n, l, r) = map(int, input().split())
	a = 0
	k = 1
	for i in range(l):
		a += k
		k *= 2
	a += n - l
	b = 0
	k = 1
	for i in range(r):
		b += k
		k *= 2
	b += (n - r) * (k // 2)
	print(a, b)


from math import *
from copy import *
from string import *
from random import *
from sys import stdin
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
(N, L, R) = map(int, stdin.readline().rstrip().split())
(minn, maxx) = (0, 0)
minn += (N - L + 1) * 1
minn += 2 * (2 ** (N - minn) - 1)
maxx += (N - R + 1) * 2 ** (R - 1)
nn = R - 1
maxx += 1 * (2 ** nn - 1)
print(minn, maxx)


(n, l, r) = map(int, input().split())
dl = [2 ** i for i in range(l)]
dr = [2 ** i for i in range(r)]
mn = [1 for i in range(n)]
mx = [1 for i in range(n)]
for i in range(l):
	mn[i] = dl[i]
for i in range(r):
	mx[i] = dr[i]
if l < n:
	for i in range(r, n):
		mx[i] = max(mx)
print(sum(mn), end=' ')
print(sum(mx))


from sys import stdin, stdout
ii = lambda : int(stdin.readline())
mi = lambda : map(int, stdin.readline().strip().split())
li = lambda : list(mi())
(N, L, R) = mi()
ansmin = N - L + (1 << L) - 1
ansmax = (1 << R) - 1 + (N - R) * (1 << R - 1)
stdout.write(str(ansmin) + ' ' + str(ansmax) + '\n')


p = input().rstrip().split(' ')
N = int(p[0])
L = int(p[1])
R = int(p[2])
l = []
q = []
w = []
S = []
D = []
for i in range(0, 10000):
	l.append(2 ** i)
G = l[0:L]
A = (N - len(G)) * 1
for i in range(0, len(G)):
	A += int(G[i])
print(A, end=' ')
G = l[0:R]
V = G[len(G) - 1]
B = (N - len(G)) * V
for i in range(0, len(G)):
	B += int(G[i])
print(B)


def solve(n, l, r):
	max_sum = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
	min_sum = 2 ** l - 1 + (n - l)
	return (min_sum, max_sum)

def test_solve():
	assert solve(4, 2, 2) == (5, 7)
	assert solve(5, 1, 5) == (5, 31)
print(*solve(*list(map(int, input().split()))))


(n, l, r) = map(int, input().split())
s = []
for i in range(n - l + 1):
	s.append(1)
a = 1
for i in range(1, l):
	a *= 2
	s.append(a)
c = sum(s)
t = []
for i in range(1):
	t.append(1)
b = 1
for i in range(1, r):
	b *= 2
	t.append(b)
for i in range(n - r):
	t.append(b)
d = sum(t)
print(c, d)


(n, l, r) = map(int, input().split())
low = pow(2, l - 1)
high = pow(2, r - 1)
sl = low * 2 - 1 + (n - l)
sh = high * 2 - 1 + (n - r) * high
print(sl, sh)


(n, l, r) = map(int, input().split(' '))
p = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
q = 2 ** l - 1 + (n - l)
print(q, p)


(n, l, r) = map(int, input().split())
(Min, Max, counter) = (0, 0, 1)
for i in range(l):
	Min += counter
	counter *= 2
counter = 0.5
Min += n - l
for j in range(r):
	counter *= 2
	Max += counter
print(Min, int(Max + (n - r) * counter))


(n, l, r) = map(int, list(input().split()))
smin = 0
smax = 0
max = 0
for i in range(0, r):
	if 0 <= i < l:
		smin += 2 ** i
	smax += 2 ** i
	max = 2 ** i
print(smin + (n - l), smax + max * (n - r))


(n, l, r) = map(int, input().split())
mini = 0
i = 0
ziom = 2 ** (l - 1)
while i < n:
	mini += ziom
	if i < l - 1:
		ziom //= 2
	i += 1
maksi = 0
i = 0
ziom = 1
while i < n:
	maksi += ziom
	if i < r - 1:
		ziom *= 2
	i += 1
print(mini, maksi)


a = input()
s = int(a[:a.index(' ')])
b = a[a.index(' ') + 1:]
mi = int(b[:b.index(' ')])
ma = int(b[b.index(' '):])
aa = 0
bb = 0
cur = 1
for k in range(s):
	aa += cur
	if ma > 1:
		cur *= 2
		ma -= 1
cur = int(2 ** (mi - 1))
for k in range(s):
	bb += int(cur)
	if cur != 1:
		cur /= 2
print(min(bb, aa), max(bb, aa))


(a, b, c) = map(int, input().split())
z = [1]
s = 1
for i in range(c - 1):
	s *= 2
	z += [s]
print(a - b + sum(z[:b]), sum(z) + max(z) * (a - c))


(n, l, r) = [int(i) for i in input().split(' ')]
right = 2 ** r - 1 + 2 ** (r - 1) * (n - r)
left = 2 ** l - 1 + n - l
print(left, right)


(n, l, r) = input().split(' ')
n = int(n)
l = int(l)
r = int(r)
power2 = []
for i in range(l):
	power2.append(2 ** i)
l1 = n - (l - 1)
min_response = []
for i in range(l1):
	min_response.append(power2[0])
power2.pop(0)
min_response.extend(power2)
max_response = []
max_v = 0
for i in range(r):
	max_response.append(2 ** i)
	max_v = 2 ** i
for i in range(n - r):
	max_response.append(max_v)
print(sum(min_response), sum(max_response))


(n, l, r) = map(int, input().split())
(ans1, ans2) = (0, 0)
for i in range(n):
	l = max(l - 1, 0)
	ans1 += 1 << l
	ans2 += 1 << min(i, r - 1)
print(ans1, ans2)


def Sol():
	(n, l, r) = [int(x) for x in input().split()]
	(min, max) = (0, 0)
	s = 1
	min += n - l
	while l > 0:
		min += s
		s *= 2
		l -= 1
	s = 1
	l = r
	while r > 0:
		max += s
		s *= 2
		r -= 1
	max += (n - l) * int(s / 2)
	print(min, max)
Sol()


(n, l, r) = input().split()
n = int(n)
l = int(l)
r = int(r)
b = []
c = []
for i in range(n - l + 1):
	b.append(1)
p = 1
for i in range(n - l + 1, n):
	p *= 2
	b.append(p)
p = 1
for i in range(n):
	if r != 1:
		c.append(p)
		p *= 2
		r -= 1
	else:
		c.append(p)
print(sum(b), sum(c))


(n, l, r) = map(int, input().split())
mns = (1 << l) - 1 + (n - l)
mxs = (1 << r) - 1 + (n - r) * (1 << r >> 1)
print(mns, mxs)


def min_1(n, l, r):
	s = 0
	s = n - l + 1
	if l == 1:
		return s
	for i in range(1, l):
		s += 2 ** i
	return s

def mx(n, l, r):
	q = 0
	for i in range(r):
		m = 2 ** i
		q += m
	if n - r > 0:
		q += (n - r) * m
	return q
(n, l, r) = map(int, input().split())
print(min_1(n, l, r), mx(n, l, r))


(n, l, r) = map(int, input().split())
s = 1
ans1 = 1
v = 2
while s < l:
	ans1 += v
	s += 1
	v *= 2
ans1 += n - s
s = 1
ans2 = 1
v = 2
while s < r:
	ans2 += v
	s += 1
	v *= 2
v = v // 2
ans2 += (n - s) * v
print(ans1, ans2)


(n, l, r) = [int(x) for x in input().split()]
m = n - (l - 1)
for i in range(l - 1):
	m += pow(2, i + 1)
M = (n - (r - 1)) * pow(2, r - 1)
for i in range(r - 1):
	M += pow(2, i)
print(m, M)


from sys import stdin, stdout
(n, l, r) = map(int, stdin.readline().split())
s1 = 0
s2 = 1
(p, q) = (n, n - 1)
while l > 1:
	s1 += pow(2, l - 1)
	l -= 1
	p -= 1
s1 += p * 1
for i in range(1, r - 1):
	q -= 1
	s2 += pow(2, i)
s2 += q * pow(2, r - 1)
stdout.write(str(s1) + ' ' + str(s2))


(num, left, right) = map(int, input().split())
minsum = 0
minsum += num - left + 1
for i in range(1, left):
	minsum += 2 ** i
maxsum = 0
temp = 0
for i in range(right):
	temp = 2 ** i
	maxsum += temp
for i in range(num - right):
	maxsum += temp
print(minsum, maxsum)


import sys
(n, l, r) = list(map(int, sys.stdin.readline().strip().split()))
m = 2 ** l - 1 + n - l
j = min([n, r])
M = 2 ** j - 1 + (n - j) * 2 ** (j - 1)
print(m, M)


(n, l, r) = map(int, input().split())
arr = []
mi = 0
ma = 0
if l == 1:
	mi = n
else:
	mi = mi + (n - l + 1)
	k1 = l - 1
	for i in range(1, k1 + 1):
		mi = mi + 2 ** i
if r == n:
	ma = 2 ** n - 1
else:
	pr = 0
	for i in range(r):
		pr = 2 ** i
		ma = ma + pr
	ma = ma + pr * (n - r)
print(mi, ma)


(n, l, r) = map(int, input().split())
minSum = 0
maxSum = 0
x = 1
for i in range(n):
	if i < n - (l - 1):
		minSum = minSum + x
	else:
		x = x * 2
		minSum = minSum + x
x = 1
for i in range(n):
	if i < r - 1:
		maxSum = maxSum + x
		x = x * 2
	else:
		maxSum = maxSum + x
print(minSum, maxSum)


(n, l, r) = map(int, input().split())
mini = 0
maxi = 0
c = n
c1 = n
for i in range(n - l + 1):
	mini += 1
	c -= 1
if c > 0:
	k = 1
	for i in range(c):
		k *= 2
		mini += k
z = 1
for i in range(r):
	print
	maxi += z
	z *= 2
	c1 -= 1
if c1 > 0:
	for i in range(c1):
		maxi += z // 2
print(mini, maxi)


nlr = list(map(int, input().split()))
minimum = [1]
lcur = 1
l = nlr[1]
r = nlr[2]
rcur = 1
maximum = [1]
for i in range(nlr[0] - 1):
	if lcur < l:
		minimum.append(minimum[i] * 2)
		lcur += 1
	else:
		minimum.append(minimum[0])
	if rcur < r:
		maximum.append(maximum[i] * 2)
		rcur += 1
	else:
		maximum.append(maximum[i])
minimumSum = 0
maximumSum = 0
for j in range(nlr[0]):
	minimumSum += minimum[j]
	maximumSum += maximum[j]
print(minimumSum, maximumSum)


(n, l, r) = map(int, input().split())
x = 1
s = 0
for i in range(l):
	s += x
	x *= 2
minimal = n - l + s
s = 0
x = 1
for i in range(r):
	s += x
	x *= 2
maximal = (n - r) * (x // 2) + s
print(minimal, maximal)


(n, l, r) = [int(x) for x in input().split()]
lo = 2 ** l - 1 + (n - l)
high = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
print(lo, high)


(n, l, r) = [int(x) for x in input().split()]
mmin = 2 ** l - 1 + (n - l)
mmax = 2 ** r - 1 + 2 ** (r - 1) * (n - r)
print(mmin, mmax)


(n, l, r) = [int(i) for i in input().split()]
ansMin = n - l + 1
k = 1
ansMax = 0
for i in range(n - l + 1, n):
	ansMin += 2 ** k
	if k < l - 1:
		k += 1
k = 0
for i in range(n):
	ansMax += 2 ** k
	if k < r - 1:
		k += 1
print(ansMin, ansMax)


(n, l, r) = [int(i) for i in input().split()]
ans = n - l
for i in range(l):
	ans += 2 ** i
print(ans, end=' ')
ans = 2 ** (r - 1) * (n - r)
for i in range(r):
	ans += 2 ** i
print(ans)


s = list(map(int, input().split(' ')))
(l, m) = (0, 0)
temp = 0
for i in range(s[1]):
	temp += 2 ** i
l = temp + s[0] - s[1]
temp = 0
for i in range(s[2]):
	temp += 2 ** i
m = temp + (s[0] - s[2]) * 2 ** i
print(l, m)


(n, l, r) = map(int, input().split())
mintotal = 0
maxtotal = 0
minpow = pow(2, l - 1)
maxpow = pow(2, r - 1)
mintotal += pow(2, l) - 1
mintotal += n - l
maxtotal += pow(2, r) - 1
maxtotal += (n - r) * maxpow
print(mintotal, maxtotal)


(n, l, r) = map(int, input().split())
arr1 = [1 for i in range(n)]
curr = 2
for i in range(l - 1):
	arr1[i] = curr
	curr = curr * 2
curr = 2 ** (r - 1)
arr2 = [curr for i in range(n)]
curr = 1
for i in range(r):
	arr2[i] = curr
	curr = curr * 2
print(sum(arr1), sum(arr2))


(n, l, r) = map(int, input().split())

def solve(n, l, r):
	min_ = n - l + 2 ** l - 1
	max_ = (n - r) * 2 ** (r - 1) + 2 ** r - 1
	return (min_, max_)
(min_, max_) = solve(n, l, r)
print(min_, max_)


L = list(map(int, input().strip().split(' ')))
n = L[0]
l = L[1]
r = L[2]
minsum = 0
maxsum = 0
for i in range(l):
	minsum += 2 ** i
minsum += n - l
for i in range(r):
	maxsum += 2 ** i
maxsum += (n - r) * 2 ** (r - 1)
print(minsum, maxsum)


[n, l, r] = [int(x) for x in input().split()]
idx = 1
mcnt = 1
arr = [1] * n
while mcnt < l:
	arr[idx] = arr[idx - 1] * 2
	idx += 1
	mcnt += 1
mn = sum(arr)
mcnt = 1
arr = [1] * n
idx = 1
dcnt = 1
while idx < n:
	arr[idx] = arr[idx - 1] * (2 if dcnt < r else 1)
	dcnt += 1 if dcnt < r else 0
	idx += 1
	mcnt += 1
mx = sum(arr)
print(mn, mx)


(n, l, r) = map(int, input().split())
mx = []
mn = []
num = 1
for i in range(l):
	mx.append(num)
	mn.append(num)
	num *= 2
for i in range(l, n):
	mn.append(1)
if r <= n:
	for i in range(l, r):
		mx.append(num)
		num *= 2
	num //= 2
	for i in range(r, n):
		mx.append(num)
else:
	for i in range(l, n):
		mx.append(num)
		num *= 2
print(sum(mn), sum(mx))


def pow(x, k):
	if k == 0:
		return 1
	return pow(x, k // 2) ** 2 * x ** (k % 2)
(n, l, r) = map(int, input().split())
s1 = pow(2, l) - 1 + n - l
s2 = pow(2, r) - 1 + (n - r) * pow(2, r - 1)
print(s1, s2)


(n, l, r) = map(int, input().split())
(s, c) = (0, l - 1)
r_1 = []
l_1 = []
for _ in range(n):
	l_1 += [2 ** c]
	r_1 += [2 ** s]
	if c > 0:
		c -= 1
	if s < r - 1:
		s += 1
print(sum(l_1), sum(r_1))


(n, l, r) = input().split()
n = int(n)
l = int(l)
r = int(r)
m1 = 2 ** l - 1 + (n - l)
p2r = 2 ** r
m2 = p2r - 1 + (n - r) * (p2r // 2)
print(m1, m2)


import sys
(n, l, r) = map(int, sys.stdin.readline().split())
mini = maxi = 0
for i in range(l):
	mini += 2 ** i
mini += n - l
for i in range(n):
	maxi += 2 ** i
	if i == r - 1:
		break
maxi += (n - r) * 2 ** i
print(mini, maxi)


(a, b, c) = [int(x) for x in input().split(' ')]
mini = 0
b -= 1
for x in range(0, a):
	mini += 2 ** b
	if b > 0:
		b -= 1
maxi = 0
c -= 1
d = 0
for x in range(0, a):
	maxi += 2 ** d
	if d < c:
		d += 1
print(mini, maxi)


(n, l, r) = map(int, input().split())
s = [1] * n
k = s.copy()
m = s.copy()
for i in range(1, l):
	k[i - 1] = 2 ** i
for i in range(1, r):
	m[i:n] = [2 ** i] * (n - i)
print(sum(k), sum(m))


(n, l, r) = map(int, input().split())
m1 = 1 * (n - (l - 1))
j = 1
while j <= l - 1:
	m1 = m1 + 2 ** j
	j = j + 1
m2 = 0
for i in range(r):
	d = 2 ** i
	m2 = m2 + d
	j = i + 1
while j < n:
	m2 = m2 + d
	j = j + 1
print(m1, m2)


from sys import stdin, stdout
import bisect
import math

def st():
	return list(stdin.readline().strip())

def inp():
	return int(stdin.readline())

def li():
	return list(map(int, stdin.readline().split()))

def mp():
	return map(int, stdin.readline().split())

def pr(n):
	stdout.write(str(n) + '\n')

def soe(limit):
	l = [1] * (limit + 1)
	prime = []
	for i in range(2, limit + 1):
		if l[i]:
			for j in range(i * i, limit + 1, i):
				l[j] = 0
	for i in range(2, limit + 1):
		if l[i]:
			prime.append(i)
	return prime

def segsoe(low, high):
	limit = int(high ** 0.5) + 1
	prime = soe(limit)
	n = high - low + 1
	l = [0] * (n + 1)
	for i in range(len(prime)):
		lowlimit = low // prime[i] * prime[i]
		if lowlimit < low:
			lowlimit += prime[i]
		if lowlimit == prime[i]:
			lowlimit += prime[i]
		for j in range(lowlimit, high + 1, prime[i]):
			l[j - low] = 1
	for i in range(low, high + 1):
		if not l[i - low]:
			if i != 1:
				print(i)

def power(a, n):
	r = 1
	while n:
		if n & 1:
			r = r * a
		a *= a
		n = n >> 1
	return r

def solve():
	(n, l, r) = mp()
	(s, x) = (0, 0)
	for i in range(1, l):
		s += power(2, i)
	s += n - l + 1
	x = 1
	a = 1
	c = 1
	for i in range(1, r):
		a = power(2, i)
		x += a
		c += 1
	x += (n - c) * a
	print(s, x)
for _ in range(1):
	solve()


(n, l, r) = map(int, input().split())
arr = [1]
x = 1
x_arr = []
min_ = 0
max_ = 1
max_count = n - 1
max_max = 1
for i in range(l - 1):
	x *= 2
	x_arr.append(x)
	min_ += x
min_ += n - len(x_arr)
x = 1
x_arr = []
for i in range(r - 1):
	x *= 2
	x_arr.append(x)
	max_ += x
	max_count -= 1
if r != 1:
	max_max = max(x_arr)
if max_count != 0:
	t = max_count
	for i in range(t):
		max_count -= 1
		max_ += max_max
print(min_, max_)


(N, L, R) = map(int, input().split())
a1 = 0
for r in range(R):
	a1 += 2 ** r
a1 += 2 ** (R - 1) * (N - R)
a2 = 0
for l in range(L):
	a2 += 2 ** l
a2 += N - L
print(a2, a1)


(n, l, r) = map(int, input().split())
sm = 0
for i in range(l):
	sm += 2 ** i
print(sm + n - l, end=' ')
sm = 0
for i in range(r):
	sm += 2 ** i
sm += 2 ** (r - 1) * (n - r)
print(sm)


(n, l, r) = [int(x) for x in input().split()]

def minsum(n, l):
	sum = 0
	sum = sum + n - l
	max_no = 2 ** (l - 1)
	while l > 0:
		sum = sum + max_no
		max_no = max_no / 2
		l = l - 1
	return str(int(sum))

def max_sum(n, r):
	sum = 0
	max_no = 2 ** (r - 1)
	sum = sum + max_no * (n - r)
	while r > 0:
		sum = sum + max_no
		max_no = max_no / 2
		r = r - 1
	return str(int(sum))
print(minsum(n, l) + ' ' + max_sum(n, r))


(n, l, r) = map(int, input().split())
small = 0
large = 0
for i in range(1, l):
	small += 2 ** i
small += n - l + 1
for i in range(r - 1):
	large += 2 ** i
large += (n - r + 1) * 2 ** (r - 1)
print(small, large)


b = list(map(int, input().split()))
a = []
d = 4
e = 2
sum = 1 * b[0]
if b[1] == 1:
	a.append(sum)
elif b[1] == 2:
	sum = sum - b[1] + 1 + 2
	a.append(sum)
else:
	sum = 0
	sum += b[0] - b[1] + 1
	for i in range(b[0] - sum):
		sum += e
		e *= 2
	a.append(sum)
sum1 = 1
h = b[0] - 1
g = 2
for i in range(b[2] - 1):
	h -= 1
	sum1 += g
	g *= 2
if h > 0:
	g = g // 2
	sum1 += g * h
a.append(sum1)
for i in a:
	print(i, end=' ')


I = input
(n, l, r) = map(int, I().split())
minimum = n - l
for i in range(l):
	minimum += 2 ** i
maximum = (n - r) * 2 ** (r - 1)
for i in range(r):
	maximum += 2 ** i
print(minimum, maximum)


import sys

def main():
	(n, l, r) = map(int, sys.stdin.readline().split())
	sm = [1]
	for i in range(1, l):
		sm.append(sm[-1] * 2)
	for i in range(l, n):
		sm.insert(0, 1)
	lg = [1]
	for i in range(1, r):
		lg.append(lg[-1] * 2)
	for i in range(r, n):
		lg.append(lg[-1])
	print(sum(sm), sum(lg))
main()


import math
(n, l, r) = [int(i) for i in input().split()]
min = 0
min = n - l
t = math.pow(2, l)
p = math.pow(2, r)
min = min + t - 1
max = p + (n - r) * (p / 2) - 1
print(int(min), int(max))


(n, l, r) = list(map(int, input().split()))
(mins, maks) = (0, 0)
for i in range(1000):
	if i >= r:
		if i == n:
			break
		else:
			maks += temp
	elif i == n:
		break
	else:
		maks += 2 ** i
		temp = 2 ** i
if l == 1:
	mins = n
else:
	for i in range(1000):
		if i >= l:
			if i == n:
				break
			else:
				mins += 1
		elif i == n:
			break
		else:
			mins += 2 ** i
print(mins, maks)


(n, l, r) = map(int, input().split())
m = n - l + 1
cur = 1
for _ in range(n - l + 1, n):
	cur *= 2
	m += cur
M = 0
cur = 1
s = 1
for _ in range(n):
	M += cur
	if s < r:
		s += 1
		cur *= 2
print(m, M)


(n, l, r) = map(int, input().split())
temp = mx = mn = 0
k = 1
while temp != l:
	mx += k
	k *= 2
	temp += 1
mx += n - temp
temp = 0
k = 1
while temp != r:
	mn += k
	temp += 1
	if temp == r:
		break
	k *= 2
print(mx, mn + (n - temp) * k)


(n, l, r) = list(map(int, input().split()))
forced = 2 ** l - 1
mn = forced + n - l
if r > n:
	r = n
forced = 2 ** r - 1
mx = forced + 2 ** (r - 1) * (n - r)
print(mn, mx)


nlr = list(map(int, input().split()))
n = nlr[0]
l = nlr[1]
r = nlr[2]
low = pow(2, l) - 1 + n - l
up = pow(2, r) - 1 + (n - r) * pow(2, r - 1)
print(low, end=' ')
print(up)


(n, l, r) = map(int, input().split())
mini = []
maxi = []
maxi.append(1)
for i in range(l - 1):
	mini.append(2 ** (i + 1))
for i in range(r - 1):
	maxi.append(2 ** (i + 1))
print(sum(mini) + n - (l - 1), end=' ')
print(sum(maxi) + maxi[len(maxi) - 1] * (n - r))


import math
for _ in range(1):
	(n, l, r) = list(map(int, input().split()))
	i = 1
	j = 1
	sum1 = 1
	while i < l:
		sum1 = sum1 + j * 2
		j = j * 2
		i = i + 1
	sum1 = sum1 + (n - l)
	i = 1
	j = 1
	sum2 = 1
	while i < r:
		sum2 = sum2 + j * 2
		j = j * 2
		i = i + 1
	sum2 = sum2 + (n - r) * j
	print(sum1, sum2)


a = input().split()
for i in range(len(a)):
	a[i] = int(a[i])
n = a[0]
l = a[1]
r = a[2]
x1 = 0
x2 = 0
z = 0
potencia = 0
for i in range(n):
	x2 += 2 ** potencia
	if potencia < r - 1:
		potencia += 1
potencia = 0
for i in range(n):
	x1 += 2 ** potencia
	if potencia < l - 1 and z == 0:
		potencia += 1
	else:
		potencia = 0
		z = 1
print(x1, x2)


ln = [int(i) for i in input().split(' ')]
n = ln[0]
l = ln[1]
r = ln[2]
ms = n - l + 1
t = 1
for i in range(n - l + 1, n):
	ms += 2 ** t
	t += 1
mx = 0
t = 0
for i in range(0, r):
	mx += 2 ** t
	t += 1
t -= 1
mx += 2 ** t * (n - r)
print(ms, mx)


(n, l, r) = map(int, input().split())
x = 0.5
s = 0
k = 0
while k < l:
	x *= 2
	s += x
	k += 1
print(int(s + 1 * (n - k)), end=' ')
while k < r:
	x *= 2
	s += x
	k += 1
print(int(s + x * (n - k)))


(n, l, r) = map(int, input().split())
sum_min = n - l
sum_max = 0
ele = 1
for i in range(l):
	sum_min += ele
	ele *= 2
ele = 1
for i in range(r):
	sum_max += ele
	ele *= 2
sum_max += ele // 2 * (n - r)
print(f'{sum_min} {sum_max}')


(n, l, r) = map(int, input().split())
mi = 0
c = 0
for i in range(l, 1, -1):
	mi += pow(2, i - 1)
	c += 1
c = n - c
mi += c
ma = 0
c = 0
for i in range(r - 1):
	ma += pow(2, i)
	c += 1
c = n - c
ma += pow(2, r - 1) * c
print(mi, ma)


(n, l, r) = map(int, input().split())
(mi, ma) = (0, 0)
mi = n - l + 1
for i in range(1, l):
	mi += 2 ** i
for i in range(r):
	ma += 2 ** i
if r < n:
	ma += (n - r) * 2 ** (r - 1)
print(mi, end=' ')
print(ma)


(n, a, b) = input().split()
n = int(n)
a = int(a)
b = int(b)
min_sum = 0
max_sum = 0
power = 0
for i in range(a):
	min_sum += 2 ** power
	power += 1
power = 0
min_sum += n - a
for j in range(b):
	max_sum += 2 ** power
	power += 1
max_sum += (n - b) * 2 ** (power - 1)
print(min_sum, max_sum)


(n, l, r) = map(int, input().split())
m1 = pow(2, l) - 1 + n - l
m2 = pow(2, r) - 1 + (n - r) * pow(2, r - 1)
print(m1, m2)


(a, c, l) = map(int, input().split())
s = 1
for i in range(1, l):
	s += 2 ** i
r = a - l
if r > 0:
	o = 2 ** (l - 1)
	p = o * r
else:
	p = 0
q = 1
for i in range(1, c):
	q += 2 ** i
y = a - c
print(q + y, end=' ')
print(p + s)


(n, l, r) = map(int, input().split())
minn = []
maxx = []
for i in range(l):
	minn.append(2 ** i)
for i in range(r):
	maxx.append(2 ** i)
sum1 = min(minn) * (n - l) + sum(minn)
sum2 = max(maxx) * (n - r) + sum(maxx)
print(sum1, sum2)


def int_multiple():
	return [int(c) for c in input().split()]

def int_single():
	return int(input())

def str_multiple():
	return [c for c in input().split()]

def str_single():
	return input()
(n, l, r) = int_multiple()
diff = [1]
asd = 1
for i in range(r - 1):
	asd *= 2
	diff.append(asd)
minsum = 0
for i in range(l):
	minsum += diff[i]
minsum += diff[0] * (n - l)
maxsum = 0
for i in range(r):
	maxsum += diff[i]
maxsum += diff[r - 1] * (n - r)
print(str(minsum) + ' ' + str(maxsum))


(n, l, r) = map(int, input().split())
minimal = 2 ** l - 1 + n - l
maximal = 2 ** r - 1 + 2 ** (r - 1) * (n - r)
print(int(minimal), int(maximal))


(n, l, r) = map(int, input().split())
li = []
for i in range(0, 21):
	li.append(2 ** i)
if n == 1:
	print(1, 1)
elif r == 1:
	print(n, n)
elif l == n:
	print(sum(li[:n]), sum(li[:n]))
else:
	if l == 1:
		mini = n
	else:
		mini = sum(li[:l]) + (n - l)
	if r == n:
		maxi = sum(li[:n])
	else:
		maxi = li[r - 1] * (n - r + 1) + sum(li[:r - 1])
	print(mini, maxi)


(n, l, r) = map(int, input().split())
t = [1]
for num in range(1, r):
	t.append(2 * t[num - 1])
if l == 1:
	minimum = n
else:
	minimum = 1 * (n - l + 1) + sum(t[1:l])
if len(t) == n:
	maximum = sum(t)
else:
	maximum = max(t) * (n - r + 1) + sum(t[:r - 1])
print(minimum, maximum)


(n, l, r) = map(int, input().split())
c = 1
ans1 = 0
for i in range(l):
	ans1 += c
	c *= 2
ans1 += n - l
ans2 = 0
temp = r - 1
while temp >= 0:
	ans2 += pow(2, temp)
	temp -= 1
ans2 += (n - r) * pow(2, r - 1)
print(ans1, ans2)


tup = input()
(n, mi, ma) = (int(x) for x in tup.split())
min_list = []
max_list = []
i = 0
j = 0
while i < mi:
	min_list.append(pow(2, i))
	i += 1
while j < ma:
	max_list.append(pow(2, j))
	j += 1
while i < n:
	min_list.append(1)
	i += 1
mox = max(max_list)
while j < n:
	max_list.append(mox)
	j += 1
print(sum(min_list), sum(max_list))


(n, l, r) = map(int, input().split())
h = 2 ** r - 1 + 2 ** (r - 1) * (n - r)
t = n - l + (2 ** l - 1)
print(str(t) + ' ' + str(h))


from sys import stdin
(n, l, r) = [int(i) for i in stdin.readline().split(' ')]
minimum = n - l + 1 + 2 * (2 ** (l - 1) - 1)
maximum = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
print(str(minimum) + ' ' + str(maximum))


ints = [int(x) for x in input().split()]
n = ints[0]
l = ints[1]
r = ints[2]
print(2 ** l - 1 + (n - l), end=' ')
print(2 ** r - 1 + (n - r) * 2 ** (r - 1))


s = list(map(int, input().split(' ')))
min_ = 0
for i in range(s[1]):
	min_ += 2 ** i
min_ += s[0] - s[1]
max_ = 0
for i in range(s[2]):
	max_ += 2 ** i
max_ += 2 ** (s[2] - 1) * (s[0] - s[2])
print(min_, max_)


(n, l, r) = map(int, input().split())
MinSum = 2 ** l - 1 + (n - l)
MaxSum = 2 ** r - 1 + 2 ** (r - 1) * (n - r)
print(MinSum, MaxSum)


(n, l, r) = map(int, input().split())
if n < 2:
	print(1, 1)
elif l < 2 and r < 2:
	print(n, n)
else:
	lmin = 0
	lmax = 0
	for i in range(1, l):
		lmin += 2 ** i
	lmin += n - l + 1
	for i in range(1, r):
		lmax += 2 ** i
	lmax += 1
	lmax += (n - r) * 2 ** i
	print(lmin, lmax)


(a, s, d) = map(int, input().split())
high = 2 ** d - 1 + 2 ** (d - 1) * (a - d)
low = 2 ** s - 1 + (a - s)
print(low, high)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import ceil, floor
from copy import *
from collections import deque, defaultdict
from collections import Counter as counter
from itertools import combinations
from itertools import permutations as permutate
from bisect import bisect_left as bl
from operator import *
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192
from sys import stderr

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def fsep():
	return map(float, inp().split())

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def pow(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
from functools import reduce

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def gcd(a, b):
	if a == b:
		return a
	while b > 0:
		(a, b) = (b, a % b)
	return a

def prefix_sum(ar):
	return list(accumulate(ar))

def suffix_sum(ar):
	return list(accumulate(ar[::-1]))[::-1]

def N():
	return int(inp())
dx = [0, 0, 1, -1]
dy = [1, -1, 0, 0]
from collections import defaultdict

def numberOfSetBits(i):
	i = i - (i >> 1 & 1431655765)
	i = (i & 858993459) + (i >> 2 & 858993459)
	return ((i + (i >> 4) & 252645135) * 16843009 & 4294967295) >> 24
from decimal import *
from math import *

def solve():
	(n, l, r) = sep()
	mi = 2 ** l - 1 + n - l
	ma = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
	print(mi, ma)
solve()


(n, l, r) = map(int, input().split())
a = []
mini = 0
for t in range(0, l):
	mini += 2 ** t
mini += n - l
print(mini, end=' ')
maxi = 0
x = 0
for i in range(0, r):
	maxi += 2 ** i
	x = 2 ** i
maxi += (n - r) * x
print(maxi)


(n, l, r) = list(map(int, input().split()))
least = 2 * (2 ** (l - 1) - 1)
least = least + (n - l + 1)
high = 2 * (2 ** (r - 1) - 1)
high = high + 1
high = high + (n - r) * 2 ** (r - 1)
print(least, high)


import math
import sys
DEBUG = False

def inp():
	return sys.stdin.readline().rstrip()

def dprint(*value, sep=' ', end='\n'):
	if DEBUG:
		print(*value, sep=sep, end=end)

def solve(N, L, R):
	lmax = 2 ** (L - 1)
	l = [lmax]
	while len(l) < N:
		l.append(l[-1] // 2 if l[-1] > 1 else 1)
	rmax = 2 ** (R - 1)
	r = [1]
	while len(r) < N:
		r.append(r[-1] * 2 if r[-1] < rmax else rmax)
	return (sum(l), sum(r))

def main():
	(N, L, R) = [int(e) for e in inp().split()]
	print(*solve(N, L, R))
main()


def seq(x):
	return 2 * (1 - 2 ** x) * -1
(n, l, r) = list(map(int, input().split()))
low = n - l + 1 + seq(l - 1)
high = 1 + (n - r) * 2 ** (r - 1) + seq(r - 1)
print(low, high)


(n, l, r) = [int(i) for i in input().split()]
(m, k) = (0, 0)
for i in range(l):
	m += 2 ** i
m += n - l
for i in range(r):
	k += 2 ** i
k += 2 ** (r - 1) * (n - r)
print(m, k)


(n, l, r) = map(int, input().split())
s = 0
j = 2
for i in range(l - 1):
	s += j
	j *= 2
s += n - l + 1
print(s, end=' ')
s = 0
j = 1
k = 0
for i in range(n):
	s += j
	k += 1
	if k < r:
		j *= 2
print(s)


twos = [2 ** i for i in range(21)]

def hit(n, l, r):
	global twos
	sm = 0
	bg = 0
	for i in range(l):
		sm += twos[i]
	sm += n - l
	for i in range(r):
		bg += twos[i]
	bg += twos[r - 1] * (n - r)
	print(sm, bg)

def test():
	pass
ls = [int(i) for i in input().split()]
hit(ls[0], ls[1], ls[2])


import sys
import math
import bisect

def main():
	(n, l, r) = map(int, input().split())
	A = []
	for i in range(l):
		A.append(2 ** i)
	while len(A) < n:
		A.append(1)
	A.sort()
	B = []
	for i in range(r):
		B.append(2 ** i)
	while len(B) < n:
		B.append(B[-1])
	B.sort()
	print('%d %d' % (sum(A), sum(B)))
main()


import math
(n, l, r) = map(int, input().split())
print(n - (l - 1) + 2 * (pow(2, l - 1) - 1), pow(2, r) - 1 + pow(2, r - 1) * (n - r))


(n, l, r) = map(int, input().split())
filtermin = []
filtermax = []
tmp = 1
ll = l
while ll > 1:
	tmp = tmp * 2
	filtermin.append(tmp)
	ll -= 1
sz = n - len(filtermin)
print(sum(filtermin) + sz, end=' ')
tmp = 1
rr = r
filtermax.append(tmp)
while rr > 1:
	tmp = tmp * 2
	filtermax.append(tmp)
	rr -= 1
sz = n - len(filtermax)
print(sum(filtermax) + tmp * sz)


(n, l, r) = map(int, input().split())
s1 = 0
s2 = 0
fr = 0
s1 += n - l + 1
nxt = 2
for i in range(l - 1):
	s1 += nxt
	nxt *= 2
nxt = 1
pos = 0
for i in range(min(n, r)):
	s2 += nxt
	nxt *= 2
	pos += 1
if pos < n:
	s2 += (n - pos) * (nxt // 2)
print(s1, s2)


(n, l, r) = map(int, input().split())
mini = (n - l) * 1
for x in range(0, l):
	mini += 2 ** x
maxi = 0
y = 0
for y in range(0, r):
	maxi += 2 ** y
maxi += (n - r) * 2 ** y
print(mini, maxi)


R = lambda : map(int, input().split())
(n, l, r) = R()
print(2 ** l - 1 + (n - l), 2 ** r - 1 + (n - r) * 2 ** (r - 1))


import math
import sys
import collections

def getdict(n):
	d = {}
	if type(n) is list:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)
(n, l, r) = mi()
mins = 2 ** l - 1 + (n - l)
maxs = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
print(mins, maxs)


import sys, math, queue
MOD = 998244353
sys.setrecursionlimit(1000000)
(n, l, r) = map(int, input().split())
x = sum((1 << i for i in range(l))) + n - l
y = sum((1 << i for i in range(r))) + (1 << r - 1) * (n - r)
print(x, y)


n = [int(i) for i in input().split()]
(l, s, r) = (n[0], n[1], n[2])
z = [2 ** int(i) for i in range(s)]
z1 = [2 ** int(i) for i in range(r)]
if l == 1:
	print(l, l)
else:
	y = 0
	if s == 1:
		x = l
	else:
		a = l - s + 1
		x = a
		for i in range(1, l - a + 1):
			x += 2 ** i
	for i in range(0, r):
		y += 2 ** i
	y += 2 ** i * (l - r)
	print(x, y)


(n, l, r) = [int(i) for i in input().split()]
group1 = [1]
for i in range(1, n):
	if l > 1:
		group1.append(group1[i - 1] * 2)
		l -= 1
	else:
		group1.append(1)
group2 = [1]
for i in range(1, n):
	if r > 1:
		group2.append(group2[i - 1] * 2)
		r -= 1
	else:
		group2.append(group2[i - 1])
print(sum(group1), sum(group2))


(n, l, r) = map(int, input().split())
a = 0
b = 0
sum1 = n - l + 1
for i in range(l):
	a = a + 2 ** i
p = min(r, n)
max_sum = 2 ** p - 1 + 2 ** (r - 1) * max(0, n - r)
print(sum1 + a - 1, max_sum)


(n, l, r) = list(map(int, input().split()))
ans = []
for i in range(r):
	ans.append(2 ** i)
maximum = max(ans)
minimum = min(ans)
temp1 = ans[:l]
temp2 = ans[:r]
temp1 = temp1 + [minimum] * (n - l)
temp2 = temp2 + [maximum] * (n - r)
print(sum(temp1), sum(temp2))


(n, l, r) = map(int, input().split())
ans1 = n - l
base = 1
for i in range(1, l + 1, 1):
	ans1 = base + ans1
	base = base * 2
a = 1
ans2 = 0
for i in range(1, r + 1, 1):
	ans2 = ans2 + a
	a = a * 2
a = a // 2
ans2 = ans2 + (n - r) * a
print('%d %d' % (ans1, ans2))


def solve(n, l, r):
	min_sum = 2 ** l - 1 + n - l
	temp = 2 ** (r - 1)
	max_sum = 2 * temp - 1 + (n - r) * temp
	return (min_sum, max_sum)
(n, l, r) = map(int, input().split())
(min_sum, max_sum) = solve(n, l, r)
print(min_sum, max_sum)


(n, l, r) = [int(x) for x in input().split()]
best = 2 ** r - 1 + 2 ** (r - 1) * (n - r)
worst = 2 ** l - 1 + (n - l)
print(worst, best)


(n, l, r) = map(int, input().split())
mx = 0
for x in range(l, min(n + 1, r + 1)):
	mx = max((n - x + 2) * (1 << x - 1) - 1, mx)
mi = n - l + (1 << l) - 1
print(mi, mx)


from sys import stdin

def iinput():
	return int(stdin.readline())

def minput():
	return map(int, stdin.readline().split())

def linput():
	return list(map(int, stdin.readline().split()))
(n, l, r) = minput()
mn = n - l
temp = 1
while l:
	mn += temp
	temp *= 2
	l -= 1
R = r
mx = 0
temp = 1
while r:
	mx += temp
	temp *= 2
	r -= 1
mx += (n - R) * (temp // 2)
print(mn, mx)


(n, l, r) = map(int, input().split())
max_s = 0
min_s = 0
for i in range(r):
	max_s += 2 ** i
max_s += (n - r) * 2 ** (r - 1)
for i in range(l):
	min_s += 2 ** i
min_s += n - l
print(min_s, max_s)


(n, l, r) = map(int, input().split())
maxi = []
mini = []
maxi.append(1)
mini.append(1)
count = 1
count1 = 1
for i in range(1, n):
	if count < r:
		maxi.append(maxi[i - 1] * 2)
		count += 1
	if count1 < l:
		mini.append(mini[i - 1] * 2)
		count1 += 1
for i in range(count, n):
	maxi.append(maxi[count - 1])
for i in range(count1, n):
	mini.append(1)
ans1 = sum(maxi)
ans2 = sum(mini)
print(ans2, ans1)


inp = list(map(int, input().split()))
n = int(inp[0])
l = int(inp[1])
r = int(inp[2])
mi = []
ma = []
for i in range(l):
	mi.append(pow(2, i))
for i in range(r):
	ma.append(pow(2, i))
p = mi[0]
for i in range(n - len(mi)):
	mi.append(p)
q = ma[len(ma) - 1]
for i in range(n - len(ma)):
	ma.append(q)
ans1 = 0
for i in range(n):
	ans1 += mi[i]
ans2 = 0
for i in range(n):
	ans2 += ma[i]
print(str(ans1) + ' ' + str(ans2))


(n, l, r) = map(int, input().split())
minA = 0
maxA = 0
if l > 0:
	minA = int(2 ** (l - 1))
	maxA = 1
	j = l - 1
	for _ in range(1, n):
		if j < l:
			j -= 1
			if j == -1:
				j = 0
			minA += int(2 ** j)
	i = 0
	for _ in range(1, n):
		if i < r:
			i += 1
			if i == r:
				i = r - 1
			maxA += int(2 ** i)
print(minA, maxA)


(n, l, r) = map(int, input().split())
mi = []
mx = []
k = 1
for i in range(l):
	mi.append(k)
	k = k * 2
k = 1
for i in range(r):
	mx.append(k)
	k *= 2
mi_l = n - len(mi)
mx_l = n - len(mx)
while mi_l:
	mi.append(mi[0])
	mi_l -= 1
while mx_l:
	mx.append(mx[-1])
	mx_l -= 1
print(sum(mi), sum(mx))


import sys
input = sys.stdin.readline
(n, l, r) = [int(i) for i in input().split()]
min = 0
min += n - l + 1
min += -2 * (1 - pow(2, l - 1))
max = 1
a = 2 ** (r - 1) * (n - r + 1)
max += a
max += -2 * (1 - pow(2, r - 2))
print(int(min), int(max))


def min(n, l, r):
	m = [pow(2, i) for i in range(0, n)]
	j = []
	for i in range(l, r + 1):
		j.append(m[0:i])
	ree = []
	re = []
	for a in j:
		ree = []
		for i in range(0, n - len(a)):
			ree.append(a[0])
		for i in range(0, len(a)):
			ree.append(a[len(a) - i - 1])
		re.append(ree)
	min = 99999999999999
	for i in re:
		if sum(i) < min:
			min = sum(i)
	return min

def max(n, l, r):
	m = [pow(2, i) for i in range(0, n)]
	j = []
	for i in range(l, r + 1):
		j.append(m[0:i])
	re = []
	for a in j:
		ree = []
		for i in range(0, len(a) - 1):
			ree.append(a[i])
		for i in range(0, n - len(a) + 1):
			ree.append(a[len(a) - 1])
		re.append(ree)
	min = -99999999999999
	for i in re:
		if sum(i) > min:
			min = sum(i)
	return min
(n, l, r) = list(map(int, input().split()))
a = []
if n == 0:
	print(0, 0)
else:
	a.append(1)
	print(min(n, l, r), max(n, l, r))


(n, l, r) = map(int, input().split())
print((1 << l) - 1 + n - l, end=' ')
print((1 << r) - 1 + (n - r) * (1 << r - 1))


(n, l, r) = [int(x) for x in input().split()]
mis = 0
mas = 0
mis = (n - (l - 1)) * 1
pw1 = 1
while l - 1 > 0:
	mis += 2 ** pw1
	pw1 += 1
	l -= 1
mas = (n - (r - 1)) * 2 ** (r - 1)
pw2 = r - 2
while r - 1 > 0:
	mas += 2 ** pw2
	pw2 -= 1
	r -= 1
print(mis, mas)


import math
(n, l, r) = map(int, input().split())
MIN = 0
i = 1
while i <= 2 ** (l - 1):
	MIN += i
	i *= 2
MIN += n - l
MAX = 0
i = 1
while i <= 2 ** (r - 1):
	MAX += i
	i *= 2
MAX += math.floor((n - r) * (i / 2))
print(MIN, MAX)


(n, l, r) = map(int, input().split())
min_ans = n - l + 1
cur = 1
for _ in range(l - 1):
	cur *= 2
	min_ans += cur
max_ans = 1
cur = 1
for _ in range(r - 1):
	cur *= 2
	max_ans += cur
max_ans += cur * (n - r)
print(min_ans, max_ans)


def g(n, k, ind):
	data = [1]
	for i in range(k - 1):
		data.append(data[-1] * 2)
	for i in range(n - k):
		data.append(data[ind])
	return sum(data)
(n, l, r) = map(int, input().split())
print(g(n, l, 0), g(n, r, -1))


(n, l, r) = list(map(int, input().split()))
m0 = 0
for i in range(1, n + 1):
	if i <= n - l + 1:
		m0 += 1
	else:
		m0 += 2 ** (i - (n - l + 1))
m1 = 0
for i in range(1, n + 1):
	if i <= r:
		m1 += 2 ** (i - 1)
	else:
		m1 += 2 ** (r - 1)
print(m0, m1)


(n, l, r) = [int(j) for j in input().split()]
a = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
b = n - l + 2 ** l - 1
print(b, a)


import math
(n, l, r) = map(int, input().split())
(mini, maxi) = (0, 0)
mini = n - l + 1
j = 1
while j < l:
	mini += int(math.pow(2, j))
	j += 1
i = 0
while i < n:
	if i < r:
		maxi += int(math.pow(2, i))
	else:
		maxi += int(math.pow(2, r - 1))
	i += 1
print(mini, maxi)


(n, l, r) = map(int, input().strip().split())
ansa = 2 ** l - 1 + (n - l)
ansb = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
print('%d %d' % (ansa, ansb))


(n, l, r) = map(int, input().split())
ma = 0
minele = 2 ** (l - 1)
maxele = 2 ** (r - 1)
repmi = n - (l - 1)
sumsmi = repmi - 1
serisummin = 0
serisummin = 2 ** l - 1
mi = serisummin + sumsmi
rep = n - (r - 1)
sums = 0
sums = maxele * rep
serisum = 0
serisum = 2 ** (r - 1) - 1
ma = serisum + sums
print(mi, end=' ')
print(ma)


import sys
for line in sys.stdin:
	line.rstrip()
	(n, l, r) = line.split()
	n = int(n)
	l = int(l)
	r = int(r)
	min_sum = 2 ** l - 1 + n - l
	max_sum = 2 ** r - 1 + (n - r) * 2 ** (r - 1)
	print(min_sum, max_sum)


line = input()
pui = line.split()
n = int(pui[0])
l = int(pui[1])
h = int(pui[2])
x = n
lsum = 0
hsum = 0
while x != 0:
	high = 2 ** (h - 1)
	for i in range(x - h + 1):
		hsum = high + hsum
		x = x - 1
	h = h - 1
x = n
fao = 0
while x != 0:
	low = 2 ** fao
	for i in range(x - l + 1):
		lsum = low + lsum
		x = x - 1
	l = l - 1
	fao = fao + 1
print(lsum, hsum)


(n, r, l) = map(int, input().split())
min = 0
x = 0
for i in range(0, n):
	if r == 1:
		min = min + 1
	else:
		min = min + 2 ** (r - 1)
		r = r - 1
print(min, end=' ')
max = 0
for i in range(0, n):
	if x == l - 1:
		max = max + 2 ** x
	else:
		max = max + 2 ** x
		x += 1
print(max)


(n, l, r) = map(int, input().split())
(L1, L2) = ([], [])
for i in range(max(l, r)):
	L1.append(2 ** i)
le = n - len(L1)
k = max(L1)
for i in range(le):
	L1.append(k)
ans1 = n - (l - 1)
for i in range(ans1):
	L2.append(1)
for i in range(1, l):
	L2.append(2 ** i)
print(sum(L2), sum(L1))


def lost(n, l, r):
	return (2 ** l - 1 + (n - l), 2 ** r - 1 + (n - r) * 2 ** (r - 1))
(N, L, R) = [int(i) for i in input().split()]
print(*lost(N, L, R))


(n, ll, r) = map(int, input().split())
b = 2 ** ll
c = b - 2
c = c + (n - (ll - 1))
minval = c
b = 2 ** r
c = b - 1
maximum = 2 ** (r - 1)
c = c + (n - r) * maximum
print(minval, c, sep=' ')


(n, l, r) = map(int, input().split(' '))
n1 = n
sum1 = 0
sum2 = 0
mini = 2 ** (l - 1)
maxi = 2 ** (r - 1)
while mini > 1 and n > 0:
	sum1 += mini
	n -= 1
	mini = mini // 2
sum1 += n
n = n1
count = n - r + 1
lol = 1
r -= 1
while r > 0:
	sum2 += lol
	lol *= 2
	r -= 1
	n -= 1
sum2 += n * maxi
print(sum1, sum2)


import pdb
import sys
x = sys.stdin.readline()
(n, l, r) = list(map(int, x.split()))
min_sum = 0
max_sum = 0
for summer in range(l):
	min_sum += pow(2, summer)
min_sum += n - l
max_sum = 0
for summer in range(r):
	max_sum += pow(2, summer)
max_sum += pow(2, r - 1) * (n - r)
print(min_sum, max_sum)