qyliang/CodeNanoFix huggingface dataset:
# Buggy code:
n,m = map(int, input().split())
x = list(map(int, input().split()))
x.sort()

dis=[]
res=0
if n>m: 
    print(0)
else:
    for i in range(len(x)-1):
        dis[i] = x[i+1] - x[i]

    dis.sort()

    for j in range(n-1):
        res += dis[j]

    print(sum(dis) - res)

# Fixed code:
n,m = map(int, input().split())
x = list(map(int, input().split()))
x.sort()

dis=[x[i+1]-x[i] for i in range(m-1)]
dis.sort()
print(sum(dis[:m-n]) if m>=n else 0)
# Buggy code:
n, m = map(int, input().split())
x = list(map(int, input().split()))
x.sort()

if n < m:
    x_distance = [x[i + 1] - x[i] for i in range(m - 1)]
    x_distance.sort()
    print(x_distance)
    ans = 0
    for i in range (m - n):
        ans += x_distance[i]
    print(ans)
else:
    print(0)


# Fixed code:
n, m = map(int, input().split())
x = list(map(int, input().split()))
x.sort()

if n < m:
    x_far = [abs(x[i + 1] - x[i]) for i in range(m - 1)]
    x_far.sort()
    ans = 0
    for i in range (m - n):
        ans += x_far[i]
    print(ans)
else:
    print(0)
# Buggy code:
N,M=map(int,input().split())
X=[int(i) for i in input().split()]
X.sort()
count=[]
sum=0
for i in range(M):
  if i != 0:
    count.append(X[i]-get)
    sum+=count[i-1]
  get=X[i]
count.sort(reverse=True)
for i in range(N-1):
  sum-=count[i]
print(sum)

# Fixed code:
N,M=map(int,input().split())
X=[int(i) for i in input().split()]
X.sort()
count=[]
sum=0
if N<M:
  for i in range(M):
    if i != 0:
      count.append(X[i]-get)
      sum+=count[i-1]
    get=X[i]
  count.sort(reverse=True)
  if count != []:
    for i in range(N-1):
      sum-=count[i]
print(sum)
# Buggy code:
n,m = map(int,input().split())
list1 = list(map(int,input().split()))
list1.sort()
list2 = []
for i in range(m-1):
	list2.append(list1[i+1]-list1[i])
list2.sort(reverse = True)
cut = 0
for j in range(n-1):
	cut+= list2[j]
print(max(list1)-min(list1)-cut)

# Fixed code:
n,m = map(int,input().split())
if n>=m:
  print(0)
  exit()
list1 = list(map(int,input().split()))
list1.sort()
list2 = []
for i in range(m-1):
	list2.append(list1[i+1]-list1[i])
list2.sort(reverse = True)
cut = 0
for j in range(n-1):
	cut+= list2[j]
print(max(list1)-min(list1)-cut)
# Buggy code:
n,m = map(int,input().split())
x = list(map(int,input().split()))
x.sort()
dis = []
ans = 0
for i in range(m-1):
    dis.append(x[i+1]-x[i])
    ans += x[i+1]-x[i]
dis.sort(reverse = True)
for j in range(n-1):
    ans -= dis[j]
print(ans)

# Fixed code:
n,m = map(int,input().split())
x = list(map(int,input().split()))
x.sort()
dis = []
ans = 0
if n>m:
  print(0)
  exit()
for i in range(m-1):
    dis.append(x[i+1]-x[i])
    ans += x[i+1]-x[i]
dis.sort(reverse = True)
for j in range(n-1):
    ans -= dis[j]
print(ans)
# Buggy code:
nandm = input().split()
numlist = input().split()
N = int(nandm[0])
M = int(nandm[1])
if N >= M:
    print(0)
else:
    intlist = [int(num) for num in numlist]
    intlist.sort()
    subtract = [intlist[i + 1] - intlist[i] for i in range(len(intlist) - 1)]
    subtract.sort()
    print(sum(subtract[M - N]))

# Fixed code:
nandm = input().split()
numlist = input().split()
N = int(nandm[0])
M = int(nandm[1])
if N >= M:
    print(0)
else:
    intlist = [int(num) for num in numlist]
    intlist.sort()
    subtract = [intlist[i + 1] - intlist[i] for i in range(len(intlist) - 1)]
    subtract.sort()
    print(sum(subtract[:(M - N)]))
# Buggy code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
kyori=[]
if n>=m:
    print(0)
    
else:
    for i in range(m-1):
        kyori.append(a[i+1]-a[i])

kyori.sort()
b=sum(kyori[:m-n])
print(b)

# Fixed code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
kyori=[]
if n>=m:
    print(0)
    
else:
    for i in range(m-1):
        kyori.append(a[i+1]-a[i])
    b=0
    kyori.sort()
    for i in range(m-n):
        b+=kyori[i]
    
    print(b)
# Buggy code:
N,M = map(int,input().split())
X = list(map(int,input().split()))
X.sort()
ans = X[-1] - X[0]
d = []
for i in range(N-1):
    d.append(X[i+1]-X[i])
d.sort()
n = min(N-1,M-1)
for i in range(n):
    ans -= d[-i]
print(ans)

# Fixed code:
N,M = map(int,input().split())
X = list(map(int,input().split()))
X.sort()
d = []
for i in range(M-1):
    d.append(X[i+1]-X[i])
d.sort()
n = min(M-1,N-1)
for i in range(n):
    d.pop()
ans = sum(d)
print(ans)
# Buggy code:
import itertools
import math

n, m = map(int, input().split())
x = list(map(int, input().split()))

x.sort()
print(x)

dis = []
for i in range(m-1):
    dis.append(x[i+1]-x[i])

dis.sort(reverse=True)
for i in range(len(dis)):
    dis[i] = 0

print(sum(dis))

# Fixed code:
import itertools
import math

n, m = map(int, input().split())
x = list(map(int, input().split()))

x.sort()

dis = []
for i in range(m-1):
    dis.append(x[i+1]-x[i])

dis.sort(reverse=True)
for i in range(min(n-1,len(dis))):
    dis[i] = 0

print(sum(dis))
# Buggy code:
B = [0]

N,M = map(int, input().split())
X = list(map(int, input().split()))
X = sorted(X)
print(X)
for i in range(1,M):
    x = X[i]-X[i-1]
    B.append(x)
B = sorted(B)
B = B[::-1]
print(B)
print(X[-1]-X[0]-sum(B[:N-1]))

# Fixed code:
B = [0]

N,M = map(int, input().split())
X = list(map(int, input().split()))
X = sorted(X)
for i in range(1,M):
    x = X[i]-X[i-1]
    B.append(x)
B = sorted(B)
B = B[::-1]
print(X[-1]-X[0]-sum(B[:N-1]))
# Buggy code:
import sys 
N, M = map(int, input().split())
X = list(map(int, input().split()))

X = sorted(X)

anslis = []


if M >= N:
    print(0)
    sys.exit()


    
for i in range(M-1):
    ans = abs(X[i+1] - X[i])
    anslis.append(ans)
    ans = 0

anslis = sorted(anslis)

print(sum(anslis[0:N+1]))

# Fixed code:
import sys 
N, M = map(int, input().split())
X = list(map(int, input().split()))

X = sorted(X)

anslis = []


if M <= N:
    print(0)
    sys.exit()


    
for i in range(M-1):
    ans = abs(X[i+1] - X[i])
    anslis.append(ans)
    ans = 0

anslis = sorted(anslis)

if N==1:
    print(sum(anslis))
else:
    print(sum(anslis[0:M-N]))
# Buggy code:
n, m = map(int, input().split())
if n >= m:
  print(0)
else:
  x = sorted(list(map(int, input().split())))

  y = []
  for i in range(m-1):
    y.append(h[i+1] - h[i])

  y_sorted = sorted(y, reverse=True)

  ans = 0
  for _y in y[n:]:
    ans += _y
  print(ans)

# Fixed code:
n, m = map(int, input().split())
if n >= m:
  print(0)
else:
  x = sorted(list(map(int, input().split())))

  y = []
  for i in range(m-1):
    y.append(x[i+1] - x[i])

  y_sorted = sorted(y, reverse=True)

  ans = 0
  for _y in y_sorted[n-1:]:
    ans += _y
  print(ans)
# Buggy code:

n, m = map(int, input().split())

x = list(map(int, input().split()))
x = sorted(x)
diff = [x[i+1] - x[i] for i in range(0, m-1)]

sort_diff = sorted(diff, reverse=True)

sum = 0
for i in range(n-1):
    sort_diff.pop(0)

for i in range(len(sort_diff)):
    sum += sort_diff[i]
print(sum)

# Fixed code:
n, m = map(int, input().split())

if n >= m:
    print(0)
    exit()

x = list(map(int, input().split()))
x = sorted(x)
diff = [x[i+1] - x[i] for i in range(0, m-1)]

sort_diff = sorted(diff, reverse=True)

sum = 0

if len(sort_diff) == 0:
    print(0)
    exit()

for i in range(n-1):
    sort_diff.pop(0)

for i in range(len(sort_diff)):
    sum += sort_diff[i]
print(sum)
# Buggy code:
N, M = map(int, input().split())
X = list(map(int, input().split()))
ans = 0
diff = []
 
X.sort()
 
for i in range(M-1):
  dif = X[i+1] -X[i]
  diff.append(dif)
  
diff.sort()
 
for n in range(N):
  diff.pop(-1)
 
for i in range(len(diff)):
  ans += diff[i]

print(ans)

# Fixed code:
N, M = map(int, input().split())
X = list(map(int, input().split()))
ans = 0
diff = []
 
X.sort()
 
if (N < M): 
    for i in range(M-1):
        dif = X[i+1] - X[i]
        diff.append(dif)
    
    diff.sort()
    
    for i in range(M-N):
        ans += diff[i]
    # for n in range(N):
    #     diff.pop(-1)
   
    # for i in range(len(diff)):
    #     ans += diff[i]
print(ans)
# Buggy code:
n,m = map(int,input().split())
if n >= m :
  print(0)
else:
  ls=[int(s) for s in input().split()]
  ls.sort()
  d=[ls[i+1]-ls[i] for i in range(m-1)]
  d.sort()
  print(sum(d[:n-m]))


# Fixed code:
n,m = map(int,input().split())
if n >= m :
  print(0)
else:
  ls=[int(s) for s in input().split()]
  ls.sort()
  d=[ls[i+1]-ls[i] for i in range(m-1)]
  d.sort()
  print(sum(d[:m-n]))
# Buggy code:
N,M = map(int,input().split())
X = sorted(map(int,input().split()))
L = sorted([X[i+1]-X[i] for i in range(M-1)])
if M < L:print(0)
else:print(sum(L[:(M-N)]))

# Fixed code:
N,M = map(int,input().split())
X = sorted(map(int,input().split()))
L = sorted([X[i+1]-X[i] for i in range(M-1)])
if M < N:print(0)
else:print(sum(L[:(M-N)]))
# Buggy code:
N,M=[int(i) for i in input().split()]
X=[int(i) for i in input().split()]
X.sort()
rui=[]
for i in range(len(X)-1):
  rui.append(X[i+1]-X[i])
rui.sort()
if N==1:
  print(sum(rui))
if M<=N:
  print(sum(rui[0:-(N-1)]))
else:
  print(0)

# Fixed code:
N,M=[int(i) for i in input().split()]
X=[int(i) for i in input().split()]
X.sort()
rui=[]
for i in range(len(X)-1):
  rui.append(X[i+1]-X[i])
rui.sort()
if N==1:
  print(sum(rui))
elif M>=N:
  print(sum(rui[0:-(N-1)]))
else:
  print(0)
# Buggy code:
n,m = list(map(int,input().split()))

data = [int(s) for s in input().split()]
data.sort()
l = []
for i in range(m-1):
    l.append(data[i+1]-data[i])
l.sort(reverse = True)

x = 0
for i in range(n-1):
    x += l[i]
print(data[m-1] - data[0] - x)


# Fixed code:
n,m = list(map(int,input().split()))

data = [int(s) for s in input().split()]
data.sort()
l = []
if n >= m:
    print(0)
else:
    for i in range(m-1):
        l.append(data[i+1]-data[i])
    l.sort(reverse = True)

    x = 0
    for i in range(n-1):
        x += l[i]
    print(data[m-1] - data[0] - x)
# Buggy code:
def main():
  N, M = map(int, input().split())
  X = list(map(int, input().split()))
  
  X = sorted(X)
  print(X)
  X = sorted([X[i+1]-X[i] for i in range(M-1)], reverse=True)
  print(X)
  print(sum(X[N-1:]))


main()

# Fixed code:
def main():
  N, M = map(int, input().split())
  X = list(map(int, input().split()))
  
  X = sorted(X)
  X = sorted([X[i+1]-X[i] for i in range(M-1)], reverse=True)
  print(sum(X[N-1:]))


main()
# Buggy code:
N,M = map(int,input().split())
l = list(map(int,input().split()))
if M <= N:
    print('0')
else:
    l.sort()
    li = []
    for i in range(M-1):
        difference  = abs(l[i]-l[i+1])
        li.append(difference)
    li.sort().reverse()
    dif = 0
    for i in range(N-1):
        dif += li[i]
    print(l[M-1]-l[0]-dif)

# Fixed code:
N,M = map(int,input().split())
l = list(map(int,input().split()))
if M <= N:
    print('0')
else:
    l.sort()
    li = []
    for i in range(M-1):
        difference  = abs(l[i]-l[i+1])
        li.append(difference)
    li.sort()
    li.reverse()
    dif = 0
    for i in range(N-1):
        dif += li[i]
    print(l[M-1]-l[0]-dif)
# Buggy code:
n,m=map(int,input().split())
x=sorted(list(map(int,input().split())))
if n<=m:
  print(0)
else:
  d=[]
  for j in range(n-1):
    d.append(x[i+1]-x[i])
  d=sorted(d)
  print(sum(d[:m]))

# Fixed code:
n,m=map(int,input().split())
x=sorted(list(map(int,input().split())))
if m<=n:
  print(0)
else:
  d=[]
  for i in range(m-1):
    d.append(x[i+1]-x[i])
  d=sorted(d)
  print(sum(d[:m-n]))
# Buggy code:
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    N,M = map(int, lines.pop(0).split(' '))
    X = list(map(int, lines.pop(0).split(' ')))
    X.sort()
    span = []
    for i in range(M-1):
        span.append( X[i+1] - X[i] )
    span.sort()
    for i in range(N-1):
        span.pop(-1)
    print(sum(span))

#
# main
#

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)


# Fixed code:
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    N,M = map(int, lines.pop(0).split(' '))
    X = list(map(int, lines.pop(0).split(' ')))
    if N >= M:
        print(0)
        sys.exit(0)
    X.sort()
    span = []
    for i in range(M-1):
        span.append( X[i+1] - X[i] )
    span.sort()
    for i in range(N-1):
        span.pop(-1)
    print(sum(span))

#
# main
#

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)
# Buggy code:
def main():
    # n = int(input())
    n, m = map(int, input().split())
    x = list(map(int, input().split()))
    # s = input()
    # h = [int(input()) for _ in range(n)]

    x.sort()

    subs = []

    for i in range(1, m):
        subs.append(abs(x[i]-x[i-1]))

    subs.sort()
    print(subs)
    if (m <= n):
        print(0)
    else:
        print(sum(subs[0:m-n]))


if __name__ == '__main__':
    main()


# Fixed code:
def main():
    # n = int(input())
    n, m = map(int, input().split())
    x = list(map(int, input().split()))
    # s = input()
    # h = [int(input()) for _ in range(n)]

    x.sort()

    subs = []

    for i in range(1, m):
        subs.append(abs(x[i]-x[i-1]))

    subs.sort()
    if (m < n):
        print(0)
    else:
        print(sum(subs[0:m-n]))


if __name__ == '__main__':
    main()
# Buggy code:
n = list(map(int, input().split()))
print(min(n[1], n[2]))
print(max(0, n[1] - n[2]))

# Fixed code:
n = list(map(int, input().split()))
print(min(n[1], n[2]), max(0, n[1] + n[2] - n[0]))
# Buggy code:
n,a,b=map(int,input().split())
s=min(a,b)
l=0
if n>a+b:
  l=abs(b-a)
print("{} {}".format(s,l))


# Fixed code:
n,a,b=map(int,input().split())
s=min(a,b)
l=0
if n<a+b:
  l=abs(n-abs(b+a))
print("{} {}".format(s,l))
# Buggy code:
import sys

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

    print(both_max, both_min)


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


if __name__ == '__main__':
    main()


# Fixed code:
import sys

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

    print(both_max, both_min)


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


if __name__ == '__main__':
    main()
# Buggy code:
n, a, b = map(int,input().split())
print(max(a, b), end='')
print(max(a+b-n,0))

# Fixed code:
n,a,b = map(int, input().split())

print(min(a,b), end="")
print(" ", end="")
print(max(a+b-n,0))
# Buggy code:
N,A,B = map(int,input().split())
maxN,minN = 0

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

# Fixed code:
N, A, B = map(int, input().split())
max = min([A, B])
if (A + B) - N > 0:
    min = (A + B) - N
else:
    min = 0
print("{} {}".format(max, min))
# Buggy code:
N,A,B= map(int, input().split())
X = min(A, B)
Y = max(0, A+B-10)
print(X, Y)

# Fixed code:
N, A, B = list(map(int, input().split()))

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

print(X, Y)
# Buggy code:
N, A, B = [int(i) for i in input().split()]

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

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

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

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

print("{0} {1}".format(X, Y))
# Buggy code:
N,A,B = map(int,input().split())

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

if max>10:
    print(min,max-10)
else:
    print(min,0)


# Fixed code:
N,A,B = map(int, input().split())
if N-A-B>=0:
    print(min(A,B),0)
else:
    print(min(A,B), A+B-N)
# Buggy code:
N, A, B = map(int, input().split())
print(min(A, B), max(0, N - (A + B)))

# Fixed code:
N, A, B = map(int, input().split())
print(min(A, B), max(A+B-N, 0))
# Buggy code:
N, A, B = list(map(int, input().split()))

ans1 = min(A, B)
ans2 = max(N - A - B, 0)

print(ans1, ans2)


# Fixed code:
N, A, B =map(int, input().split())

ans1 = min(A,B)
ans2 = max(0, A+B-N)
print(ans1, ans2)
# Buggy code:
N,A,B=map(int,input.split())
#the max
print(min(A,B))
print(max(0,A+B-N))

# Fixed code:
N,A,B=map(int,input().split())
#the max
print(min(A,B),max(0,A+B-N))
# Buggy code:

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

# Fixed code:
n, a, b = list(map(int, input().split()))

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

if n < a + b:
    print((a+b)-n)
else:
    print(0)
# Buggy code:
N,A,B=[int(_) for _ in input().split() ]
if A>=B:
    BIG=A
    SMALL=B
if B>A:
    BIG=B
    SMALL=A

MAX=BIG

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

MIN=0
print(str(MAX)+' '+str(MIN))


# Fixed code:

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

MAX=SMALL

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


MIN=BIG+SMALL-N
print(str(MAX)+' '+str(MIN))
# Buggy code:
a,b,c=map(int,input(),split())
q=min(b,c)
w=b+c-a
print("{} {}".format(q,w))

# Fixed code:
a,b,c=map(int,input().split())
q=min(b,c)
w=b+c-a
print("{} {}".format(q,max(0,w)))
# Buggy code:
n,a,b = map(int,input.split())

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

# Fixed code:
n, a, b = map(int, input().split())

print(min(a, b), max(a + b - n, 0))
# Buggy code:
N, A, B = map(int, input().split())

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


# Fixed code:
N, A, B = map(int, input().split())

print(min(A, B), 0 if A + B <= N else max(A, B) - (N - min(A, B)))
# Buggy code:
n, a, b = map(int, input().split())

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

# Fixed code:
n,a,b=map(int,input().split())
print(min(a,b),end=" ")
if a+b>n:
    print(a+b-n)
else:
    print(0)
# Buggy code:
n = input().split()
N = int(n[0])
A = int(n[1])
B = int(n[2])

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

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


# Fixed code:
n = input().split()
N = int(n[0])
A = int(n[1])
B = int(n[2])

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

if a != b:
    if a+b <= N:
        print(str(b) + ' ' + str(0))
    elif a+b > N:
        print(str(b) + ' ' + str(a - (N-b)))
elif a+b <= N:
    print(str(a) + ' ' + str(0))
elif a+b > N:
    print(str(a) + ' ' + str(a-(N-b)))
# Buggy code:
n, a, b = map(int, input().split(' '))
print(f'{min(a,b)} {min(0,abs(a+b-n))}')


# Fixed code:
n, a, b = map(int, input().split(' '))
print(f'{min(a,b)} {max(0,a+b-n)}')
# Buggy code:
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]
print(a + " " + b)

# Fixed code:
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))
# Buggy code:
n,a,b = map(int,input().split())
if  n < a+b:
    print(min(a,b),n-a+b)
else:
    print(min(a,b),0)

# Fixed code:
n, a, b = map(int, input().split())
c = min(a, b)
if a + b <= n:
	d = 0
else:
	d = a+b-n
print(c, d)
# Buggy code:
N, A, B = map(int,input().split())

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

# Fixed code:

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

print(str(min(A,B))+" "+str(max(0,A+B-N)))
# Buggy code:
N, A, B = list(map(int,input().split()))

up = min(A,B)

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

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

# Fixed code:
n,a,b = map(int, input().split())
if a+b > n:
  q = a+b-n
else :
  q = 0
print( str(min(a,b)) +" "+ str(q))
# Buggy code:
N, A, B = map(int, input().split())

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

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

# Fixed code:
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))
# Buggy code:
n,a,b=map(int,input().split())
if n>=a+b:
    if a>b:
        print(a,0)
    else:
        print(b,0)
else:
    if a>b:
        print(a,a+b-n)
    else:
        print(b,a+b-n)

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

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

print(max, " ", min)

# Fixed code:
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)
# Buggy code:
i = input().split()
all = int(i[0])
x = int(i[1])
y = int(i[2])
t = 0
max = 0
if x > y:
    max = x - abs(x - y)
    t = x
elif y > x:
    max = y - abs(x - y)
    t = y 
else:
    t = all
    max = x

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

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

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

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

if nx > ny:
    nt = nx
elif ny > nx:
    nt = ny
else:
    nt = nx
if t >= nt: 
    min = t - nt
else:
    min = 0
print("{0} {1}".format(max,min))
# Buggy code:
n,a,b=map(int,input.split())
mx=min(a,b)
mn=mx-(n-max(a,b))
print(str(mx)+" "+str(mn))

# Fixed code:
n,a,b=map(int,input().split())
mx=min(a,b)
mn=max(mx-(n-max(a,b)),0)
print(str(mx)+" "+str(mn))
# Buggy code:
from sys import stdin

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




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

# Fixed code:
from sys import stdin

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




if B+C <= A:
    print(str(min(B,C)) + ' ' + str(0))
else:
    print(str(min(B,C)) + ' ' +str(B+C-A))
# Buggy code:
n = int(input())
a, b, c = input(), input(), input()
ans = 0
for i in range(n):
  ans += len(set(a[i], b[i], c[i])) - 1
print(ans)

# Fixed code:
n = int(input())
a = str(input())
b = str(input())
c = str(input())

ans = 0
for i in range(n):
  chrs = set([a[i], b[i], c[i]])
  ans += len(chrs) - 1

print(ans)
# Buggy code:
n = int(input())
a,b,c = input(),input(),input()

ans = 0
for i in range(n):
  cnt = len(set(a[i],b[i],c[i]))-1
  ans += cnt

print(ans)

# Fixed code:
n = int(input())
a = input()
b = input()
c = input()
ans = 0
for i in range(n):
    ans += len(set(a[i]+b[i]+c[i]))-1
print(ans)
# Buggy code:
n=int(input())
a=input()
b=input()
c=input()
al=list(a)
bl=list(b)
cl=list(c)

count=0
for i in range(n):
    if al[i]==bl[i]:
        if al[i]==cl[i]:
            plus=2
        elif:
            plus=1
    elif bl[i]==cl[i]:
        plus=1
    elif al[i]==cl[i]:
        plus=1
    else:
        plus=0
        
    count+=plus
    
print(count)

# Fixed code:
n=int(input())
a=input()
b=input()
c=input()
al=list(a)
bl=list(b)
cl=list(c)

count=0

for i in range(n):
    if al[i]==bl[i]:
        if al[i]==cl[i]:
            plus=0
        else:
            plus=1
    elif bl[i]==cl[i]:
        plus=1
    elif al[i]==cl[i]:
        plus=1
    else:
        plus=2
        
    count+=plus
    
print(count)