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

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

Solution (Python):
a,b,c = map(int,input().split())
ans_max = min(b,c)
ans_min = min(b,c)-(a-max(b,c))
if ans_min < 0:
  ans_min = 0
print(ans_max,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())
max_ans = min(a,b)
min_ans = max(0, (a + b) - n)
print(max_ans, min_ans)

Solution (Python):

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

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

Solution (Python):
from sys import stdin
N, A, B = [int(_) for _ in stdin.readline().rstrip().split()]
print(min(A, B), max(0, A+B-N))

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

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 re
import math
import itertools
from copy import deepcopy
import fractions
import random
from heapq import heappop,heappush
import time
import os
import sys
import datetime
from functools import lru_cache
readline=sys.stdin.readline
sys.setrecursionlimit(2000)

alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def fac_list(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s

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

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

Solution (Python):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

if __name__ == '__main__':
    a = [int(i) for i in input().split()]
    a1 =0
    a2=0
    if a[0] > a[1]+ a[2]:
        a1 = min(a[1],a[2])
        a2 = 0
    else:
        a1 = min(a[1],a[2])
        a2= a[1]+a[2] -a[0]
    
    print(str(a1)+" "+str(a2)  )

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))

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

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

t = min(b, c)

if b+c < a:
    s = 0
else:
    s = b + c - a
print(t, s)

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

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

print(str(min(A, B)) + " " + str(mini))

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

M = None
m = None
if A + B <= N:
    M = min(A, B)
    m = 0
else:
    M = min(A, B)
    m = A + B - N

print(M, m)

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

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

ans1 = B if A>B else A
ans2 = A+B-N if A+B-N >= 0 else 0

print("{} {}".format(ans1, ans2))

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,x,y = map(int,input().split())
max = min(x,y)
if n-(x+y) < 0:
    min = abs(n-x-y)
else:
    min = 0
print(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 = [int(i) for i in input().split()]
M = min(A,B)
m = max(0,A+B-N)
print(M,m)

Solution (Python):
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


N, A, B = MI()
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(a + b - n, 0))

Solution (Python):
n, a, b = 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(0,a+b-n))

Solution (Python):
def main():
    population, a_reader, b_reader = map(int, input().split())
    print(min(a_reader, b_reader), max(a_reader + b_reader - population, 0))


if __name__ == '__main__':
    main()

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

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

Solution (Python):



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


min_ans = 0
max_ans = 0


if A<=B:
    min_ans = A
else:
    min_ans = B

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

print("%d %d"%(min_ans, max_ans))

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

Solution (Python):
n,a,b = map(int, input().split())
print('{0} {1}'.format(min(a,b), 0 if a+b<=n else 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 = min(A, B)
if A + B <= N:
  m = 0
else:
  m = A + B - N
print(M, m)

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

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

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

Solution (Python):

import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

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

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

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

Solution (Python):
N, A, B = map(int,input().split())
if A + B <= N :
    print(str(min(A, B)) + " 0")
else :
    print(str(min(A, B)) + " " + str(abs(N - (2 * N - A - 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())
A_N = N - A
B_N = N - B
print(min(A,B) , max(0,A + B - N))

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

m=0
s=0
if a<b:
  m=a
else:
  m=b

if a+b>n:
  s=a+b-n
  
  
print(m,s)

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

Solution (Python):

 
import math
import itertools
import sys
import copy
 






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

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

print (str(maxN) + " " + str(minN))

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

Solution (Python):
def main():
    N,A,B = map(int,input().split())
    print(min(A,B),end=" ")
    print(max(0,(A+B)-N))
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),0 if min(A,B)-N+max(A,B) < 0 else min(A,B)-N+max(A,B))

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

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

if n < a+b:
	mi=a+b-n
else:
	mi=0

print(min(a,b),mi)

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

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

print(str(maximum)+' '+str(minimum))

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

Solution (Python):
def examA():
    N, A, B = LI()
    ansmin = max(0,A+B-N)
    ansmax = min(A,B)
    print(ansmax,ansmin)
    return


import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examA()

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

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

Solution (Python):
def main():
    N, A, B = (int(i) for i in input().split())
    x = min(A, B)
    y = max(0, x - (N - max(A, B)))
    print(x, y)


if __name__ == '__main__':
    main()

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N,A,B=MI()
    print(min(A,B), max(0,A+B-N))

if __name__ == '__main__':
    main()

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

Solution (Python):


n,a,b=map(int,input().split())
print(*[min(a,b),max(a+b-n,0)],sep=' ')

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

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

Solution (Python):
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, a, b = list(map(int, readline().split()))
    print(min(a, b), max(a + b - n, 0))


if __name__ == '__main__':
    solve()

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

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

Solution (Python):

import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush, heapify
import math
import itertools
import random

import os
 




 
INF = float('inf')
def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    N,A,B = inputMap()
    
    ans1 = min(A,B)
    tmp = N-A
    if tmp >= B:
        ans2 = 0
    else:
        ans2 = B-tmp
        
    print("{} {}".format(ans1, ans2))
    
    
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(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(0, a+b-n))

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

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())
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())
ans = [min(a,b), max(0,(a+b)-n)]
print(*ans, sep=' ')

Solution (Python):
import sys
input = sys.stdin.readline


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


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

print(M, m, sep = " ")

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

mx = min(a, b)

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

print(mx, mn)

Solution (Python):
from sys import stdin
import fractions

n,a,b = [int(x) for x in stdin.readline().rstrip().split()]

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

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

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

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

ans = []

ans.append(min(a,b))
ans.append(max(0,a+b-n))

print(*ans)

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

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

print(x, y)

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

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

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

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

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

Solution (Python):

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

Solution (Python):
inpl = lambda: list(map(int,input().split()))
N, A, B = inpl()
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(0, a + b - n)

    print(mx, mn)


if __name__ == "__main__":
    main()

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

max = 0
min = 0

if a > b:
  max = b
  min = b - (n - a)
else:
  max = a
  min = a - (n - b)

if min < 0:
  min = 0


print('{} {}'.format(max, min))

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

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

up = min(A,B)

if A+B >= N:
  down = A+B-N
else:
  down = 0
  
print(up,down)

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

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

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

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

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

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

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
int1 = lambda x: int(x) - 1

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

main()

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

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

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

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

ma = min(a, b)
if a + b - n < 0:
    mi = 0
else:
    mi = 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):
def slove():
    import sys
    input = sys.stdin.readline
    n, a, b = list(map(int, input().rstrip('\n').split()))
    print(min(a, b), max(0, a + b - n))


if __name__ == '__main__':
    slove()

Solution (Python):

n, a, b = map(int, input().split())
ans1 = min(a, b)
ans2 = max(a + b - n, 0)
ans = ' '.join([str(ans1), str(ans2)]) 
print(ans)

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

Solution (Python):
from sys import stdin
N,A,B = [int(x) for x in stdin.readline().rstrip().split()]
MAX = min(A,B)
MIN = max(A+B-N,0)
print(MAX,MIN)

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,sep=' ')

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

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

ans=[0,0]

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

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

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

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

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

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

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

if __name__ == "__main__":
    resolve()

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

maxA = min(A, B)
minA = 0
if N - max(A, B) < maxA:
    minA = maxA - (N- max(A, B))
print(maxA, minA)

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

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())
rmax = min(A, B)
rmin = max(0, A+B-N)
print(rmax, rmin)

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

Solution (Python):
from collections import Counter, defaultdict
import sys
sys.setrecursionlimit(10 ** 5 + 10)

from math import factorial
import heapq, bisect
import math
import itertools


import queue
from collections import deque


def main():
    num, a, b = map(int, input().split())
    print(min(a, b), max(0, a + b - num))





if __name__ == '__main__':
    main()

Solution (Python):
def main():

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

    print(" ".join(map(str, [max_v, min_v])))

if __name__ == '__main__':
    
    main()

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

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

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    n, a, b = list(map(int, input().rstrip('\n').split()))
    print(min(a, b), max((a + b) - n, 0))


if __name__ == '__main__':
    slove()

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

Solution (Python):
n, a, b = map(int, input().split(' '))
if a+b <= n:
    min_p = 0
else:
    min_p = abs(n-a-b)
max_p = min([a,b])
print(max_p, min_p)

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





if A < B:
    print(A)
else:
    print(B)
    


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

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

Solution (Python):
def solve(n, a, b):
    return " ".join(map(str, [min(a,b), max(0,a+b-n)]))

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

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

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

Solution (Python):

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N,A,B = inpl()

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

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

Solution (Python):

n, a, b = [ int(v) for v 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),end=" ")
print(max(a+b-n,0))

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

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

print(min(a,b), end=' ')
print(a+b-n if a+b-n>0 else 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 = [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):
import numpy as np


def main():
    n, a, b = map(int, input().split())
    ans_max = min(a, b)
    ans_min = max(a + b - n, 0)
    print(ans_max, ans_min)

    



if __name__ == '__main__':
    main()

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

d = min(a,b)
m = a+b-n

if m < 0:
    m = 0

print("{} {}".format(d,m))

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

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

print(str(mx) + " " + str(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())
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):
print(*["{0} {1}".format(min(x[1],x[2]),x[1]+x[2]-x[0] if x[1]+x[2]-x[0]>0 else 0) for x in [[int(x) for x in input().split()]]])

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

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

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

Solution (Python):

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


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

Solution (Python):
N, X, Y = map(int, input().split())
ans =  X+Y-N
if ans < 0:
    ans = 0
print(min(X,Y), 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())
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(str(min(a,b))+' '+str(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())
max_sub = min(a, b)
min_sub = max_sub - (n-max(a, b))

print(max_sub, min_sub if min_sub > 0 else 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("{0} {1}".format(min(A, B), max(A + B - N, 0)))

Solution (Python):
n, a, b = [int(i) for i in 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())
M=min(a,b)
m=max(0,a+b-n)
print(M,m)