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: interview

Starter code:

Solutions:
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=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 = list(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 = map(int, input().split())

mi = 2**l-1 + (n-l)

ma = 2**r-1 + (n-r) * 2**(r-1)

print(mi, ma)

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

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)

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)


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, r = map(int, input().split())
a = (n - l) + (2 ** l - 1)
b = (n - r) * (2 ** (r - 1)) + (2 ** r - 1)
print(a, b)

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)

# l <= ai <= r
n,l,r = list(map(int,input().split()))

# mn
forced = 2**l - 1
mn = forced + n - l

# mx
if r > n:
    r = n

forced = 2**r - 1
mx = forced + 2**(r-1) * (n - r)

print(mn,mx)


# TAIWAN NUMBER ONE!!!!!!!!!!!!!!!!!!!
# TAIWAN NUMBER ONE!!!!!!!!!!!!!!!!!!!
# TAIWAN NUMBER ONE!!!!!!!!!!!!!!!!!!!
from sys import stdin, stdout
import math
import copy
 
#T = int(input())
#N = int(input())
#s = input()
#print(N)
N,L,R = [int(x) for x in stdin.readline().split()]
#arr = [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)

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)

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

print(mn, mx)

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

# Contest: Codeforces Round #581 (Div. 2) (https://codeforces.com/contest/1204)
# Problem: B: Mislove Has Lost an Array (https://codeforces.com/contest/1204/problem/B)

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)


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 = list(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 = 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 = [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)

#581_B

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())

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 = n - l + 2 ** l - 1
mx = (n - r) * 2 ** (r - 1) + 2 ** r - 1
print(*[mn, mx])

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 = 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)