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 = map(int, input().split())
if a + b <= n:
    if a <= b:
        print(a, 0)
    else:
        print(b, 0)
elif a + b > n:
    if a <= b:
        print(str(a) + " " + str(a + b - n))
    else:
        print(str(b) + " " + str(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):
s = list(map(int,input().split()))
a=min(s[1],s[2])
b=max(s[1]+s[2]-s[0],0)
print(a,b)

Solution (Python):
from sys import stdin


def x_plus_y(x, y):
    return x+y


def max_x_y(x, y):
    return x if(x < y) else y


N, A, B = [int(x) for x in stdin.readline().rstrip().split()]
sumAB = x_plus_y(A, B)
res = N - sumAB
Max = max_x_y(A, B)
Min = 0

resMin = None
resMax = None

for i in range(Min, Max+1):
    bar = res + i
    if(bar >= 0 and resMin is None):
        resMin = i
    if (bar >= 0):
        resMax = i

print(resMax, resMin)

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

Solution (Python):
N, X, Y = map(int, input().split())
Prov = []
Prov.append(N)
Prov.append(X)
Prov.append(Y)
if X + Y > N:
    C = (X + Y) - N

else:
    C = 0

if 1 <= X and 1 <= Y:
    print(min(Prov), C)

else:
    print(0, 0)

Solution (Python):
inp = input().split()

N = int(inp[0])
x = int(inp[1])
y = int(inp[2])

ans = []
ans.append(min(x,y))

if x+y > N:
  ans.append(x+y-N)
else:
  ans.append(0)

print("{} {}".format(ans[0], ans[1]))

Solution (Python):

N,A,B=[int(_) for _ in input().split() ]
if A>=B:
    BIG=A
    SMALL=B
if B>A:
    BIG=B
    SMALL=A

MAX=SMALL

if BIG+SMALL<=N:
    MIN=SMALL
    print(str(MAX)+' 0')
    exit(0)


MIN=BIG+SMALL-N
print(str(MAX)+' '+str(MIN))

Solution (Python):
a, b, c = map(int,input().split())
if a > b + c:
    if b >= c:
        print(str(c) +" "+ str(0))
    else:
        print(str(b) +" "+ str(0))
elif a == b and a == c:
    print(str(a)+" "+str(a))
elif a< b+c:
    if b >= c:
        print(str(c) +" "+ str(-a + (b+c)))
    else:
        print(str(b) +" "+ str(-a+(c+b)))
elif a == b+c:
    if b >= c:
        print(str(c) +" "+ str(-a + (b+c)))
    else:
        print(str(b) +" "+ str(-a+(c+b)))
elif a == b or a==c:
    if b >= c:
        print(str(c) +" "+ str(0))
    else:
        print(str(b) +" "+ str(0))
elif a ==b ==c:
    print(str(b)+" "+str(0))

Solution (Python):
input_list = raw_input().split(" ")
N = int(input_list[0])
A = int(input_list[1])
B = int(input_list[2])
MAX=0
MIN=0
if A == 0 or B == 0:
	MAX = 0	
else:
	_max = max(A, B)
	_min = min(A, B)
	MAX = _min
	if A+B < N:
		MIN = 0
	else:
		buf = N - _max
		MIN = _min - buf
		
print("{0} {1}".format(MAX, MIN))

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):
n, a, b = map(int, input().split())

m = 0
x = 0

if n >= a+b:
    x = min(a,b)
    m = 0
elif n < a+b:
    x = min(a,b)
    m = (a+b)-n

print(x,m)

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

if A+B-N<=0:
	print(str(min([A,B]))+' '+str(0))
else:
	print(str(min([A,B]))+' '+str(A+B-N))
exit()

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

def q1(N,A,B):
    maximum = min(A,B)
    if A + B <= N:
        minimum = 0
    else:
        minimum = A+B-N
    L = [maximum, minimum]
    return ' '.join(map(str, L))
    

print(q1(N,A,B))

Solution (Python):
n , x , y = map(int , input().split())

min = x + y - n
if min < 0 : min = 0

if x < y : print (str(x) + " " + str(min))
else : print(str(y) + " " + str(min))

Solution (Python):


def solve():
    N, A,B = map(int,input().split())
    res = ' '.join(map(str,[min(A,B), max(A+B-N,0)]))
    return str(res)
if __name__ == '__main__':
    print(solve())

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

Solution (Python):

import sys

def io_generator():
	while True:
		yield raw_input()



def main(io):
	n,a,b= map(int, io.next().split())
	max_num= min(a,b)
	min_num= max(a+b-n, 0)
	ret= str(max_num)+' '+str(min_num)
	return ret




if __name__ == "__main__":
	io=io_generator()
	print main(io)

Solution (Python):

line = input().split()

N = int(line[0])
A = int(line[1])
B = int(line[2])

total = A + B

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

Solution (Python):
import numpy as np
import sys
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N,A,B = IL()

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

Solution (Python):
from sys import stdin
N,A,B=[int(x) for x in stdin.readline().rstrip().split()]
if N==A and A==B and B==N:
    print(N,N)
else:
    if A > B:
        if (A+B) > N:
            print(B,(A+B)-N)
        else:
            print(B,0)
    else:
        if (A+B) > N:
            print(A,(A+B)-N)
        else:
            print(A,0)

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

ma = max([A, B])
mi = min([A, B])

total_ma = mi
total_mi = ma + mi - ALL if (ma + mi - ALL) > 0 else 0

print(str(total_ma) + " " + str(total_mi))

Solution (Python):











inputstr = input()
inputary = inputstr.split(" ")

N = int(inputary[0])
A = int(inputary[1])
B = int(inputary[2])

suball = N - A - B
if suball > 0:
    suball = 0
else:
    suball = abs(suball)

if A >= B:
    print(str(B) + " " + str(suball))
elif A < B:
    print(str(A) + " " + str(suball))

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

Solution (Python):
n,a,b = (int(i) for i in input().split())
x=min(a,b)
y=a+b-n
if y < 0:
    y=0
print(x,y)

Solution (Python):
N,A,B = map(int,input().split())
if A == 0 or B == 0:
    print("0 0")
elif N >= A + B:
    a = min(A,B)
    print("{} {}".format(a,0))
else:
    a = min(A,B)
    b = A + B - N
    print("{} {}".format(a,b))

Solution (Python):



from collections import deque
import heapq
import math
import bisect


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

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


if __name__ == '__main__':
    main()

Solution (Python):

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

if A == B and A == N:
	print(A, A)
else:
	n = 0
	if A + B > N:
		n = A+B-N
	else:
		n = 0


	print(min(A, B), n)

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

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

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

Solution (Python):
l = list(map(int, input().split()))

N = l[0]
x = l[1]
y = l[2]

if N > x + y:
    b_min = 0
else:
    b_min = (x + y) - N

if x > y:
    b_max = y
else:
    b_max = x

if N == x and N == y:
    b_min = N
    b_max = N

print(b_max, b_min)

Solution (Python):
N, A, B = (int(x) for x in input().split())
c=0
if(A <= B):
    c = A
else:
    c = B
if(A+B > N):
    print("{} {}".format(c, A+B-N))
else:
    print("{} {}".format(c, 0))

Solution (Python):
n, a, b = map(int, input().split())
mi = 1000000
ma = -5
for x in range(0, n + 1):
    if not 0 <= x <= a:continue
    if not 0 <= x <= b:continue
    if not 0 <= n - a - b + x <= n - a: continue
    if not 0 <= n - a - b + x <= n - b: continue
    mi = min(mi, x)
    ma = max(ma, x)
print(ma, mi)

Solution (Python):
a = list(map(int,input().split()))
print('{} {}'.format(min(a[1],a[2]), max(a[1]+a[2]-a[0],0)))

Solution (Python):
moto=input()
henkan=moto.split()
if int(henkan[1]) <= int(henkan[2]):
    ooi=int(henkan[2])
    sukunai=int(henkan[1])
else:
    ooi=int(henkan[1])
    sukunai=int(henkan[2])
if ooi+sukunai-int(henkan[0])>0:
    sai=ooi+sukunai-int(henkan[0])
else:
    sai=0
print(str(sukunai)+" "+str(sai))

Solution (Python):
tmp = input().split(' ')

N = int(tmp[0])
A = int(tmp[1])
B = int(tmp[2])

maxReaders = 0
minReaders = 0


if A > B :
  maxReaders = B
else :
  maxReaders = A


if A + B > N :
  minReaders = (A + B) - N
else :
  minReaders = 0

print(str(maxReaders) + ' ' + str(minReaders))

Solution (Python):
data = input().split()

n = int(data[0])
a = int(data[1])
b = int(data[2])

ab=n
total=n


if(n > (a+b)):
    if(a > b):
        ab = b
        total = 0
    else:
        ab = a
        total = 0
else:
    if(a > b):
        ab = b
        total = a+b-n
    else:
        ab = a
        total = a+b-n

print(ab, " ", total)

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

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

def max(a,b):
    if a >= b:
        return b
    else:
        return a
def min(n,a,b):
    if n-a-b > 0:
        return 0
    else:
        return abs(n-a-b)
print(max(a,b),min(n,a,b))

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

Solution (Python):
a = input().split()
b,c,d = int(a[0]),int(a[1]),int(a[2])
if c >= d :
    aa = d
else :
    aa = c
if b >= c + d :
    ab = 0
else :
    ab = abs(b - (c + d))
print(aa, ab)

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

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

n = int(n)
x = int(a)
y = int(b)

maxim = 0
mini = 0

if x > y:
    maxim = y
else:
    maxim = x

if x + y > n:
    mini = x + y - n

print(str(maxim) + ' ' + str(mini))

Solution (Python):
from sys import stdin

A, B, C = [int(x) for x in stdin.readline().rstrip().split()]




if B+C <= A:
    print(str(min(B,C)) + ' ' + str(0))
else:
    print(str(min(B,C)) + ' ' +str(B+C-A))

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())
maximam=0
minimam=0
if a+b-n>=0:
    minimam=a+b-n
else:
    minimam=0
s=[a,b]
maximam=min(s)
print(maximam,minimam)

Solution (Python):
line = input()
N = line.split()[0]
A = line.split()[1]
B = line.split()[2]

max = min(int(A),int(B))
min = int(A)+int(B)-int(N)
if min < 0:
    min =0
  
print ("{0} {1}".format(max,min))

Solution (Python):
N, A, B = (int(x) for x in input().split())
c=0
if(A <= B):
    c = A
else:
    c = B
if(A+B > N):
    print("{} {}".format(c, A+B-N))
else:
    print("{} {}".format(c, 0))

Solution (Python):
n,a,b = map(int, input().split())
max_ans = 0
min_ans = 0
bigger_num = max([a, b])
smaller_num = min([a, b])

if n - bigger_num >= smaller_num:
    min_ans  = 0
else:
    min_ans = abs(smaller_num - (n - bigger_num))

max_ans = smaller_num

print(max_ans, min_ans)

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

Solution (Python):
n, a, b = [int(_) for _ in input().split()]
m = a + b - n
if m < 0:
    m = 0
print(min(a, b), m)

Solution (Python):
N,X,Y = map(int,input().split())

print(min(X,Y),' ',max(X+Y-N,0))

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

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

max_num = min(A, B)
min_num = max(A + B - N, 0)

print(str(max_num) + " " + str(min_num))

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

Solution (Python):
s=input()
n,a,b=int(s.split()[0]),int(s.split()[1]),int(s.split()[2])
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):
input = list(map(int,input().split()))

result_max = min(input[1], input[2])
result_min = input[0] - (input[0] - input[1]) - (input[0] - input[2]) 

if result_min < 0:
  result_min = 0

print(result_max, result_min)

Solution (Python):
N,X,Y = map(int,input().split())
tmp_X = X
if X>Y:
    tmp_X = Y
tmp_Y = N-X

if tmp_Y > Y:
    min_Y = 0
else:
    min_Y = Y - tmp_Y
print(tmp_X,' ',min_Y)

Solution (Python):
L = list(map(int, input().split()))
N = L[0]
A = L[1]
B = L[2]

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())
max = min(a,b)
min = a + b - n
if min<0: min = 0

print(max,min)

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

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

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

Solution (Python):
input_line=[int(x) for x in input().split()]
[i_N,i_A,i_B]=input_line
if i_A>=i_B:
  o_max=i_B
  o_min=i_B-(i_N-i_A)
else:
  o_max=i_A
  o_min=i_A-(i_N-i_B)
if o_min<0:
  o_min=0
if o_max>i_N:
  o_max=i_N
print("{} {}".format(o_max,o_min))

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

if n > 100 or a > n or b > n:
    raise ValueError

ret_max = min(a, b)

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

print(ret_max, ret_min)

Solution (Python):
def main():
    N, A, B = map(int, input().split())
    if N == A and N == B:
        
        print(N, N)
        return

    max_result = max([A, B])
    min_result = min([A, B])
    if A + B > N:
        
        print(min_result, min_result - (N - max_result))
    elif A + B <= N:
        
        print(min_result, 0)



main()

Solution (Python):
r = input().split()
n = int(r[0])
nin = []
nin.append(int(r[1]))
nin.append(int(r[2]))

nmax = min(nin)
nmin = n - min(n, (n - nin[0]) + (n - nin[1]))
print(str(nmax) + " " + str(nmin))

Solution (Python):
N, A, B = map(int, raw_input().split())
min_res = min(A, B)
max_res = 0 if A + B < N else B - N + A
print min_res, max_res

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



if A >B :
	print B,
else :
	print A,



if N-A-B < 0:
	print abs(N-A-B),
else :
	print 0,

Solution (Python):


import bisect


def IT():  
    return int(input())

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

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

def ILS(n):  
    return [int(input()) for _ in range(n)]

def SLS(n):  
    return [input() for _ in range(n)]

def ILSS(n):  
    return [[int(_) for _ in input().split()] for j in range(n)]


def bit_full_search(ss):
    n = len(ss)
    for i in range(1 << n):
        s = ""
        for j in range(n + 1):
            if ((1 & i >> j) == 1):
                s += ss[j]
        print(s)

def bit_full_search2(A):
    
    value = []
    for i in range(1 << len(A)):
        output = []

        for j in range(len(A)):
            if ((i >> j) & 1) == 1:
                
                output.append(A[j])
        value.append([format(i, 'b').zfill(16), sum(output)])

    value.sort(key=lambda x: x[1])
    bin = [value[k][0] for k in range(len(value))]
    val = [value[k][1] for k in range(len(value))]
    return bin, val

def matching_bisect(list1_val, list2_val, n):
    
    j = 0
    for i in range(len(list1_val)):
        j = bisect.bisect_left(list2_val, n - list1_val[i])
        if j < len(list2_val):
            if list1_val[i] + list2_val[j] == n:
                
                break
    return j

"""ここからメインコード"""

def main():
    n, a, b = IL()
    aa  =min(a, b)
    bb = max(0, a+b-n)
    print(aa, bb)
main()

Solution (Python):

"""
Created on Sun Jan 27 20:42:18 2019

@author: Owner
"""


import collections
import scipy.misc
import sys
import numpy as np
import math
from operator import itemgetter
import itertools
import copy


def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   

def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())

P = [0]*M
Y = [0]*M
for m in range(M):
    P[m], Y[m] = map(int, input().split())
    
all(nstr.count(c) for c in '753')
"""

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

result = []

result.append(min(A, B))
if (A+B) < N:
    result.append(0)
else:
    result.append(A+B - N)
print(result[0],result[1])

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

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

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

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

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

print(commonMax, commonMin)

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

saidai = min(a,b)

if a+b <= n:
    saisyo = 0
else:
    saisyo = (a+b) - n

print(saidai," ",saisyo)

Solution (Python):
n_k = list(map(int, input().split()))
n,a,b = n_k[0],n_k[1],n_k[2]
max,min = 0,0
if n > a+b:
    min=0
    if a<b:
        max=a
    else:
        max=b
else:
    min=a+b-n
    if a<b:
        max=a
    else:
        max=b
print(str(max)+' '+str(min))

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

minN = 0
maxN = 0

if (a + b < n):
    minN = 0
else:
    minN = (a + b) - n
maxN = min(a, b)
    
print(str(maxN) + " " + str(minN))

Solution (Python):
line = input().split()
N = int(line[0])
A = int(line[1])
B = int(line[2])
print(min(A, B), max(A + B - N, 0))

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

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

if A > B:
  A, B = B, A

upper = A
lower = max(A - (N - B), 0)

print(upper, lower)

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

print(min(a, b), '', end='')

if n < a + b:
    print((a+b)-n)
else:
    print(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 = map(int, input().split())
ans_max = min([a, b])
if a+b <= n:
    ans_min = 0
else:
    ans_min = a+b-n
print(ans_max, ans_min)

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

Solution (Python):
def read():
    N, A, B = map(int, input().strip().split())
    return N, A, B


def solve(N, A, B):
    intersect_max = min(A, B)
    intersect_min = max(0, A + B - N)
    return intersect_max, intersect_min


if __name__ == '__main__':
    inputs = read()
    print("%d %d" % solve(*inputs))

Solution (Python):


N, X, Y = map(int, input().split())
max = Y
min = X
if X < Y:
    max = X
    min = Y

minn = min - (N - max)
if minn < 0:
    minn = 0

print("{} {}".format(max, minn))

Solution (Python):
inputDataStr = input()
splitData = list(map(int, inputDataStr.split()))
maxData = 0
minData = 0
allNinzuu = splitData[0]

if(splitData[1] > splitData[2]):
	maxData = splitData[1]
	minData = splitData[2]
else:
	maxData = splitData[2]
	minData = splitData[1]

if(allNinzuu > (splitData[1] + splitData[2])):
	minRyouhou = 0
else:
	minRyouhou =(splitData[1] + splitData[2]) - allNinzuu

print(minData, end=" ")
print(minRyouhou)

Solution (Python):
def data_input():
    a,b,c = input().split(' ')
    return (int(a),int(b),int(c))
def answer():
    """
    >>> output('5','-->--')
    3.83333333333333
    """
    s,a,b = data_input()
    _max = min(a,b)
    _min = 0
    if a+b > s:
        _min = (a+b) - s
    return (_max,_min)

def output():
    res = answer()
    print('{0} {1}'.format(res[0],res[1]))
output()

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

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


if A >= B:
    max=B
else:
    max = A

print(max,min)

Solution (Python):
def run(N, A, B):
    min_ = A + B - N
    if min_ < 0:
        min_ = 0
    return '{} {}'.format(min(A, B), min_)


def main():
    N, A, B = list(map(int, input().split()))
    print(run(N, A, B))


if __name__ == '__main__':
    main()

Solution (Python):
N, A, B = map(int, input().split())
max = min([A, B])
if (A + B) - N > 0:
    min = (A + B) - N
else:
    min = 0
print("{} {}".format(max, min))

Solution (Python):
a = list(map(int, input().split()))
if a[1] >= a[2]:
  b = a[2]
if a[2] >= a[1]:
  b = a[1]

c = (a[1] + a[2]) - a[0] 
if c <= 0:
  c = 0
d = str(b) + " " + str(c)
print(d)

Solution (Python):

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

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

largest = min(A,B)

for i in range(0,largest + 1):
	if N - A - B + i >= 0:
		smallest = i
		break
		
print(largest,smallest)

Solution (Python):
import sys

def main(inp):
    N,A,B=map(int,next(inp).split())
    mini=0
    maxi=0
    
    mini=min([A,B])
    if(N>A+B):
        maxi=0
    else:
        maxi=A+B-N
    
    ans=str(mini)+" "+str(maxi)
    
    return ans
  
print(main(sys.stdin))

Solution (Python):
n, x, y = map(int, input().split())
max_ = min(x, y)
if n - x - y >= 0:
  min_ = 0
else:
  min_ = max(0, abs(n - x - y))
print(max_, min_)

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

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

if a + b <= n:
    if a >= b:
        max = b
        min = 0
    else:
        max = a
        min = 0

else:
    if a >= b:
        max = b
        min = a + b - n
    else:
        max = a
        min = a + b - n

print(max, "", min)

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


Max = min(A,B)

x = A+B-N
Min = max(x,0)

print(Max, Min)

Solution (Python):
num1 = input()
num1 = num1.split()
if(num1[1] <= num1[2]):
    print(num1[1]+" ", end="")
else:
    print(num1[2]+" ", end="")
if(int(num1[1])+int(num1[2])-int(num1[0]) <= 0):
    print("0")
else:
    print(int(num1[1])+int(num1[2])-int(num1[0]))

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

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

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

ans1=min(a,b)
tmp=a+b-n
if tmp<=0:
  ans2=0
else:
  ans2=tmp
print(ans1,ans2)

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

l = min(a,b)
u = max(a, b)
print(l, " ", max(0, l - n + u))

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

max_ = min(A,B)
min_ = max(0,A+B-N)

print(max_, min_)

Solution (Python):
n,n1,n2=list(map(int,input().split(" ")))
a1,a2=0,0
if n1+n2>n:
  a2=n1+n2-n
a1=min([n1,n2])
print(str(a1)+" "+str(a2))

Solution (Python):


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

A_B = A + B

def small(a, b):
    if a > b:
        return b
    else:
        return a

if A_B > N:
    print(small(A, B), A_B-N)
else:
    print(small(A, B), 0)

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

Solution (Python):
N, A, B = 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())

bigger = max(A, B)
neither = N - bigger
max_ = A+B+neither-N
if A+B > N:
    min_ = A+B - N
else:
    min_ = 0
print("{} {}".format(max_, min_))

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

if A <= B:
  max = A
elif A > B:
  max = B

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

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

x_max = min(A, B)

if A + B - N <= 0:
    x_min = 0
else:
    x_min = A + B - N

print(x_max, x_min)

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

maxi = min(a,b)
mini = max(0, a+b-n)

print(maxi, mini)

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

c = 0
d = a + b -n
if (a > b):
    c = b
else:
    c = a

if (d < 0):
    d = 0
    
print(str(c) + " " + str(d))

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

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())
l = [A,B]
if N > A + B:
    print(min(l), 0)
else:
    print(min(l), (A+B) - N)

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= map(int,input().split())
max_n = min(A,B)
min_n = max(0,A+B-N)
print(max_n,min_n)

Solution (Python):


n, a, b = map(int, input().split())
ab = n / 2
ansa = min(a, b)
ansb = max((a+b)-n, 0)
print(ansa,ansb)

Solution (Python):
n, a, b = map(int, input().split())
ma = min(a,b)
mi = max(0,a+b-n)
print(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 = map(int, input().split())
ans = min(a, b)
x = n - a - b
if x >= 0:
    ans2 = 0
else:
    ans2 = a+b-n
print(ans, ans2)

Solution (Python):
a=input()
b=a.split()
N=int(b[0])
A=int(b[1])
B=int(b[2])
if A<B:
    if A+B<N:
        print(A,0)
    else:
        print(A,B-(N-A))
elif A>=B:
    if A+B<N:
        print(B,0)
    else:
        print(B,A-(N-B))

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

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

Solution (Python):
from sys import stdin
N,A,B = map(int, stdin.readline().rstrip().split())
if A > B:
  ans=str(B)
else:
  ans=str(A)

X=A+B -N
if X <0:
  X=0

ans = ans + ' ' + str(X)

print (ans)

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

Solution (Python):
s=input().split()
N=int(s[0])
A=int(s[1])
B=int(s[2])
X=min([A,B])
Y=N-max([A,B])
if X-Y>0:
    print(X,X-Y)
else:
    print(X,0)

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

Solution (Python):
n, a, b = map(int, raw_input().split())
if(n<(a+b)):
	minimum = (a+b)-n
else:
	minimum = 0
maximum = min(a, b)	
print (str(maximum)+" "+str(minimum))

Solution (Python):


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

print(format(min(A, B))+" "+format(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()))


if a+b < n:
    mini = 0
    maxi = min(a, b)
else:
    mini =  abs((a + b)) - n
    maxi = min(a, b)

print(maxi, mini)

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

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

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

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()))
if n > a+b:
    ans = 0
else:
    ans = a+b-n
print(min(a,b), ans)

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

if A > B:
    max = B
else:
    max = A

if A+B > N:
    min = A+B-N
else:
    min = 0

print(max, min)

Solution (Python):
l_ = input().split()
l = [int(s) for s in l_]

if l[1] <= l[2]:
    max_ = l[1]
else:
    max_ = l[2]

if l[1] + l[2] >= l[0]:
    min_ = l[1] + l[2] - l[0]
else:
    min_ = 0

print("{} {}".format(max_, min_))

Solution (Python):
N,A,B = map(int, input().split())
MAX_num=min(A,B)
MIN_num=N-A-B
if MIN_num>=0:
    MIN_num=0
else:
    MIN_num=-1*MIN_num

print("{} {}".format(MAX_num,MIN_num))

Solution (Python):


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

maximum = min(a,b)
minimum = 0

if n <= (a+b):
  minimum = (a+b)-n

print("{} {}".format(maximum, minimum))

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

'''
n = int(input())

a = int(input())
b = int(input())
'''


print ("{0:d} {1:d}".format(min(a,b), max(a+b-n, 0)) )

Solution (Python):
a, b, c = map(int, input().split())
_max = min(b,c)
_min = max(0, ((b+c)-a))
print('{0} {1}'.format(_max, _min))

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(i)for i in input().split()]
if A+B > N:
    mi = A+B -N
else:
    mi = 0
ma =min([A,B])
print(ma,mi)

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

print('{} {}'.format(max_v, min_v))

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

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

min_num = min(A,B)

if A+B <= N:
  max_num = 0
else:
  max_num = abs(N-(A+B))
  
print(min_num,max_num)

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

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

Solution (Python):
N, A, B = map(int, input().split())
print(min(A, B), end='')
print(" " + str(A + B - N if 0 < A + B - N else 0))

Solution (Python):
n = list(map(int, input().split()))
ab = n[1], n[2]
in_min = n[1] + n[2] - n[0]
if in_min < 0:
    in_min = 0
print(min(ab), in_min)