Problem:
 Score : 100 points    Problem Statement We conducted a survey on newspaper subscriptions.
More specifically, we asked each of the N respondents the following two questions:   Question 1 : Are you subscribing to Newspaper X?  Question 2 : Are you subscribing to Newspaper Y?   As the result, A respondents answered "yes" to Question 1 , and B respondents answered "yes" to Question 2 .  What are the maximum possible number and the minimum possible number of respondents subscribing to both newspapers X and Y?  Write a program to answer this question.      Constraints  1 \leq N \leq 100  0 \leq A \leq N  0 \leq B \leq N  All values in input are integers.         Input Input is given from Standard Input in the following format:  N  A  B       Output Print the maximum possible number and the minimum possible number of respondents subscribing to both newspapers, in this order, with a space in between.        Sample Input 1 10 3 5      Sample Output 1 3 0  In this sample, out of the 10 respondents, 3 answered they are subscribing to Newspaper X, and 5 answered they are subscribing to Newspaper Y.  Here, the number of respondents subscribing to both newspapers is at most 3 and at least 0 .       Sample Input 2 10 7 5      Sample Output 2 5 2  In this sample, out of the 10 respondents, 7 answered they are subscribing to Newspaper X, and 5 answered they are subscribing to Newspaper Y.  Here, the number of respondents subscribing to both newspapers is at most 5 and at least 2 .       Sample Input 3 100 100 100      Sample Output 3 100 100

Solution (Python):
N, A, B = list(map(int, input().split()))

print(min(A,B), max(0, A+B-N))

Solution (Python):


def main():
    """Function."""
    n, a, b = map(int, input().split())

    maxim = min(a, b)
    minim = a + b - n

    if minim > 0:
        print(maxim, minim)
    else:
        print(maxim, 0)


if __name__ == "__main__":
    main()

Solution (Python):
n,a,b=map(int,input().split())

print(min(a,b),max(0,a+b-n))

Solution (Python):
N, A, B = map(int, input().split())
print(min(A, B), max(A+B-N, 0))

Solution (Python):
def main():
  n, a, b = [int(i) for i in raw_input().strip().split()]
  print('%d %d' % (min(a, b), max(a + b - n, 0)))

if __name__ == '__main__':
  main()

Solution (Python):
N, A, B = map(int, input().split())


ma = min(A, B)
mi = max(A+B-N, 0)

ans = [str(ma), str(mi)]

print(' '.join(ans))

Solution (Python):
N,A,B=map(int,input().split())

ans1=0
ans2=0

if A>B:
  ans1=B
else:
  ans1=A
  
if N-A-B<0:
  ans2=abs(N-A-B)
  
print(ans1,ans2)

Solution (Python):

import collections, atexit, math, sys, bisect 

sys.setrecursionlimit(1000000)
def getIntList():
    return list(map(int, input().split()))    

try :
    
    import numpy
    def dprint(*args, **kwargs):
        
        
        print(*args,  file=sys.stderr)
    dprint('debug mode')
except Exception:
    def dprint(*args, **kwargs):
        pass



inId = 0
outId = 0
if inId>0:
    dprint('use input', inId)
    try:
        f = open('input'+ str(inId) + '.txt', 'r')
        sys.stdin = f 
    except Exception:
        dprint('invalid input file')
if outId>0:
    dprint('use output', outId)
    try:
        f = open('stdout'+ str(outId) + '.txt', 'w')
        sys.stdout = f 
    except Exception:
        dprint('invalid output file')
        
    atexit.register(lambda :sys.stdout.close())     
    
N,A,B = getIntList()

print(min(A,B),  max(A+B-N,0) )

Solution (Python):
n,a,b = map(int,input().split())
print("{} {}".format(min(a,b),max(a+b-n,0)))

Solution (Python):
N,A,B=list(map(int,input().split()))

x=min(A,B)
if N>=A+B: y=0
else: y=A+B-N

print(x,y)

Solution (Python):
n, a, b = map(int, input().split())
p = min(a, b)
q = max((a+b)-n, 0)

print(p, q)

Solution (Python):
a,b,c = map(int,input().split())

aa = min(b,c)

bb = b+c - a

if bb >= 0:
	print(aa,bb)
else:
	print(aa,0)

Solution (Python):
N, A, B = map(int, input().split(" "))
ans1 = min(A, B)
ans2 = max((A+B)-N, 0)
print(ans1, ans2)

Solution (Python):
from statistics import mean, median,variance,stdev
import sys
import math
import fractions

def j(q):
    if q==1: print("YES")
    else:print("NO")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())



x,y,z = (int(i) for i in input().split())    







if y+z<x: c = 0
else:c = y+z-x

print(min(y,z),c)

Solution (Python):
N, A, B = (int(i) for i in input().split())
ans = str(min(A, B)) + " " + str(max(A+B-N, 0))
print(ans)

Solution (Python):
N,A,B = map(int, input().split())
print(min(A,B),max(A+B-N,0))

Solution (Python):
p = input().split()
n = int(p[0])
a = int(p[1])
b = int(p[2])
if n <= a+b:
    print(str(min(a,b))+" "+str(-n+a+b))
else:
    print(str(min(a,b))+" "+str(0))

Solution (Python):
n,a,b = list(map(int, input().split()))
print(min(a,b), max(a+b-n,0))

Solution (Python):
N, A, B = list(map(int, input().split()))

if A + B <= N:
	print(min(A, B), 0)
else:
	print(min(A, B), A + B - N)

Solution (Python):
n,a,b = map(int,input().split())
print(min(a,b),max(a+b-n,0))

Solution (Python):
N, A, B = map(int, input().split())
print(str(min(A, B))+' '+str(max(0, A+B-N)))

Solution (Python):
N, A, B = [int(a) for a in input().split()]

x = min(A, B)
y = max(0, A+B-N)
print(str(x) + " " + str(y))

Solution (Python):
N,A,B = map(int,input().split())
print(min(A,B), max(0,A+B-N))

Solution (Python):
n,a,b = map(int,input().split())
print(min(a,b),max(0,a+b-n))

Solution (Python):
n,a,b = map(int,input().split())
if a+b-n >= 0:
    ans = a+b-n
else:
    ans = 0
print(min(a,b),ans)

Solution (Python):
a,b,c=map(int, input().split(" "))
print(min(b,c),max(0,b+c-a))

Solution (Python):
N, A, B = map(int, input().split())

print(min(A, B), max(A+B-N, 0))

Solution (Python):


import sys


INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


n, a, b = LI()


if n >= a + b:
    print(min(a, b), 0)
else:
    print(min(a, b), a + b - n)

Solution (Python):
N, A, B = list(map(int, input().split()))

X = min(A, B)
Y = max(A + B - N, 0)

print(X, Y)

Solution (Python):
N,A,B=map(int,input().split())
a=min(A,B)
b=max(A+B-N,0)
print(a,b)

Solution (Python):
n,a,b=map(int,input().split())
print(min(a,b),end=' ')
print(max(0,a+b-n))

Solution (Python):
N, A, B = map(int, input().split())
print(min(A, B), max(0, A + B - N))

Solution (Python):
import sys
import math
import collections
import itertools
import array
import inspect


sys.setrecursionlimit(1000000)



def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))



def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v



def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk



def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False



dp = None


def main():
    N, A, B = li_input()

    ansmax = min(A, B)
    ansmin = max(0, (A + B) - N)

    print(ansmax, ansmin)


main()

Solution (Python):
n,a,b = map(int,input().split())

print(min(a,b),max(a+b-n,0))

Solution (Python):


import math
import fractions
import heapq
import collections
import re
import array
import bisect

from collections import Counter, defaultdict


def array2d(dim1, dim2, init=None):
    return [[init for _ in range(dim2)] for _ in range(dim1)]

II = lambda: int(input())
MI = lambda: map(int, input().split())


N, A, B = MI()
print(min(A, B), max(A + B - N, 0))

Solution (Python):

N, A, B = map(int, input().split())
print(min(A, B), max(0, A + B - N))

Solution (Python):
n, a, b = map(int, input().split())
max_ans = min(a, b)
min_ans = max(a + b - n, 0)
print(str(max_ans) + " " + str(min_ans))

Solution (Python):
N, A, B = map(int, input().split())
ansmax = min(A, B)
ansmin = max(0, A + B - N)
print(ansmax, ansmin)

Solution (Python):
n,a,b=map(int,input().split())
print(min(a,b),max((a+b)-n,0))

Solution (Python):
N, A, B = map(int, input().split())

print(min(A,B), max(0, A+B-N))

Solution (Python):
N, A, B = map(int, input().split())

print(min(A, B), end=' ')
print(max(0, A+B-N))

Solution (Python):
N,A,B = map(int, input().split())
if N-A-B>=0:
    print(min(A,B),0)
else:
    print(min(A,B), A+B-N)

Solution (Python):
def getN():
    return int(input())

def getMN():
    a = input().split()
    b = [int(i) for i in a]
    return b[0],b[1]

def getlist():
    a = input().split()
    b = [int(i) for i in a]
    return b

n, a, b = getlist()

ma = str(min(a,b))
mi = str(max(a+b-n, 0))

print(" ".join([ma,mi]))

Solution (Python):
n,a,b = map(int, input().split())

print(min(a,b), max(0, a+b-n))

Solution (Python):
N, A, B = list(map(int, input().split()))

ans1 = min(A, B)
ans2 = max((A + B - N), 0)

print(str(ans1) + ' ' + str(ans2))

Solution (Python):
n, a, b = list(map(int, input().split()))

max_ = min(a,b)
min_ = max(a + b - n, 0)
print(max_, min_)

Solution (Python):
n, a, b = list(map(int, input().split()))
mi = max(0, a + b - n)
ma = min(n, min(a, b))
print(ma, mi)

Solution (Python):
n,a,b=map(int,input().split())
x=min(a,b)
if a+b-n>0:
  y=a+b-n
else:
  y=0
print(x,y)

Solution (Python):
n,a,b = map(int,input().split())
maxa = min(a,b)
if a+b>=n:
    mina = a+b-n
else:
    mina = 0
print(maxa,mina)

Solution (Python):

N,A,B=list(map(int,input().split()))

print(str(min(A,B))+" "+str(max(0,A+B-N)))

Solution (Python):
N, A, B = map(int, input().split())

maxi = min(A, B)
if N >= A+B:
    mini = 0
else:
    mini = A+B-N


print(maxi, mini)

Solution (Python):
N, A, B = (int(i) for i in input().split())  

print(min(A,B), max(A + B - N , 0))

Solution (Python):
n, a, b = [int(i) for i in input().split()]
print(min(a, b), max(0, a + b - n))

Solution (Python):
n, a, b = [int(_) for _ in input().split()]

ans_max = min(a, b)
ans_min = max(a+b-n, 0)

print(ans_max, ans_min)

Solution (Python):
N,A,B = map(int,input().split())

ans1 = min(A,B)
ans2 = max(-(N-A-B),0)
print(ans1,ans2)

Solution (Python):
from sys import stderr, setrecursionlimit
setrecursionlimit(2147483647)
def getInt():
    return int(input())
def getInts():
    return [int(i) for i in input().split()]
def getIntLines(n=1):
    res = []
    for _ in range(n):
        res.append(getInt())
    return res
def getIntsLines(n=1):
    res = []
    for _ in range(n):
        res.append(getInts())
    return res
def debug(*args, **kwargs):
    print(*args, file=stderr, **kwargs)

n, a, b = getInts()
print(min(a, b), max(0, a+b-n))

Solution (Python):
N, A, B = map(int, input().split())

M = min(A, B)
m = max(0, (A + B) - N)
print(M, m)

Solution (Python):
n,a,b  = map(int,input().split())
print(min(a,b),max(0,a+b-n))

Solution (Python):
def inpl(): return list(map(int, input().split()))


N, A, B = inpl()

print(min(A, B), max(A+B-N, 0))

Solution (Python):
N, A, B = [int(elem) for elem in input().split()]

max_people = min(A, B)
min_people = max(0, A + B - N)

print(max_people, min_people)

Solution (Python):
N, A, B = map(int, input().split())

print(min(A,B), max(0,A+B-N))

Solution (Python):
n,a,b=map(int,input().split())
print(min(a,b),end=" ")
if a+b>n:
    print(a+b-n)
else:
    print(0)

Solution (Python):



n,a,b = [int(i) for i in input().split()]

print(min(a,b), max(0, a+b-n))

Solution (Python):
N, A, B = map(int, input().split())
print(min(A, B), max(A+B-N, 0))

Solution (Python):
n, a, b = map(int, input().split())
print(min(a, b), max(0, a + b - n))

Solution (Python):
N, A, B = [int(_) for _ in input().split()]
print(min([A, B]), max([A + B - N, 0]))

Solution (Python):
N,A,B = map(int,input().split())
print(min(A,B), max(0, (A+B) - N))

Solution (Python):
def main():
    N, A, B = map(int, input().split())
    mx = min(A, B)
    mn = max(A+B-N, 0)
    print(mx, mn)


if __name__ == "__main__":
    main()

Solution (Python):
N, A, B = [int(_) for _ in input().split()]

print(min(A, B), max(A + B - N, 0))

Solution (Python):
N,A,B = map(int,input().split())
print(min(A,B),max(A+B-N,0))

Solution (Python):
N,A,B=map(int,input().split())
x=min(A,B)
y=max(0,A+B-N)
print(max(x,y),min(x,y))

Solution (Python):
N, A, B = map(int, input().split())

ma = min(A, B)
mi = max(A+B-N, 0)

print(ma, mi)

Solution (Python):
n, a, b = map(int, input().split())
mn = max(a+b-n,0)
mx = min(a,b)
print(mx, mn)

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
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 [int(x) for x in sys.stdin.readline().split()]
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 main():
    n,a,b = LI()

    return "{} {}".format(min(a,b), max(a+b-n,0))



print(main())

Solution (Python):

def main():
    buf = input()
    buflist = buf.split()
    N = int(buflist[0])
    A = int(buflist[1])
    B = int(buflist[2])
    print(min(A,B), max(0, (A+B)-N))

if __name__ == '__main__':
    main()

Solution (Python):
N, A, B = map(int, raw_input().split())
X = min(A, B)
Y = max(0, A + B - N)
print X, Y

Solution (Python):
n,a,b = map(int,input().split())
print(min(a,b),max(0,a+b-n))

Solution (Python):
def main():
    n, a, b = map(int, raw_input().split())
    print min(a, b), max(a + b - n, 0)


if __name__ == '__main__':
    main()

Solution (Python):
N,A,B = map(int,input().split(" "))

print(min(N,A,B),max(A+B-N,0))

Solution (Python):
n,a,b = map(int,input().split())
print(min(a,b),max(0,a + b - n))

Solution (Python):
N,A,B=map(int,input().split())
M=min(A,B)
m=max(A+B-N,0)
print(M,m)

Solution (Python):
N,A,B = list(map(int,input().split()))


print(
    min(A,B),
    max(0,A+B-N)
)

Solution (Python):
N,A,B = map(int,input().split())

print(min(A,B),max(A+B-N,0))

Solution (Python):
n, a, b = map(int, input().split())

print(min(a, b), max(a + b - n, 0))

Solution (Python):
n,a,b=map(int,input().split())
print(min(a,b),max(a+b-n,0))

Solution (Python):
N, A, B = list(map(int, input().split()))

print(min(A,B), max(0, A+B-N))

Solution (Python):
def ma():return map(int, input().split())
n,a,b= ma()
d = max(0,a+b-n)
e = min(a,b)
print(e,d)

Solution (Python):
def A():
    n, a, b = map(int, input().split())
    print(min(a, b), max(a + b - n, 0))
A()

Solution (Python):
def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]

N, a, b = map(int, input().split())
a1 = min(a, b)
a2 = max(0, a+b-N)
print(a1, a2)

Solution (Python):

N,A,B = map(int,input().split())

ans1 = min(A,B)
ans2 = max(0, -(N-A-B))
print(ans1,ans2)

Solution (Python):
N, A, B =map(int, input().split())

ans1 = min(A,B)
ans2 = max(0, A+B-N)
print(ans1, ans2)

Solution (Python):
n, a, b = map(int, input().split())
print(min(a, b), max(0, a+b-n))

Solution (Python):
n,a,b=map(int,input().split())
print(min(a,b),max(0,a+b-n))

Solution (Python):



 
import sys
import math



 

fileoperation=0
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile


mod=1000000007
 

def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 

t=1
for tt in range(t):
    
    n,k,s= map(int, sys.stdin.readline().split(' '))
    print(min(k,s),max(0,k+s-n))
    
    
    

if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

Solution (Python):
N, A, B = map( int, input().split())
print( min(A, B), max( A+B-N,0))

Solution (Python):

n, a, b = map(int, input().split())
print(min(a, b), max(0, a + b - n))

Solution (Python):
n, a, b = map(int, input().split())
c = min(a, b)
if a + b <= n:
	d = 0
else:
	d = a+b-n
print(c, d)

Solution (Python):

from collections import defaultdict
import math
def LI(): return list(map(int, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()
def IIR(n): return [II() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
mod = 1000000007


n,a,b = LI()
ans = [min(a,b),max(0,a+b-n)]
print(ans[0],ans[1])

Solution (Python):
n, a, b = map(int, input().split(' '))
minv = max(0, a + b - n)
maxv = min(a, b)
print(maxv, minv)

Solution (Python):
N, A, B = map(int, input().split())
print(min(A, B), max(A + B - N, 0))

Solution (Python):
n,a,b=map(int, input().split())
print(min(a,b),max(0,a+b-n))

Solution (Python):
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import defaultdict, Counter
from bisect import bisect

setrecursionlimit(10**7)

def read():
  return int(input())

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

N, A, B = reads()

M = min(A, B)
m = max(A + B - N, 0)
print(M, m)

Solution (Python):
def main():
    n, a, b = (int(z) for z in input().split())
    res_max = min(a, b)
    res_min = max(0, a + b - n)
    print(res_max, res_min)


if __name__ == "__main__":
    main()

Solution (Python):
N,A,B = map(int,input().split())

print(min([A,B]),max([0,A+B-N]))

Solution (Python):
def ii():
    return int(input())
def mi():
    return map(int, input().split())
def li():
    return list(mi())

n, a, b = mi()
print(min(a, b), max(0, a + b - n))

Solution (Python):

from sys import stdin


s_in = lambda: stdin.readline()[:-1]  
d_in = lambda: int(stdin.readline())  
ds_in = lambda: list(map(int, stdin.readline().split()))  


N, A, B = ds_in()

a = min(A, B)
b = max(0, A + B - N)

print(a, b)

Solution (Python):



import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

N, A, B = map(int, input().split())
mx = min(A, B)
mn = max(A + B - N, 0)
print(mx, mn)

Solution (Python):
n,a,b = map(int,input().split())

print(min(a,b),max(a+b-n,0))

Solution (Python):
N, A ,B = map(int, input().split())
print(min(A,B), max(0,A+B-N))

Solution (Python):
def inpl(): return [int(i) for i in input().split()]
N, A, B = inpl()
print(min(A,B), max(A+B-N, 0))

Solution (Python):
N, A, B = map(int, input().split())
print(min(A, B), max(0, A + B - N))

Solution (Python):
n,a,b = map(int,input().split())
print(min(a,b),max(0,a+b-n))

Solution (Python):
N, A, B = map(int, input().split())
print(min(A, B), max(0, A + B - N))

Solution (Python):
N,A,B = [int(i) for i in input().split()]

print(min(A,B),max(A+B-N,0))

Solution (Python):
n,a,b=map(int,input().split())
c=min(a,b)
d=max(0,a+b-n)

print(str(c)+" "+str(d))

Solution (Python):
def read():
    return int(input())


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


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


N, A, B = readmap()

print(min(A, B), max(0, A + B - N))

Solution (Python):
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n,a,b = li()
print(min(a,b), max(0, a+b-n))

Solution (Python):
N, A, B = map(int, input().split())
print(min(A, B), max(A+B-N, 0))