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):
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

N, A, B = list(map(int, sys.stdin.readline().split()))
print(min(A, B), max(0, A+B-N))

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

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

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

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

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

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

Solution (Python):


list = [int(i) for i in input().split()]
print(min(list),(list[1] + list[2]) - list[0] if (list[1] + list[2]) - list[0] > 0 else 0)

Solution (Python):

import sys
input = sys.stdin.readline
def mi(): return map(int, input().split())


N, A, B = mi()
ans = [0,0]
ans[0] = min(A,B)
ans[1] = max(A+B-N,0)

print(ans[0], ans[1])

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

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

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

print(min(a, b),0 if (a + b) <= n else abs(b - (n - a)))

Solution (Python):
N, A, B = map(int, input().split())
if N>=A+B:
	print(str(min(A, B)) + ' 0')
else:
	print(str(min(A, B)) + ' ' + str(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())
ans1 = min(a,b)
ans2 = max(a+b-n,0)
print(ans1,ans2)

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

max=min(a,b)

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

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

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

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

max_ = min(a, b)

if max(n, a+b) == a+b:
    min_ = a + b - n
else:
    min_ = 0

print(max_, min_)

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

Solution (Python):
if __name__=="__main__":
    n, A, B = input().split(' ')
    n = int(n)
    A = int(A)
    B = int(B)
    print(min(A, B),  max(B - (n - A), 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())
if a+b-n>=0:
  print(min(a,b),a+b-n)
else:
  print(min(a,b),0)

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

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

Solution (Python):


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

largest = min(A, B)
minimum = max(0, A + B - N)

print(largest, minimum)

Solution (Python):

import sys


def solve(N: int, A: int, B: int):
    print(min(A, B), max(0, A + B - N))
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    A = int(next(tokens))  
    B = int(next(tokens))  
    solve(N, A, B)

if __name__ == '__main__':
    main()

Solution (Python):
n,x,y=map(int,input().split())
if (x+y)>n:
  mn=(x+y)-n
else:
  mn=0
mx=min(x,y)
print('{} {}'.format(mx,mn))

Solution (Python):
A = list(map(int,input().split()))
if A[1] + A[2] < A[0]:
  b = 0
else:
  b = A[1] + A[2] - A[0]
x = [A[1], A[2]]
print(min(x) ,b)

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

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

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

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

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

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

Solution (Python):
n, a, b = map(int, input().split())
ans_min = 0 if a+b-n <0 else a+b-n
print(min(a, b), ans_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(0, A+B-N))

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

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(str(min(A,B))+' '+str(max(0,(A+B-N))))

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

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

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

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

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

print(ans[0], ans[1])

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

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

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

res1 = min(X, Y)

if X + Y <= N:
  res2 = 0
  
else:
  res2 =  X + Y - N
  
print(res1, res2)

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

Solution (Python):
"""
A - Subscribers
"""


def solve():
    N, A, B = map(int, input().split())
    max_both = B if A > B else A
    min_both = (A + B) - N if (A + B) > N else 0
    print(max_both, min_both)


if __name__ == '__main__':
    solve()

Solution (Python):
Moji=str(input())
ListNAB=Moji.split() 
N=int(ListNAB[0])
A=int(ListNAB[1])
B=int(ListNAB[2])
if A>=B:
  nmax=B

elif A<B:
  nmax=A

if N>A+B:
  nmin=0

if N<=(A+B):
    nmin=A+B-N

print(str(nmax)+" "+str(nmin))

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

ma = str(min(A,B))
if A+B-N > 0:
    mi = str(A + B - N)
else:
    mi = str(0)
print(ma+' '+mi)

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

Solution (Python):
i = [int(each) for each in input().split()]
print(min(i[1], i[2]), max(i[1] + i[2] - i[0], 0))

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

if(a+b <= n):
    print(str(min(a,b)) + " 0")
else:
    print(str(min(a,b)) + " " + str(abs(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())
li = [a,b]
maxi = min (li)
m = 0
if a + b <= n:
    m = 0
    
if a + b > n:
    m = a + b - n

print(maxi,m)

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b



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



def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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


if __name__ == '__main__':
    main()

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

Solution (Python):



N, A, B = list(map(int, input().split(" ")))
print("{} {}".format(min(A,B), max(A+B-N, 0)))

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

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

Solution (Python):


from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18

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

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

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

max = min([A, B])


num = A + B - N
if (num <= 0):
    minor = 0

else:
    minor = num

print(max, minor)

Solution (Python):
import numpy as np
x = np.array(input().split(' '), int)
print(x[1:].min(),' ', 0 if x[0] >= x[1:].sum() else x[1:].sum() - x[0])

Solution (Python):
N, A, B = map(int,input().split())
li = [A, B]
if sum(li)<=N:
  a = 0
else:
  a = sum(li)-N
print(min(li),a)

Solution (Python):
N, A, B = [int(x) for x in input().split()]
ma = min(A,B)
mi = max(0,(A+B)-N)
print("{} {}".format(ma,mi))

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

Solution (Python):
N,A,B = (int(x) for x in input().split())
if(A<B):
    max = A
else:
    max = B

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

print(max,min)

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

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

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

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

Solution (Python):


import sys, re
from collections import deque, defaultdict, Counter
from math import sqrt, hypot, factorial, pi, sin, cos, radians
if sys.version_info.minor >= 5: from math import gcd
else: from fractions import gcd 
from heapq import heappop, heappush, heapify, heappushpop
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from functools import reduce, partial
from fractions import Fraction
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def round(x): return int((x*2+1) // 2)
def fermat(x, y, MOD): return x * pow(y, MOD-2, MOD) % MOD
def lcm(x, y): return (x * y) // gcd(x, y)
def lcm_list(nums): return reduce(lcm, nums, 1)
def gcd_list(nums): return reduce(gcd, nums, nums[0])
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, A, B = MAP()

mx = min(A, B)
mn = max(A + B - N, 0)

print(mx, mn)

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

print("{0} {1}".format(Max,Min))

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

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

if a >= k:
	max = k
else:
	max = a

min = a + k - n

if min < 0:
	min = 0

print(max, min)

Solution (Python):
if __name__ == '__main__':
    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())
population_max = a
if b < a:
    population_max = b
population_min = 0
if a+b > n:
    population_min = (a+b)-n
print('{0} {1}'.format(population_max, population_min))

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

if N >= A + B:
  minN = 0
  maxN = min([A,B])
else:
  minN = A + B - N
  maxN = min([A,B])
  
print('{} {}'.format(maxN,minN))

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

Solution (Python):
import sys

n,a,b=map(int,sys.stdin.readline().split())

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

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

if a < b:
  max = a
else:
  max = b

min = (a + b) - n
if min < 0:
  min = 0
 
print(max, min)

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('{} {}'.format(max, min))

Solution (Python):

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


if (a > b ) :
	mx_x = b
else:
	mx_x = a

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

print(str(mx_x) + ' ' + str(mx_y))

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

Solution (Python):
N, A, B = [int(x) for x 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(0,a+b-n))

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

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

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

if(Y > X):
	b_max = X
	b_min = X + Y - N
else:
	b_max = Y
	b_min = X + Y - N
if(b_min < 0):
	b_min = 0

print(b_max, b_min)

Solution (Python):
n,x,y=list(map(int,input().split()))
if x+y<=n:
    Min=0
    if x<=y:
        Max=x
    else:
        Max=y
else:
    Min=(x+y)-n
    if x<=y:
        Max=x
    else:
        Max=y
print("{} {}".format(Max,Min))

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

Solution (Python):
import sys
n, a, b = map(int ,sys.stdin.readline().strip().split())
mi = max(0, a+b-n)
ma = min(n, min(a, b))
print("{} {}".format(ma, mi))

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

if a+b-n > 0:
  result = a +b-n
else:
  result = 0

print(min(a,b),result)

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

max_read=min(a,b)

if(a+b-n>0):
	min_read=a+b-n
else:
    min_read=0
    
print(str(max_read)+" "+str(min_read))

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



print( min(N, min(A,B))  , end = " ")

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

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

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

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

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




maxab = min([A , B])

minab = max([A + B - N , 0] )

print(str(maxab) + " " + str(minab))

Solution (Python):
n,x,y = map(int,input().split())
r = x+y-n
if r < 0:
  r = 0
print(min(x,y),r)

Solution (Python):
import numpy as np

N,A,B=[int(i) for i in input().split()]
x=min(A,B)
if((A+B)>N):
    z=N
    y=abs(A+B-z)
else:
    y=0
print("{} {}".format(x,y))

Solution (Python):


rec = input().split()
n, a, b = map(int, rec)
nin = [a, b]

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

Solution (Python):
n,a,b = [int(i) for i in input().split(' ')]
ab = a+b
c = n < ab
r = ab - n if c else 0
print(' '.join([str(i) for i in [min(a,b), r]]))

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

Solution (Python):
N,A,B = [int(i) for i in 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(0,a+b-n))

Solution (Python):
n1, n2, n3 = list(map(int, input().split()))
x = min(n2,n3)
if n2+n3<=10:
    y=0
else:
    y = max(n2+n3-n1,0)
print(x,y)

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


if __name__ == "__main__":
    main()

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

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

Solution (Python):
B,A,N=sorted(int(_) for _ in input().split())
print(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):
Sample, NumOfPaperA, NumOfPaperB = map(int, input().split())
MaximumNumberOfBothReader = min(NumOfPaperA, NumOfPaperB)
MinimumNumberOfBothReader = max(NumOfPaperA + NumOfPaperB - Sample, 0)
print(str(MaximumNumberOfBothReader) + ' ' + str(MinimumNumberOfBothReader))

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

min_num = min(a,b)
max_num = max(a+b-n,0)

print(min_num, max_num)

Solution (Python):
import sys


def main():
    raw = input().split(' ')
    n = int(raw[0])
    a = int(raw[1])
    b = int(raw[2])

    def get_max():
        return min(a, b)

    def get_min():
        return max(a + b - n, 0)

    print("{} {}".format(get_max(), get_min()))


if __name__ == "__main__":
    argv = sys.argv[1:]
    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())
ans1 = min([a, b])
ans2 = max([0, a+b-n])
print('{} {}'.format(ans1, ans2))

Solution (Python):


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

max_r = min([a,b])
min_r = max([0, (a+b)-n])

print("{} {}".format(max_r, min_r))

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

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

X = A if A < B else B
Y = 0 if N > A+B else A+B-N

print("{0} {1}".format(X, Y))

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):
n,a,b = map(int, input().split())
if a+b > n:
  q = a+b-n
else :
  q = 0
print( str(min(a,b)) +" "+ str(q))

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

for i in range(A):
    check[i] += 1

for i in range(B):
    check[-(i + 1)] += 1

cnt = 0
for c in check:
    if c == 2:
        cnt += 1

print(min(A, B), cnt)

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

MAX = min(A, B)

MIN = max(0,A+B-N)

print(MAX,MIN)

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

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

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

Solution (Python):
import sys

def r(n, a, b):
    both_max = min(a, b)
    if 0 < a + b - n:
        both_min = a + b - n
    else:
        both_min = 0

    print(both_max, both_min)


def main():
    input = sys.stdin.readline
    n, a, b = list(map(int, input().split()))
    r(n, a, b)


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

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())
ma=min(a,b)
mi=max(0,a+b-n)
print(ma,mi)

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

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

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

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

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

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

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

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


if __name__ == '__main__':
    main()

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

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=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=map(int,input().split());print(min(a,b,n),max(0,a+b-n))

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

print(min(A, B), (A + B - N if A + B > N else 0))

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

print(mx, mn)

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("{} {}".format((min(a,b)),(max(0,(a+b)-n))))

Solution (Python):
n,a,b = map(int, input().split())
maxint = 0
minInt = 0
if a <= b:
  maxInt = a
  minInt = a - (n-b)
else:
  maxInt = b
  minInt = b - (n-a)

if a +b < n :
    minInt = 0
print(maxInt, minInt)

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,-(n-a-b)))

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

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

Solution (Python):
if __name__ == '__main__':
    n, a, b = input().split()
    N, A, B = int(n), int(a), int(b)

    ans_max = min(A, B)

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

    print('{0} {1}'.format(ans_max, ans_min))

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

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())
min_num = 0
max_num = 0

if a == n or b == n:
    min_num = min(a,b)
    max_num = min(a,b)
elif a == b and a == n:
    min_num = n
    max_num = n
elif a == 0 or b == 0:
    pass
elif n >= a + b:
    max_num = min(a,b)
elif n < a + b:
    min_num = abs(n-a-b)
    max_num = min(a,b)

print(max_num, min_num)

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

n = data_list[0]
x = data_list[1]
y = data_list[2]

if n == x == y:
    print(n, n)
    exit(0)

if n - (x + y) >= 0:
    print(min(x, y), 0)
else:
    print(min(x, y), x + y - n)

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 = input().split()
N = int(n[0])
A = int(n[1])
B = int(n[2])

if A > B:
    a = A
    b = B
elif A < B:
    a = B
    b = A
elif A == B:
    a = A
    b = B

if a != b:
    if a+b <= N:
        print(str(b) + ' ' + str(0))
    elif a+b > N:
        print(str(b) + ' ' + str(a - (N-b)))
elif a+b <= N:
    print(str(a) + ' ' + str(0))
elif a+b > N:
    print(str(a) + ' ' + str(a-(N-b)))

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

N = int(N)
A = int(A)
B = int(B)

max_num = min(A,B)
min_num = 0

if A+B > N:
    min_num = A+B - N

print(max_num,min_num)

Solution (Python):
inputstr = input().strip()
inputarray= inputstr.split(" ")
n = int(inputarray[0])
a = int(inputarray[1])
b = int(inputarray[2])
d1 = min(a,b)
if a+b > n:
  d2 = abs(a+b-n)
else:
  d2 = 0
print (str(max(d1,d2)) + " " + str(min(d1,d2)))

Solution (Python):
if __name__ == '__main__':
    data = input().split()
    data = [int(s) for s in data]
    outputmax = min(data)
    if data[0] == data[1] == data[2]:
        outputmin = data[1]
    else:
        outputmin = data[1] + data[2] - data[0]
        if (outputmin < 0):
            outputmin = 0
    print(str(outputmax) + " " + str(outputmin))

Solution (Python):
i = input().split()
all = int(i[0])
x = int(i[1])
y = int(i[2])
t = 0
max = 0
if x > y:
    max = x - abs(x - y)
    t = x
elif y > x:
    max = y - abs(x - y)
    t = y 
else:
    t = x
    max = x

min = 0
nx = all - x
ny = all - y

if nx > ny:
    nt = nx
elif ny > nx:
    nt = ny
else:
    nt = nx
if t >= nt: 
    min = t - nt
else:
    min = 0
print("{0} {1}".format(max,min))

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

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

bigger = a
smaller = b
if a < b:
    bigger = b
    smaller = a

max = smaller
min = 0
if (n - bigger) < smaller:
    min = smaller - (n - bigger)

print(str(max)+' '+str(min))

Solution (Python):


import sys
import math

args = input().split()

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

reta = a
retb = (n - a) - b

if retb > 0:
  retb = 0
else:
  retb = abs(retb)

print('{reta} {retb}'.format(reta=min(a,b),retb=retb))

sys.exit(0)

Solution (Python):




def solveProblem(allPerson,subNewsA,subNewsB):
	subNewsA+subNewsB-allPerson

	answer = min(subNewsA,subNewsB),max(0,subNewsA+subNewsB-allPerson)
	return answer


if __name__ == '__main__':
	N,A,B = map(int,input().strip().split(' '))
	solMax,solMin = solveProblem(N,A,B)
	print("{} {}".format(solMax,solMin))

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

n = int(n)
a = int(a)
b = int(b)

ans_max = min(a,b)

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


print(ans_max, end=" ")
print(ans_min)

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

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

Solution (Python):

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

if n <= a + b:
    print('{0} {1}'.format(min(a, b), (a + b) - n))
else:
    print('{0} 0'.format(min(a, b)))

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

if(a[1]  >= a[2]):
  b = a[2]
else:
  b = a[1]

if(int(a[0]) >= int(a[1]) + int(a[2])):
  c=0
else:
  c = int(a[1]) + int(a[2]) - int(a[0])
print(b," ",c)

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):
    '''
    >>> main(10, 7, 5)
    5 2

    >>> main(10, 3, 5)
    3 0

    >>> main(100, 100, 100)
    100 100
    '''
    print(min(A, B), max(A+B-N, 0))

if __name__ == "__main__":
    N, A, B = (int(i) for i in input().split())
    main(N, A, B)

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

Max = A if A < B else B
Min = (A + B) - N 
Min = max(Min, 0)

print(Max, Min)

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

M = min(X, Y)

if N >= X + Y :
    m = 0
else :
    m = X + Y - N

print(M, ' ', m)

Solution (Python):
i = input().split()
all = int(i[0])
x = int(i[1])
y = int(i[2])
t = 0
max = 0
if x > y:
    max = x - abs(x - y)
    t = x
elif y > x:
    max = y - abs(x - y)
    t = y 
else:
    t = x
    max = x

min = 0
nx = all - x
ny = all - y

if nx > ny:
    nt = nx
elif ny > nx:
    nt = ny
else:
    nt = nx
if t >= nt: 
    min = t - nt
else:
    min = 0
print("{0} {1}".format(max,min))

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

Solution (Python):
def upto0(i):
    return 0 if(i < 0) else i
input = list(map(int, input().split()))
print(min(input[1], input[2]))
print(upto0(input[1] + input[2] - input[0]))

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

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

print(min(A,B), minimum)

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

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

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

print(max,min)

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