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

maxNum = A
if B < maxNum:
    maxNum = B


oneRead = A+B
if N < oneRead:
    minNum = oneRead - N
else:
    minNum = 0


print(maxNum, minNum)

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

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

large = A if A > B else B
small = B if A > B else A

both_max = small
both_min = small + large - N
if both_min < 0:
    both_min = 0

print('{} {}'.format(both_max, both_min))

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

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

maximum = min(a,b)
minimum = max(0, a+b-n)

print(maximum, minimum)

Solution (Python):
li = [int(i) for i in input().split()]
n = li[0]
a = li[1]
b = li[2]
res1 = min(a,b)
if a+b-n<0:
    res2 =0
else:
    res2=a+b-n
print(res1, res2)

Solution (Python):
N,A,B=[int(x) for x in input().split()]
ansmax = min(A,B)
ansmin = min(A-min(A,N-B),B-min(B,N-A))
print(str(ansmax)+' '+str(ansmin))

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 = list(map(int, input().split()))
if a >= b:
    m = b
else:
    m = a
M = a + b - N
if M <= 0: M = 0
print(m, M)

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

Solution (Python):




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


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


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


print(max, min)

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

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

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

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

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

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

print(min(A, B), ans)

Solution (Python):

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

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

print(n_max, n_min)

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

N = int(s[0])
a = int(s[1])
b = int(s[2])

ans1 = 0
ans2 = 0

ans1 = min(a, b)
if N <= a+b:
    ans2 = abs(a+b-N)

print(ans1, ans2)

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

N = ns[0]
A = ns[1]
B = ns[2]

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

maxXY = min(A,B)

print(maxXY,minXY)

Solution (Python):






def main():
    N, A, B = [int(i) for i in raw_input().strip().split(' ')]

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


if __name__ == '__main__':
    main()

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,end = " ")
print(min)

Solution (Python):
N,A,B=[int(x) for x in raw_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())

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

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

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

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

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 N < A+B:
  ans = A + B - N
else:
  ans = 0

print(min([A,B]),ans)

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

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

if a > b:
    a, b = b, a

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

print(max, min)

Solution (Python):
import bisect
import sys

sys.setrecursionlimit(200000)


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


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


def solve():
    N, a, b = il()
    return "{} {}".format(min(a, b), max(0, a - (N - b)))


if __name__ == "__main__":
    print(solve())

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

Solution (Python):


tmp=input()
n = int(tmp.split(" ")[0])
a = int(tmp.split(" ")[1])
b = int(tmp.split(" ")[2])

x=int(0)
y=int(0)

x=min(a,b)
y=max(a+b-n,0)

print(x,y)

Solution (Python):
nab=list(map(int,input().split()))
n=nab[0]
a=nab[1]
b=nab[2]
c=min(a,b)
if n > a+b:
    d = 0
else:
    d = a+b-n
print("%d %d" %(c,d))

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

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

Solution (Python):

import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, A, B):
    return '%d %d'%(min(A, B), max((A+B)-N, 0) )


def main():
    
    N, A, B = read_int_n()
    print(slv(N, A, B))


if __name__ == '__main__':
    main()

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):
a = list(map(int, input().split()))
N = a[0]
A = a[1]
B = a[2]

ans = [0, 0]
ans[0] = min(a)

if N <= A + B:
  ans[1] = A + B - N

print(' '.join([str(i) for i in ans]))

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):
from string import ascii_lowercase
def inpl(): return list(map(int, input().split()))
N, A, B = inpl()
if A + B <= N:
    C = 0
else:
    abs(A - B)

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

Solution (Python):

def _main():
    N, A, B = map(int, input().split())
    max_count = min(A, B)
    min_count = max((A + B) - N, 0)
    print('{} {}'.format(max_count, min_count))


if __name__ == '__main__':
    _main()

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

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

Solution (Python):
N,A,B = map(int,input().split())
if A >= B:
    ans = B
else:
    ans = A

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

print(str(ans)+ " " + str(ansmin))

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

Solution (Python):
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache, reduce
from math import ceil, floor

import heapq
import itertools
import operator


def get_int():
    return int(input())


def get_str():
    return input().strip()


def get_int_list():
    return [int(i) for i in input().split()]


def get_char_list():
    return list(input().strip())


def main():
    n, a, b = get_int_list()
    max_ = min(a, b)
    min_ = max(0, a + b - n)
    print("{} {}".format(max_, min_))


if __name__ == '__main__':
    main()

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

max_ans = min(A, B)
min_ans = A + B - N
if min_ans < 0:
    min_ans = 0

print(max_ans, min_ans)

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

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

print(max_num, min_num)

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

Solution (Python):

import sys

import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *
n,a,b = map(int, input().split())

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

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

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

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

ansmax = min(a,b)

print(int(ansmax),int(ansmin))

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

print(maxAns, minAns)

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

max_ans = min(A, B)

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

print(max_ans, min_ans)

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

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

print(max_discribe, min_discribe)

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

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

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

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

print(min(a, b), n_min)

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 = [int(_) for _ in input().split()]
print("{} {}".format(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)
Y = max(A+B-N, 0)
print(X, Y)

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

Solution (Python):
L = raw_input()
L = L.split()
for i, val in enumerate(L):
    L[i] = int(val)
N = L[0]
A = L[1]
B = L[2]
K = A + B - N
MAX = min(A, B)
MIN = max(0, K)
print(str(MAX)+" "+str(MIN))

Solution (Python):
def solve(N, A, B):
  maxNum = min(A, B)
  minNum = max(0, (A + B) - N)
  print(maxNum, minNum)

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

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

if n[1] < n[2]:
  a = n[1]
else:
  a = n[2]

b = n[2] + n[1] - n[0]
if b < 0:
  b=0

print(a," ",b)

Solution (Python):
from sys import stdin

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

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

input = lambda: stdin.readline()
main()

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

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

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

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

print(max, min)

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

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

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

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

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

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

mx = min(a, b)

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

print(mx, mn)

Solution (Python):

import sys





"""Template"""


class IP:
    """
    入力を取得するクラス
    """
    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def HF(self, p):
        """
        Half enumeration
        半分全列挙です
        pの要素の和の組み合わせを作ります。
        ソート、重複削除行います
        :param p: list : 元となるリスト
        :return: list : 組み合わせられた和のリスト
        """
        return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))

    def Bfs2(self, a):
        """
        bit_full_search2
        bit全探索の改良版
        全探索させたら2進数のリストと10進数のリストを返す
        :return: list２つ : １個目 2進数(16桁)  2個目 10進数
        """
        
        
        
        value = []
        for i in range(1 << len(a)):
            output = []

            for j in range(len(a)):
                if self.bit_o(i, j):
                    """右からj+1番目のiが1かどうか判定"""
                    
                    output.append(a[j])
            value.append([format(i, 'b').zfill(16), sum(output)])

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

    def SR(self, s):
        """
        昇順ソート（reverse書くのが面倒
        返り値はありません。注意して下さい。
        SR(s) と書いたらsが昇順ソートされるだけです。
        Sort Reverse
        :param s: ソートしたいリスト
        :return: None
        """
        s.sort(reverse=True)

    def bit_n(self, a, b):
        """
        bit探索で使います。0以上のときにTrue出します
        自然数だからn
        :param a: int
        :param b: int
        :return: bool
        """
        return bool((a >> b & 1) > 0)

    def bit_o(self, a, b):
        """
        bit探索で使います。1のときにTrue出すよ
        oneで1
        :param a: int
        :param b: int
        :return: bool
        """
        return bool(((a >> b) & 1) == 1)

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x//y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)


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


def main():
    
    r, e = range, enumerate
    ip = IP()
    id = Idea()

    """この下から書いてね"""
    n, a, b = ip.IL()
    t = min(a, b)
    y = max(max(a, b) - (n - t), 0)
    print(t, y)


main()

Solution (Python):

def getInt(): return int(input())
def getIntList(): return [int(x) for x in input().split()]
def zeros(n): return [0]*n
def db(x): 
    global debug
    if debug: print(x)
debug = True
N,A,B = getIntList()
mx = min(A,B)
mn = max(A+B-N,0)
print(mx,mn)

Solution (Python):


import numpy as np
import scipy

from collections import defaultdict
from pprint import pprint

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

ans1 = min(A,B)
if A+B <= N:
    ans2 = 0
else:
    ans2 = A + B - N
print("{} {}".format(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), end="")
print(" ", end="")
print(max(a+b-n,0))

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

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

Solution (Python):
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 = (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())
if a+b<n:
    print(min(a,b),0)
else:
    print(min(a,b),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())
print(str(min(a,b)) + ' ' + str(max(a + b - n, 0)))

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

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

Solution (Python):


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

max_ = min(a, b)
min_ = n - a - b
min_ = 0 if min_ > 0 else abs(min_)

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

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

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

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


main()

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

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

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

Solution (Python):


import math
import sys
import itertools
import numpy as np


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

minboth = 100
maxboth = 0

def ok(x):
    if x > min(a, b):
        return False
    if a + b - x > n:
        return False
    return True

for both in range(n + 1):
    if ok(both):
        minboth = min(minboth, both)
        maxboth = max(maxboth, both)
print(maxboth,minboth)

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

print(MX, 
      MN)

Solution (Python):
import math
import copy




def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:

            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input().split())
    return l

n=nCast(input().split())
def func():
    res1=min(n[1],n[2])
    if n[1]+n[2]<=n[0]:
        res2=0
    else:
        res2=res2=n[1]+n[2]-n[0]
    return str(res1)+" "+str(res2)


print(func())

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

    mx = min([a, b])
    if a + b > n:
        mn = (a + b) - n
    else:
        mn = 0

    print(mx, mn)


if __name__ == '__main__':
    main()

Solution (Python):


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

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

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

Solution (Python):

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys

def s():
    return raw_input().strip()
def n():
    return int(raw_input())
def d():
    return float(raw_input())

def ls():
    return raw_input().strip().split()
def ln():
    return map(int, raw_input().strip().split())
def ld():
    return map(float, raw_input().strip().split())

def fs():
    return [raw_input().strip() for i in xrange(input())]
def fn():
    return [int(raw_input().strip()) for i in xrange(input())]
def fd():
    return [float(raw_input().strip()) for i in xrange(input())]

N, A, B = ln()

max_val = min(A, B)
min_val = A + B - N if A + B - N > 0 else 0

print max_val, min_val

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

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

ans=(a+b)-n

c = ans if ans>=0 else 0

print(min(a,b),c)

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

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

print(maximum, minimum)

Solution (Python):
def inpl(): return list(map(int, input().split()))
N,a,b = inpl()

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

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

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

print(ansMax, ansMin)

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

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

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

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

Solution (Python):
def solve(N, A ,B):
    return "%d %d" % (min(A, B), max(0, A+B-N))

if __name__ == "__main__":
    N, A, B = map(int, input().split(" "))
    print(solve(N, A, B))

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

Solution (Python):





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

ans = 0




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

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

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

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


nikkei2019_qual_a()

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

Solution (Python):
N,A,B = [int(i) for i in input().split()]
maxXY = min(A,B)
if A+B-N > 0:
    minXY = A+B-N
else:
    minXY = 0
print(maxXY,minXY)

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

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

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

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

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

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

print(num_max, num_min)

Solution (Python):
if __name__ == '__main__':
    import sys
    input = sys.stdin.readline
    n, a,b= map(int, input().split())
    B = [min(a,b), max(a+b-n, 0)]
    print(' '.join(map(str, B)))

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

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

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

Solution (Python):
n,a,b = (int(x) for x in input().split())
res = n - a -b
if res>0:
    res = 0
else:
    res = abs(res)

print(min(a,b) , res)

Solution (Python):
import numpy as np

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

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

print(maximum, minimum)

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

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

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


def main():
    ans = solve()


if __name__ == '__main__':
    main()

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

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

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

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

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

ans_max = min(A,B)
ans_min = max(0,A+B-N)
print(str(ans_max)+' '+str(ans_min))

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

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

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

a1 = min(A, B)

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

print(a1, a2)

Solution (Python):
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N, A, B] = [long(input_raw[0]), long(input_raw[1]), long(input_raw[2])]
    print min(A, B), max(0, (A+B) - N)


if __name__ == '__main__':
    main()

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

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

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

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

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, i, j = map(int, input().split())
de = 0
if(n < (i+j)): de = (i+j) - n
print("{} {}".format(min(i, j), de))

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

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

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

print(ANS1,ANS2)

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

r1 = min(A,B)
r2 = min(A,B) - (N-max(A,B))
if r2 < 0 : r2 = 0

print(r1, r2)

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