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

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

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

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


q=min(a, b)
w=max(0,a+b-n)

print(q,w)

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

max_ans = min(A,B)
if N-A-B>0:
    min_ans = 0
else:
    min_ans = abs(N-A-B)
print(max_ans, min_ans)

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

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

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


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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

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

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

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

Solution (Python):
N,A,B = map(int,input().split())
MAX = min(A,B)
MIN = max(A+B-N,0)
ans = [MAX,MIN]
print(*ans)

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

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

Solution (Python):

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

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N, A, B = map(int, readline().split())

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

import sys
def input():
    return sys.stdin.readline()[:-1]

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

    MaxAns = min(A, B)
    MinAns = 0
    if N >= A + B:
        pass
    else:
        MinAns = -(N - A - B)

    print(MaxAns, MinAns)


if __name__ == '__main__':
    main()

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

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

    print(max_num, min_num)


if __name__ == "__main__":
    main()

Solution (Python):
n, a, b = map(int, input().split(' '))
print(f'{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 main():
    N, A, B = map(int, input().split())
    
    if A + B >= N:
        mini = (A + B) - N
    else:
        mini = 0

    maxi = min(A, B)

    print(maxi, mini)

if __name__ == "__main__":
    main()

Solution (Python):
import sys, math
from functools import lru_cache
import numpy as np
import heapq
from collections import defaultdict
sys.setrecursionlimit(10**9)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

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

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]


def lcm(a, b):
    return a*b//math.gcd(a, b)


def main():
    N, A, B = mi()
    print(min(A, B), max(A+B-N, 0))



if __name__ == '__main__':
    main()

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

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

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

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

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

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rf = lambda: map(float, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

a, b, c = rm()
print(min(b, c), max(0, b+c-a))

Solution (Python):
'''
Created on 2020/08/20

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  N,A,B=map(int,pin().split())
  t=0
  if N<=A+B:
    t=abs(N-A-B)
  print(f"{min(A,B)} {t}")
  return 

main()

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

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

Solution (Python):

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

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

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

Solution (Python):
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 == 0 or b == 0:
    print(0, 0)

elif n > a+b:
    max_ab = min(a, b)
    print(max_ab, 0)

else:
    max_ab = min(a, b)
    print(max_ab, a+b-n)

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

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

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N, A, B = LI()

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

if __name__ == '__main__':
    resolve()

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


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


if __name__ == '__main__':
    main()

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

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
import collections
import bisect
readline = sys.stdin.readline


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


if __name__ == '__main__':
    main()

Solution (Python):
n, a, b = map(int, input().split())
max_value = min(a, b)
if a + b - n < 0:
    min_value = 0
else:
    min_value = a + b - n
print(f'{max_value} {min_value}')

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





import math
import fractions
import sys
import bisect
import heapq  
import collections
from collections import Counter
from collections import deque
import pprint
import itertools

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr



def power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod



def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors


inf = 10 ** 18
mod = 10 ** 9 + 7

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

Solution (Python):
n,a,b=map(int,input().split())
mx=min(a,b)
mn=max(mx-(n-max(a,b)),0)
print(str(mx)+" "+str(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())
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):
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())
M = min(a, b)
m = max(0, a+b-n)
print(M, m)

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

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

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

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

if(A>B):
  ans1=B
  ans2=max(0,A-(N-B))
else:
  ans1=A
  ans2=max(0,B-(N-A))
  
print(str(ans1)+" "+str(ans2))

Solution (Python):
def main():
    n, a, b = list(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())

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

Solution (Python):
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

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

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

Solution (Python):



from fractions import gcd
from itertools import combinations,permutations,accumulate 

from collections import deque,defaultdict,Counter
import decimal
import re











import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n,a,b = readInts()
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):
import sys
from collections import defaultdict, deque, Counter
import math
 

from bisect import bisect_left, bisect_right

 

 

input = sys.stdin.readline
 
getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]
 
INF = 10 ** 20
MOD = 10**9 + 7
divide = lambda x: pow(x, MOD-2, MOD)

def main():
    n, a, b = getList()
    mx = min(a, b)
    mn = max(a + b - n, 0)
    print(mx, mn)

if __name__ == "__main__":
    main()

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

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

N, A, B = inm()


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


print(*solve())

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

s=min(a,b)
t=max(a,b)

if s+t<=n:
    u=0

else:
    u=s+t-n

print(str(s)+' '+str(u))

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

Solution (Python):


import sys
from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union































def main():
    Num = Union[int, float]
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input():  return sys.stdin.readline().rstrip()
    def ii():     return int(input())
    def isp():    return input().split()
    def mi():     return map(int, input().split())
    def mi_0():   return map(lambda x: int(x)-1, input().split())
    def lmi():    return list(map(int, input().split()))
    def lmi_0():  return list(map(lambda x: int(x)-1, input().split()))
    def li():     return list(input())
    def debug(x): print(x, file=sys.stderr)
    
    
    
    n, a, b = mi()
    print(f"{min(a, b)} {max(0, a + b - n)}")


if __name__ == "__main__":
    main()

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N,A,B=MI()
    a=min(A,B)
    b=max((A+B)-N,0)
    print(a,b)

main()

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

ans_max = min(a, b)
ans_min = max(0, a + b - n)
print("{} {}".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):
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):
n, a, b = map(int, input().split())
print(min(a,b), end=" ")
c = a+b-n
if 0 < c:
  print(c)
else:
  print(0)

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

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


if __name__ == "__main__":
    main()

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

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

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

S=min(A,B)
T=0
if A+B >N:
  T=(A+B)-N

print(S,T)

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

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

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7


N, A, B = MAP()

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

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

l.append(min(a,b))

if n >= a + b:
    l.append(0)
else:
    l.append(a + b - n)

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

Solution (Python):






import sys
input = sys.stdin.readline

import math

import bisect
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache






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






def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]


def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()


def DD(arg): return defaultdict(arg)



def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr


def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors


def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


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


def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count


def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))


def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count





N,A,B = IL()

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

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

Solution (Python):
def nikkei19q_a():
    N, A, B = map(int, input().split())
    ans_max = min(A, B)
    ans_min = max(0, A + B - N)
    print(*[ans_max, ans_min], sep=' ')

nikkei19q_a()

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

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


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


if __name__ == '__main__':
    resolve()

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

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

Solution (Python):
from sys import stdin
import math
import re
import queue

input = stdin.readline

MOD = 1000000007
INF = 122337203685477580

def solve():
    N,X,Y = map(int, input().split())
    print(min(X,Y),max(0,X + Y - N))
    
if __name__ == '__main__':
    solve()

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

both = min(a,b)
any = max(0, (a+b) - n)

print(both, any)

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

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

print(r_max, r_min)

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n,a,b=map(int, input().split())
    ans1=min(a,b)
    ans2=max(a+b-n,0)
    print(ans1,ans2)
resolve()

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

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

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

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    N, A, B = map(int, input().split())
    max_XY = min(A, B)
    min_XY = max(A + B - N, 0)
    print("{} {}".format(max_XY, min_XY))


if __name__ == "__main__":
    main()

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

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

print(str(MAX)+' '+str(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())
ans1=min(a,b)
if a+b>n:
    ans2=a+b-n
else:
    ans2=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
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

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

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

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

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

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

Solution (Python):
import sys
import math
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def S(): return sys.stdin.readline()
def LS(): return sys.stdin.readline().split()
def LS2(N): return [sys.stdin.readline().split() for i in range(N)]
def FILL(i,h,w): return [[i for j in range(w)] for k in range(h)]
def sisha(num,digit): return Decimal(str(num)).quantize(Decimal(digit),rounding=ROUND_HALF_UP)

MOD = 1000000007
INF = float("inf")
sys.setrecursionlimit(10**5+10)
input = sys.stdin.readline


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

print(min(A,B),max)

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

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

Solution (Python):

"""
Created on Mon Apr 27 21:00:04 2020
"""

import sys


sys.setrecursionlimit(10 ** 9)


mod = 10**9+7


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



b = A + B - N if A + B - N >=0 else 0
ans = [str(min(A,B)),str(b)]

print(' '.join(ans))

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

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

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


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

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):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

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

if __name__ == '__main__':
    main()

Solution (Python):

if False:
    N=int(input())
    if N%2==0: print(N//2-1)
    else: print(N//2)


if False:
    M,D=map(int,input().split())
    ans=0
    for m in range(1,M+1):
        for d in range(1,D+1):
            if len(str(d))==2:
                x,y=int(str(d)[0]),int(str(d)[1])
                if x>=2 and y>=2 and x*y==m:
                    ans+=1
    print(ans)


if False:
    N,K=map(int,input().split())
    MAX=N-K+1
    print(MAX-1 if K!=1 else 0)


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

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

maximum = min([A, B])

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

print(maximum, minimum)

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

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

if __name__=='__main__':
    main()