One day Vasya the Hipster decided to count how many socks he had. It turned out that he had a red socks and b blue socks.

According to the latest fashion, hipsters should wear the socks of different colors: a red one on the left foot, a blue one on the right foot.

Every day Vasya puts on new socks in the morning and throws them away before going to bed as he doesn't want to wash them.

Vasya wonders, what is the maximum number of days when he can dress fashionable and wear different socks, and after that, for how many days he can then wear the same socks until he either runs out of socks or cannot make a single pair from the socks he's got.

Can you help him?


-----Input-----

The single line of the input contains two positive integers a and b (1 ≤ a, b ≤ 100) — the number of red and blue socks that Vasya's got.


-----Output-----

Print two space-separated integers — the maximum number of days when Vasya can wear different socks and the number of days when he can wear the same socks until he either runs out of socks or cannot make a single pair from the socks he's got.

Keep in mind that at the end of the day Vasya throws away the socks that he's been wearing on that day.


-----Examples-----
Input
3 1

Output
1 1

Input
2 3

Output
2 0

Input
7 3

Output
3 2



-----Note-----

In the first sample Vasya can first put on one pair of different socks, after that he has two red socks left to wear on the second day.

Source: codeforces | Difficulty: EASY
Tags: Mathematics

Implementation


Solutions:
(a, b) = list(map(int, input().split()))
ans = min(a, b)
ans2 = (max(a, b) - min(a, b)) // 2
print(str(ans) + ' ' + str(ans2))


(a, b) = map(int, input().split())
if a > b:
	(a, b) = (b, a)
b = (b - a) // 2
print(a, b)


(a, b) = map(int, input().split())
k = min(a, b)
a -= k
b -= k
if a > 0 and a % 2 == 0:
	print(k, int(a / 2))
elif a > 0 and a % 2 != 0:
	print(k, int((a - 1) / 2))
elif b > 0 and b % 2 == 0:
	print(k, int(b / 2))
elif b > 0 and b % 2 != 0:
	print(k, int((b - 1) / 2))
else:
	print(k, 0)


(a, b) = map(int, input().split())
if a < b:
	ans1 = a
else:
	ans1 = b
ans2 = abs(a - b) // 2
print(ans1, ans2)


blue_red = list(map(int, input().strip().split(' ')))
print(min(blue_red), end='')
print(' ', end='')
print((max(blue_red) - min(blue_red)) // 2)


(a, b) = [int(s) for s in input().split()]
print(min(a, b), abs(a - b) // 2)


(a, b) = map(int, input().split())
if a > b:
	x = b
	y = int((a - b) / 2)
	print(str(x) + ' ' + str(y))
elif b > a:
	x = a
	y = int((b - a) / 2)
	print(str(x) + ' ' + str(y))
if a == b:
	x = int(a)
	print(str(x) + ' ' + '0')


class Main:
	(a, b) = input().split(' ')
	(a, b) = (int(a), int(b))
	fashion_days = min(a, b)
	simple_days = int((max(a, b) - min(a, b)) / 2)
	print(fashion_days, simple_days)
Main()


num = list(map(int, input().strip().split()))
a = str(min(num))
b = str((max(num) - min(num)) // 2)
print(a + ' ' + b)


n = input().split()
n1 = int(n[0])
n2 = int(n[1])
x = min(n1, n2)
y = (max(n1, n2) - min(n1, n2)) // 2
z = str(x) + ' ' + str(y)
print(z)


(a, b) = map(int, input().split())
A = [a, b]
A.sort()
days1 = A[0]
Q = A[1] - A[0]
days2 = Q // 2
print(days1, days2)


(a, b) = input().split()
a = int(a)
b = int(b)
mini = min(a, b)
maxi = int(abs(a - b) / 2)
print(str(mini) + ' ' + str(maxi))


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


(r, b) = (int(v) for v in input().split())
print(str(min(r, b)) + ' ' + str(abs(r - b) // 2))


(r, b) = map(int, input().split())
if r == b:
	print(r, '0')
elif r > b:
	c = (r - b) // 2
	print(b, c)
else:
	c = (b - r) // 2
	print(r, c)


(n, m) = map(int, input().split())
l = 0
if n == m:
	if n % 2 == 0:
		print(n, 0)
	else:
		print(n, 0)
else:
	l = abs(n - m)
	if l % 2 == 0:
		if n > m:
			print(m, l // 2)
		else:
			print(n, l // 2)
	elif n > m:
		print(m, l // 2)
	else:
		print(n, l // 2)


__author__ = 'suvasish'
tc = input()
_split = tc.split(' ')
a = int(_split[0])
b = int(_split[1])
diff_sock = a
if b < a:
	diff_sock = b
ma = int((a - diff_sock) / 2)
mb = int((b - diff_sock) / 2)
max_days = ma
if mb > ma:
	max_days = mb
print(diff_sock, max_days)


r = input().split()
a = int(r[0])
b = int(r[1])
if a > b:
	max = b
	left = a - b
else:
	max = a
	left = b - a
same = left // 2
print(max, same)


(a, b) = map(int, input().split(' '))
c = min(a, b)
d = max(a, b)
print(c, int((d - c) / 2))


(r, b) = map(int, input().split())
if b > r:
	print(r, end=' ')
	print((b - r) // 2)
else:
	print(b, end=' ')
	print((r - b) // 2)


(r, b) = list(map(int, input().split(' ')))
mn = min(r, b)
mx = max(r, b)
print(mn, (mx - mn) // 2)


(a, b) = map(int, input().split())
ans1 = max(a, b)
ans2 = min(a, b)
print(ans2)
print((ans1 - ans2) // 2)


(red, blue) = map(int, input().split(' '))
daysFashion = 0
daysSimple = 0
compare = 0
while True:
	if red == 0 or blue == 0:
		compare = red + blue
		break
	red -= 1
	blue -= 1
	daysFashion += 1
while True:
	if compare <= 1:
		break
	compare -= 2
	daysSimple += 1
print(daysFashion, daysSimple)


(red, blue) = input().split()
red = int(red)
blue = int(blue)
equal = 0
unequal = 0
if red > 0 and blue > 0:
	if red >= blue:
		unequal += blue
		red -= blue
		blue = 0
	else:
		unequal += red
		blue -= red
		red = 0
if red > 0:
	equal += red // 2
elif blue > 0:
	equal += blue // 2
print(unequal, equal)


(a, b) = map(int, input().split())
c = a + b
count = 0
if a != b:
	m = min(a, b)
	count1 = m
	c = c - 2 * m
	count2 = int(c / 2)
	print(count1, count2)
else:
	print(a, 0)


(a, b) = map(int, input().split(' '))
c = min(a, b)
d = abs(int((a - b) / 2))
print(c, d)


(a, b) = [int(x) for x in input().split()]
if a > b:
	print(b, int((a - b) / 2))
else:
	print(a, int((b - a) / 2))


(a, b) = map(int, input().split())
if a < b:
	c = a
	d = (b - a) // 2
else:
	c = b
	d = (a - b) // 2
print(c, d)


import time
(a, b) = (int(i) for i in input().split())
start = time.time()
m = min(a, b)
a = divmod(a - m, 2)[0]
b = divmod(b - m, 2)[0]
print(m, a + b)
finish = time.time()


(a, b) = map(int, input().split())
color = 0
while a > 0 and b > 0:
	color += 1
	a -= 1
	b -= 1
if a > 0:
	print(str(color) + ' ' + str(a // 2))
elif b > 0:
	print(str(color) + ' ' + str(b // 2))
else:
	print(str(color) + ' 0')


(n, m) = map(int, input().split())
a = min(n, m)
b = max(n, m)
c = int((b - a) / 2)
print(a, c)


(a, b) = map(int, input().strip().split())
if a < b:
	print(a, (b - a) // 2)
else:
	print(b, (a - b) // 2)


(a, b) = map(int, input().split())
različite = min(a, b)
o = abs(a - b)
iste = o // 2
print(različite, iste)


(a, b) = map(int, input().split())
minn = min(a, b)
maxx = max(a, b)
ans = (maxx - minn) // 2
print(minn, ans)


(a, b) = map(int, input().split(' '))
print(min(a, b), (max(a, b) - min(a, b)) // 2)


(a, b) = list(map(int, input().split(' ')))
dif = min(a, b)
a -= dif
b -= dif
rest = max(a, b) // 2
print(f'{dif} {rest}')


def srt(x, y):
	if x >= y:
		return (x, y)
	else:
		return (y, x)
(a, b) = map(int, input().split())
(a, b) = srt(a, b)
days = b
a -= b
days2 = 0
while True:
	if a <= 0:
		break
	else:
		a -= 2
		if a < 0:
			break
		else:
			days2 += 1
print(days, days2, sep=' ')


(a, b) = list(map(int, input().split()))
k = 0
while a > 0 and b > 0:
	k += 1
	a -= 1
	b -= 1
print(k, (a + b) // 2)


a = [int(i) for i in input().split()]
z = a[0]
zz = a[1]
d = min(a)
for i in range(2):
	a[i] = a[i] - d
print(d, max(a) // 2, end=' ')


(a, b) = map(int, input().split(' '))
answer = []
small = min(a, b)
answer.append(str(small))
large = max(a, b)
large -= small
answer.append(str(int(large / 2)))
print(' '.join(answer))


(a, b) = input().split()
(a, b) = (int(a), int(b))
dif_socks = 0
if a > b:
	dif_socks = b
elif a == b:
	dif_socks = a
else:
	dif_socks = a
same_socks = 0
if dif_socks == b and dif_socks != a:
	x = a - b
	same_socks = int(x // 2)
elif dif_socks == a and dif_socks != b:
	x = b - a
	same_socks = int(x // 2)
else:
	same_socks = 0
print(f'{dif_socks} {same_socks}')


(r, b) = map(int, input().split(' '))
(z, b1) = (0, 0)
if r < b:
	r1 = 0
	b1 = b - r
	print(r, b1 // 2)
elif r > b:
	b1 = 0
	r1 = r - b
	print(b, r1 // 2)
else:
	print(r, 0)


stuff = input().split()
a = int(stuff[0])
b = int(stuff[1])
maxNum = min(a, b)
daysLeft = (max(a, b) - min(a, b)) // 2
print(str(maxNum) + ' ' + str(daysLeft))


(a, b) = map(int, input().split())
fashion = min(a, b)
normal = (max(a, b) - fashion) // 2
print(fashion, end=' ')
print(normal)


(a, b) = map(int, input().split())
s = min(a, b)
p = abs(a - b) // 2
print(s, p)


temp = input().split()
a = int(temp[0])
b = int(temp[1])
max_num = a
min_num = a
if max_num < b:
	max_num = b
if min_num > b:
	min_num = b
total = max_num - min_num
print(min_num, int(total / 2))


(a, b) = map(int, input().split())
x = min(a, b)
y = (a + b - 2 * x) // 2
print(x, y)


(a, b) = map(int, input().split())
print(min(a, b), ' ', abs(a - b) // 2)


(a, b) = map(int, input().split())
mi = min(a, b)
ma = max(a, b) - mi
print(mi, end=' ')
print(ma // 2)


(a, b) = map(int, input().split())
c1 = c2 = 0
while a > 0 and b > 0:
	c1 += 1
	a -= 1
	b -= 1
while b > 1:
	c2 += 1
	b -= 2
while a > 1:
	c2 += 1
	a -= 2
print(c1, c2)


socks = sorted(list(map(int, input().split())))
print(socks[0], (socks[1] - socks[0]) // 2, sep=' ')


(a, b) = input().split()
a = int(a)
b = int(b)
if a < b:
	m = a
	n = (b - a) // 2
	print(m, n)
elif a > b:
	m = b
	n = (a - b) // 2
	print(m, n)
elif a == b:
	print(a, 0)


(a, b) = [int(x) for x in input().split()]
diff = 0
same = 0
while a and b:
	if a >= 1 and b >= 1:
		a -= 1
		b -= 1
		diff += 1
same = abs(a + b) / 2
print(int(diff), int(same))


(a, b) = list(map(int, input().split(' ')))
p = min((a, b))
q = (max((a, b)) - min((a, b))) // 2
print(f'{p} {q}')


(r, b) = map(int, input().split())
can = 0
cant = 0
if r > b:
	while b > 0:
		b -= 1
		r -= 1
		can += 1
	while r > 1:
		r -= 2
		cant += 1
elif r < b:
	while r > 0:
		r -= 1
		b -= 1
		can += 1
	while b > 1:
		b -= 2
		cant += 1
else:
	while r > 0:
		r -= 1
		can += 1
print(can, cant)


(a, b) = sorted(list((int(x) for x in input().split())))
print(a, (b - a) // 2)


(a, b) = map(int, input().split())
e = min(a, b)
x = abs(a - b) // 2
print(e, x)


(red, blue) = input().split()
lst = sorted([int(red), int(blue)])
left = lst[-1] - lst[0]
print(lst[0], left // 2)


arr = list(map(int, input().strip().split(' ')))
arop = []
arr.sort()
if arr[0] != arr[1]:
	arop.append(str(int(arr[0])))
	x = arr[1] - arr[0]
	if x > 1:
		arop.append(str(int(x / 2)))
	else:
		arop.append('0')
	print(' '.join(arop))
else:
	print(str(arr[0]) + ' ' + '0')


(a, b) = [int(x) for x in input().split()]
print(str(min(a, b)) + ' ' + str(abs(a - b) // 2))


import math
x = [int(i) for i in input().split()]
x.sort()
print(str(x[0]) + ' ' + str(math.floor((x[1] - x[0]) / 2)))


(a, b) = map(int, input().split())
d = min(a, b)
s = max(a, b) - d
print(d, s // 2)


(red_socks, blue_socks) = map(int, input().split())
multicolor_socks = min(red_socks, blue_socks)
one_color_socks = (max(red_socks, blue_socks) - min(red_socks, blue_socks)) // 2
print(multicolor_socks, one_color_socks)


(a, b) = map(int, input().split())
c = min(a, b)
f = max((a - min(a, b)) / 2, (b - min(a, b)) / 2)
f = int(f)
print(c, f)


(a, b) = map(int, input().split())
min1 = min(a, b)
max1 = max(a, b)
num = max1 - min1
num2 = num // 2
print(min1, num2)


(r, b) = [int(x) for x in input().split()]
a = max(r, b)
c = min(r, b)
print(c, int((a - c) / 2))


line = input().split()
a = int(line[0])
b = int(line[1])
N1 = min(a, b)
N2 = abs(a - b) // 2
print(N1, N2, sep=' ')


(a, b) = [int(i) for i in input().split()]
if a > b:
	(a, b) = (b, a)
print(a, end=' ')
b -= a
print(b // 2)


from math import floor
(a, b) = map(int, input().split())
c = max(a, b)
d = min(a, b)
e = c - d
f = int(floor(e / 2))
print(d, f)


from math import floor
(a, b) = map(int, input().split())
print(min(a, b), floor(abs(a - b) / 2))


(a, b) = map(int, input().split())
z = min(a, b)
s = max(a, b)
v = (s - z) // 2
print(z, v)


arr = list(map(int, input().split()))
count1 = 0
count2 = 0
while arr[0] > 0 and arr[1] > 0:
	count1 += 1
	arr[0] -= 1
	arr[1] -= 1
if arr[0] != 0:
	count2 = arr[0] // 2
else:
	count2 = arr[1] // 2
print(count1, count2)


b = input()
a = b.split()
h = []
for i in a:
	h.append(int(i))
d = sorted(h)
m = d[0]
k = (d[1] - d[0]) // 2
print(m, k)


from math import *
(a, b) = list(map(int, input().split()))
count = 0
if a == b:
	print(a, 0)
elif a > b:
	count = b
	a = floor((a - b) / 2)
	print(count, a)
else:
	count = a
	b = floor((b - a) / 2)
	print(count, b)


def socks(a, b):
	c = min(a, b)
	print(c, end=' ')
	d = max(a, b)
	d = d - c
	e = int(d / 2)
	print(e)
(a, b) = map(int, input().split())
socks(a, b)


(a, b) = list(map(int, input().split()))
first = min(a, b)
leftover = a + b - 2 * first
second = leftover // 2
print(first, second)


(a, b) = map(int, input().split())
if a == b:
	print(a, 0)
elif a < b or b < a:
	print(min(a, b), (max(a, b) - min(a, b)) // 2)


(nr, nb) = [int(nr) for nr in input().split()]
diff = abs(nr - nb)
print(min(nr, nb), diff // 2)


var = input()
(a, b) = var.split()
a = int(a)
b = int(b)
minim = min(a, b)
a = a - minim
b = b - minim
print(minim, int(max(a, b) / 2))


(a, b) = list(map(int, input().split()))
min = min(a, b)
sub = abs(a - b)
rem = int(sub / 2)
print(min, rem)


inp = input
li = list
iinp = lambda : int(inp())
ent = lambda : map(int, inp().split())
lient = lambda : [int(i) for i in inp().split()]
li0 = lambda x: [0 for i in range(x)]
(a, b) = ent()
par = impar = 0
par = min(a, b)
impar = (max(a, b) - par) // 2
print('%i %i' % (par, impar))


(a, b) = map(int, input().split())
time = int(a + b)
cool = int(0)
stoopid = int(0)
for x in range(time):
	if a >= 1 and b >= 1:
		a = a - 1
		b = b - 1
		cool = cool + 1
	elif a > b and a >= 2:
		a = a - 2
		stoopid = stoopid + 1
	elif a < b and b >= 2:
		b = b - 2
		stoopid = stoopid + 1
print(cool, stoopid)


(x, y) = input().split()
x = int(x)
y = int(y)
c = min(x, y)
x = x - c
y = y - c
d = max(x, y)
e = d // 2
print(c, e)


inputs = list(map(int, input().split()))
a = inputs[0]
b = inputs[1]
if a > b:
	(a, b) = (b, a)
b = (b - a) / 2
print(int(a), int(b))


(a, b) = map(int, input().split())
if a < b:
	temp = b - a
	print(a, temp // 2)
elif b < a:
	temp = a - b
	print(b, temp // 2)
elif a == b:
	print(a, 0)


def solve_a():
	(a, b) = list(map(int, input().split()))
	res_a = min(a, b)
	res_b = (max(a, b) - min(a, b)) // 2
	print(res_a, res_b)
solve_a()


inputs = input().split(' ')
outputs = []
for i in range(len(inputs)):
	inputs[i] = int(inputs[i])
	outputs.append(0)
m = max(inputs[0], inputs[1])
for i in range(m):
	if inputs[0] > 0 and inputs[1] > 0:
		inputs[0] -= 1
		inputs[1] -= 1
		outputs[0] += 1
	elif inputs[0] >= 2:
		inputs[0] -= 2
		outputs[1] += 1
	elif inputs[1] >= 2:
		inputs[1] -= 2
		outputs[1] += 1
print(str(outputs[0]) + ' ' + str(outputs[1]))


__author__ = 'Utena'
(a, b) = map(int, input().split())
print('%d %d' % (min(a, b), (a + b) // 2 - min(a, b)))


socks = input().split(' ')
small = min(int(socks[0]), int(socks[1]))
big = max(int(socks[0]), int(socks[1]))
print(str(small) + ' ' + str((big - small) // 2))


(red, blue) = input().split(' ')
red = int(red)
blue = int(blue)
left_days = 0
paired = 0
while True:
	if red == 0 or blue == 0:
		break
	red -= 1
	blue -= 1
	paired += 1
if red == 0:
	left_days = int(blue / 2)
if blue == 0:
	left_days = int(red / 2)
print(str(paired) + ' ' + str(left_days))


(a, b) = map(int, input().split())
pairs = min(a, b)
days = (max(a, b) - pairs) // 2
print(pairs, days)


(a, b) = input().split(' ')
a = int(a)
b = int(b)
days1 = 0
while a > 0 and b > 0:
	days1 += 1
	a -= 1
	b -= 1
days2 = 0
if a > 0:
	days2 = a // 2
elif b > 0:
	days2 = b // 2
print(days1, days2, sep=' ')


(a, b) = map(int, input().split())
diff = 0
same = 0
while min(a, b) > 0:
	a -= 1
	b -= 1
	diff += 1
same = int((a + b) // 2)
print(diff, same)


socks = input('').split()
red = int(socks[0])
blue = int(socks[1])
(fashion, notfashion) = (0, 0)
if red > blue:
	fashion += blue
	red -= blue
	blue = 0
elif blue > red:
	fashion += red
	blue -= red
	red = 0
else:
	fashion += blue
	blue = 0
	red = 0
if blue >= 2:
	notfashion += int(blue / 2)
if red >= 2:
	notfashion += int(red / 2)
print(fashion, notfashion)


from sys import exit
info = input().split()
redsock = int(info[0])
bluesock = int(info[1])
hipsterpairs = 0
regularpairs = 0
if redsock < bluesock:
	hipsterpairs = redsock
	bluesock = bluesock - redsock
	redsock = 0
	regularpairs = bluesock // 2
elif redsock == bluesock:
	print(redsock, 0)
	exit(0)
else:
	hipsterpairs = bluesock
	redsock = redsock - bluesock
	bluesock = 0
	regularpairs = redsock // 2
print(hipsterpairs, regularpairs)


(a, b) = map(int, input().split())
l = min(a, b)
k = (a + b - 2 * l) // 2
print(l, k)


(a, b) = input().split(' ')
n = 0
k = 0
a = int(a)
b = int(b)
s = int(a) + int(b)
for i in range(0, s):
	if a > 0 and b > 0:
		a = a - 1
		b = b - 1
		n = n + 1
	elif a > 0 and b == 0 and (a - 2 >= 0):
		a = a - 2
		k = k + 1
	elif a == 0 and b > 0 and (b - 2 >= 0):
		b = b - 2
		k = k + 1
print(n, k)


c = input().split()
a = int(c[0])
b = int(c[1])
different = 0
while a > 0 and b > 0:
	a -= 1
	b -= 1
	different += 1
same = (a + b) // 2
print(different, same)


(a, b) = map(int, input().split())
if a < b:
	print(a, end=' ')
	b -= a
	if b == 0 or b == 1:
		print(0)
	else:
		print(round((b - b % 2) / 2))
else:
	print(b, end=' ')
	a -= b
	if a == 0 or a == 1:
		print(0)
	else:
		print(round((a - a % 2) / 2))


z = [int(s) for s in input().split()]
(a, b) = (z[0], z[1])
if a > b:
	print(b, (a - b) // 2)
elif a < b:
	print(a, (b - a) // 2)
elif a == b:
	print(a, 0)


import math
(a, b) = input().split(' ')
(a, b) = (int(a), int(b))
diff_color_days = min(a, b)
same_color = math.floor((max(a, b) - diff_color_days) / 2)
print(diff_color_days, same_color)


(a, b) = map(int, input().split())
if a >= b:
	k = b
	m = (a - b) // 2
elif a < b:
	k = a
	m = (b - a) // 2
print(k, m)


(x, y) = [int(x) for x in input().split()]
if x < y:
	print(x, end='  ')
	if (y - x) % 2 == 0 or y - x > 2:
		print((y - x) // 2)
	else:
		print('0')
elif x > y:
	print(y, end='  ')
	if (x - y) % 2 == 0 or x - y > 2:
		print((x - y) // 2)
	else:
		print('0')
else:
	print(x, ' 0')


(a, b) = list(map(int, input().split()))
n = 0
m = min(a, b)
if a > b:
	n = (a - m) // 2
elif a < b:
	n = (b - m) // 2
else:
	n = 0
print(m, n)


(a, b) = map(int, input().split())
day_fashion = min(a, b)
day_same = (max(a, b) - min(a, b)) // 2
print(day_fashion, day_same)


a = [eval(i) for i in input().split()]
print(min(a), (max(a) - min(a)) // 2)


inf = list(map(int, input().split()))
h = max(inf)
l = min(inf)
p = l
q = int((h - l) / 2)
print(p, q)


(a, b) = list(map(int, input().split()))
print(min(a, b), (a - min(a, b)) // 2 + (b - min(a, b)) // 2)


def Socks(a, b):
	if a > b:
		res = b
		res1 = (a - b) // 2
	elif b > a:
		res = a
		res1 = (b - a) // 2
	else:
		res = a
		res1 = 0
	st = '' + str(res) + ' ' + str(res1)
	return st
(a, b) = input().split()
print(Socks(int(a), int(b)))


(r, b) = map(int, input().split())
dif_pa = min(r, b)
sam_pa = (max(r, b) - dif_pa) // 2
print(dif_pa, sam_pa)


l = list(map(int, input().split()))
r = l[0]
b = l[1]
count = 0
while r != 0 and b != 0:
	r -= 1
	b -= 1
	count += 1
print(count, (r + b) // 2)


[print(min(a[0], a[1]), abs(a[0] - a[1]) // 2) for a in [[int(x) for x in input().split()]]]


(r, b) = map(int, input().split())
m = min(r, b)
r -= m
b -= m
n = max(r, b) // 2
print(m, n)


(a, b) = input().split()
(a, b) = (int(a), int(b))
q = min(a, b)
if a > b:
	w = abs(a - q)
	w = w / 2
	w = int(w)
elif b > a:
	w = abs(b - q)
	w = w / 2
	w = int(w)
elif a == b:
	q = a
	w = 0
print(q, w)


(a, b) = map(int, input().split())
total = 0
c = min(a, b)
a = a - c
b = b - c
total += a // 2 + b // 2
print(c, total)


import sys
import math
(a, b) = map(int, input().split())
print(min(a, b), (max(a, b) - min(a, b)) // 2)


inp = input().split()
inp = list(map(int, inp))
mi = min(inp)
ma = max(inp)
m = (ma - mi) // 2
print(mi, m, sep=' ')


(a, b) = map(int, input().split())
A = min(a, b)
B = int((max(a, b) - min(a, b)) / 2)
print(A, B)


__author__ = 'User'
(a, b) = list(map(int, input().split()))
mx = min(a, b)
s = a + b - mx * 2
print(mx, s // 2)


(a, b) = input().split()
a = int(a)
b = int(b)
if a > b:
	print(b, end=' ')
	print((a - b) // 2)
else:
	print(a, end=' ')
	print((b - a) // 2)


(n, m) = map(int, input().split())
print(min(m, n), abs(m - n) // 2)


(a, b) = map(int, input().split())
diff_socks = 0
same_socks = 0
if a <= b:
	diff_socks = a
	same_socks = (b - a) // 2
else:
	diff_socks = b
	same_socks = (a - b) // 2
print(str(diff_socks) + ' ' + str(same_socks))


line = input().split()
a = int(line[0])
b = int(line[1])
x = min(a, b)
y = abs(a - b) // 2
print(x, y)


(a, b) = map(int, input().split())
y = a + b - abs(a - b)
x = abs(a - b)
print(y // 2, x // 2)


(a, b) = map(int, input().split())
if a == b:
	print(a, '0')
else:
	c = min(a, b)
	d = max(a, b)
	e = d - c
	f = e / 2
	if e == 1:
		print(c, '0')
	else:
		print(c, int(f))


(a, b) = sorted(map(int, input().split()))
print(a, (b - a) // 2)


(a, b) = [int(i) for i in input().split()]
c = min(a, b)
print(c, end=' ')
d = (max(a, b) - min(a, b)) // 2
print(d)


(a, b) = map(int, input().split())
print(min(a, b), end=' ')
c = max(a, b) - min(a, b)
print(c // 2)


(a, b) = map(int, input().split())
p = min(a, b)
left = (max(a, b) - p) // 2
print(p, left)


(r, b) = map(int, input().split())
print(min(r, b), (max(r, b) - min(r, b)) // 2)


(a, b) = sorted([int(i) for i in input().split()])
print(a, (b - a) // 2)


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

def ri(t=int):
	return t(input())

def cd(it):
	ret_val = dict()
	for v in it:
		ret_val[v] = ret_val.get(v, 0) + 1
	return ret_val
(a, b) = r()
if a > b:
	(a, b) = (b, a)
print(a, (b - a) // 2)


(a, b) = map(int, input().split())
k = min(a, b)
t = (max(a, b) - k) // 2
print(k, t)


(a, b) = [int(i) for i in input().split()]
mi = min(a, b)
ma = max(a, b)
if mi == ma:
	print(mi, 0)
else:
	m = ma - mi
	print(mi, m // 2)


(red, blue) = map(int, input().split())
r = max(red, blue)
b = min(red, blue)
res1 = b
r -= b
res2 = int(r / 2)
print(res1, res2)


(a, b) = input().split()
a = int(a)
b = int(b)
if a >= b:
	y = (a - b) // 2
	print(b, y)
else:
	y = (b - a) // 2
	print(a, y)


lt = list(map(int, input().split()))
maxlt = max(lt)
minlt = min(lt)
if (maxlt - minlt) % 2 == 0:
	print(minlt, int((maxlt - minlt) / 2))
else:
	print(minlt, int((maxlt - minlt - 1) / 2))


s = input().split()
red = int(s[0])
blue = int(s[1])
final = []
if red >= blue:
	final.append(str(blue))
	y = red - blue
else:
	final.append(str(red))
	y = blue - red
final.append(str(y // 2))
print(' '.join(final))


def main():
	from sys import stdin, stdout
	(a, b) = map(int, stdin.readline().split())
	stdout.write(str(min(a, b)) + ' ' + str(abs(b - a) // 2))
main()


(a, b) = map(int, input().split())
if a < b:
	print(a, (b - a) // 2)
elif a > b:
	print(b, (a - b) // 2)
else:
	print(a, 0)


(a, b) = map(int, input().split())
s_count = 0
d_count = 0
if a >= b:
	s_count = b
	a -= b
	if a > 1:
		d_count = a // 2
elif b > a:
	s_count = a
	b -= a
	if b > 1:
		d_count = b // 2
print(s_count, d_count)


(n, m) = input().split()
n1 = int(n)
m1 = int(m)
a = min(n1, m1)
b = (max(n1, m1) - a) // 2
print(a, b)


(red, blue) = map(int, input().split())
extra = abs(red - blue)
print((red + blue - extra) // 2, extra // 2)


(r, b) = map(int, input().split())
a = min(r, b)
r = r - a
b = b - a
b = (r + b) // 2
print(a, b)


(r, b) = [int(i) for i in input().split(' ')]
same = 0
if r < b:
	diff_socks = r
	same = b - diff_socks
else:
	diff_socks = b
	same = r - diff_socks
while same % 2 != 0 and same > 0:
	same -= 1
print(diff_socks, same // 2)


(a, b) = map(int, input().split())
m = min(a, b)
if a == b:
	m = a
while True:
	a -= m
	b -= m
	if a > 0 or b > 0:
		ma = max(a, b)
		ma = ma // 2
		break
	else:
		ma = 0
		break
print(m, ma)


in1 = input('').split(' ')
red = int(in1[0])
blue = int(in1[1])
diff_count = 0
while red > 0 and blue > 0:
	red -= 1
	blue -= 1
	diff_count += 1
same_count = 0
while red >= 0 and red - 2 >= 0:
	red -= 2
	same_count += 1
while blue >= 0 and blue - 2 >= 0:
	blue -= 2
	same_count += 1
print(diff_count, ' ', same_count)


import math
(a, b) = map(int, input().split(' '))
print('{0} {1}'.format(min(a, b), math.floor(abs(a - b) / 2)))


socks = list(map(int, input().split(' ')))
if socks[0] <= socks[1]:
	print(socks[0], end=' ')
else:
	print(socks[1], end=' ')
print(abs(socks[0] - socks[1]) // 2)


import math
(m, n) = map(int, input().split())
if m < n:
	(m, n) = (n, m)
fashion = n
old = math.floor((m - n) / 2)
print(fashion, old)


(a, b) = input().split()
a = int(a)
b = int(b)
if a > b:
	loser = int((a - b) / 2)
	print(b, loser)
if a < b:
	loser = int((b - a) / 2)
	print(a, loser)
if a == b:
	print(b, 0)


l = list(map(int, input().split()))
a = max(l)
b = min(l)
if a == b:
	print(a, end=' ')
	print(0)
else:
	print(b, end=' ')
	u = a - b
	if u >= 2:
		print(int(u // 2))
	else:
		print(0)


(a, b) = map(int, input().split())
diff = min(a, b)
same = (max(a, b) - diff) // 2
print(diff, same)


list1 = list(map(int, input().split()))
l = max(list1)
m = min(list1)
a = l - m
print(m, end=' ')
print(a // 2)


(num_a, num_b) = [int(a) for a in input().split()]
bigger = num_a if num_a > num_b else num_b
lesser = num_b if bigger == num_a else num_a
fashionable_days = lesser
bigger -= lesser
non_fashionable_days = bigger // 2
print(f'{fashionable_days} {non_fashionable_days}')


(n, m) = sorted(map(int, input().split()))
m = (m - n) // 2
print(n, m)


def main():
	(a, b) = tuple(map(int, input().rstrip().split()))
	print(min(a, b), abs(a - b) // 2)
main()


(x, y) = map(int, input().split())
n = min(x, y)
s = n
p = x + y - 2 * n
d = int(p / 2)
print(s, d)


i = input
l = [*map(int, i().split())]
a = [0, 0]
if l[0] > l[1]:
	a[0] = l[1]
	a[1] = (l[0] - l[1]) // 2
elif l[0] < l[1]:
	a[0] = l[0]
	a[1] = (l[1] - l[0]) // 2
else:
	a[0] = l[0]
print(*a, sep=' ')


(a, b) = input().split()
a = int(a)
b = int(b)
m = min(a, b)
if m == a:
	print(f'{m} {(b - m) // 2}')
else:
	print(f'{m} {(a - m) // 2}')


l = [int(i) for i in input().split()]
print(str(min(l)) + ' ' + str((max(l) - min(l)) // 2))


(a, b) = map(int, input().split())
maxdiff = min(a, b)
left = max(a, b) - maxdiff
maxsin = left // 2
print(maxdiff, maxsin)


(n, m) = [int(i) for i in input().split()]
l = 0
if m == n:
	print('%d %d' % (m, 0))
else:
	k = min(n, m)
	h = max(n, m)
	l = (h - k) // 2
	print('%d %d' % (k, l))


(a, b) = map(int, input().split())
l = 0
r = 0
if a < b:
	l = a
	b -= a
	a = 0
elif a > b:
	l = b
	a -= b
	b = 0
else:
	l = a
	a = 0
	b = 0
while True:
	if a == 0:
		if b <= 0:
			break
		elif b % 2 == 0:
			r += 1
			b -= 2
		elif b % 2 == 1:
			b -= 1
	elif b == 0:
		if a <= 0:
			break
		elif a % 2 == 0:
			r += 1
			a -= 2
		elif a % 2 == 1:
			a -= 1
print(l, r)


(red, blue) = [int(x) for x in input().split()]
first_answer = min(red, blue)
second_answer = (max(red, blue) - first_answer) // 2
print(f'{first_answer} {second_answer}')


(a, b) = map(int, input().split(' '))
mi = min(a, b)
a = a - mi
b = b - mi
print(mi, (a + b) // 2)


def socks(a, b):
	diff = min(a, b)
	same = max(a, b) - diff
	print(str(diff) + ' ' + str(same // 2))
(a, b) = map(int, input().split(' '))
socks(a, b)


(a, b) = list(map(int, input().split()))
sol = []
v1 = 0
v2 = 0
if b < a:
	sol.append(b)
	v1 = a - b
	v2 = int(v1 / 2)
	sol.append(v2)
elif a < b:
	sol.append(a)
	v1 = b - a
	v2 = int(v1 / 2)
	sol.append(v2)
else:
	sol.append(a)
	sol.append(0)
print(*sol, sep=' ')


import math
(r, b) = [int(i) for i in input().split()]
n1 = min(r, b)
maxi = max(r, b)
last = maxi - n1
n2 = math.floor(last / 2)
print('%d %d' % (n1, n2))


(a, b) = input().split()
a = int(a)
b = int(b)
days1 = 0
days2 = 0
while a > 0 and b > 0:
	a -= 1
	b -= 1
	days1 += 1
while a > 1 or b > 1:
	a -= 2
	b -= 2
	days2 += 1
print(days1, days2)


(red_socks, blue_socks) = map(int, input().split())
different_socks = min(red_socks, blue_socks)
print(different_socks, int((red_socks + blue_socks - different_socks * 2) / 2))


def smaller(x, y):
	if x < y:
		return x
	return y
(A, B) = map(int, input().split())
ans1 = smaller(A, B)
A -= ans1
B -= ans1
ans2 = A // 2 + B // 2
print(str(ans1) + ' ' + str(ans2))


(a, b) = [int(x) for x in input().split()]
k = min(a, b)
l = (max(a, b) - min(a, b)) // 2
print(str(k) + ' ' + str(l))


z = str(input()).split()
red = int(z[0])
blue = int(z[1])
print(min(red, blue), (blue + red) // 2 - min(red, blue))


(n, m) = map(int, input().split())
a = min(n, m)
n -= a
m -= a
print(str(a) + ' ' + str(max(n, m) // 2))


(m, n) = input().split()
n = int(n)
m = int(m)
if n > m:
	(n, m) = (m, n)
print(n, int((m - n) // 2))


(n, m) = map(int, input().split())
k = 0
x = 0
if n >= m:
	x = n - m
	k = m
else:
	x = m - n
	k = n
print(k, x // 2)


(a, b) = map(int, input().split())
aa = a
bb = b
ans = 0
ans += min(aa, bb)
print(ans, end=' ')
aa -= ans
bb -= ans
print(max(aa // 2, bb // 2))


from math import *
(a, b) = input().split()
a = int(a)
b = int(b)
f = (max(a, b) - min(a, b)) // 2
c = min(a, b)
print(c, f)


import math
from collections import *
import sys
from functools import reduce

def get_ints():
	return map(int, input().strip().split())

def get_list():
	return list(get_ints())

def get_string():
	return list(input().strip().split())

def printxsp(*args):
	return print(*args, end='')

def printsp(*args):
	return print(*args, end=' ')
UGLYMOD = int(1000000000.0) + 7
SEXYMOD = 998244353
MAXN = int(100000.0)
(n, m) = get_ints()
a = min(n, m)
b = n + m - 2 * a
print(a, b // 2)


p = input('')
s = p.split(' ')
x = int(s[0])
y = int(s[1])
if x > y:
	print(y)
	x = x - y
	print(int(x / 2))
else:
	print(x)
	y = y - x
	print(int(y / 2))


(a, b) = map(int, input().split())
r1 = min(a, b)
(a, b) = (a - r1, b - r1)
print(r1, a // 2 + b // 2)


(a, b) = list(map(int, input().split()))
kj = max(a, b) - min(a, b) // 2
print(str(min(a, b)) + ' ' + str((max(a, b) - min(a, b)) // 2))


(a, b) = map(int, input().split())
if a < b:
	print(a % b, end=' ')
elif a > b:
	print(b % a, end=' ')
else:
	print(a, end=' ')
print(abs(a - b) // 2)


def socks(a, b):
	diff = 0
	same = 0
	if a == b:
		diff = a
	elif a > b:
		diff = b
		same = (a - b) // 2
	elif b > a:
		diff = a
		same = (b - a) // 2
	print(diff, same)
list1 = [int(i) for i in input().split()]
socks(list1[0], list1[1])


ab = [int(x) for x in input().split()]
first = min(ab)
second = sum([(x - first) // 2 for x in ab])
print(first, second)


n = input()
(a, b) = n.split()
if int(a) >= int(b):
	c = int(b)
	d = (int(a) - int(b)) // 2
	print(str(c) + ' ' + str(d))
else:
	c = int(a)
	d = (int(b) - int(a)) // 2
	print(str(c) + ' ' + str(d))


(a, b) = map(int, input().split())
value1 = 0
value2 = 0
if b > a:
	value1 = a
	value2 = int((b - a) / 2)
elif a > b:
	value1 = b
	value2 = int((a - b) / 2)
else:
	value1 = a
	value2 = 0
print(str(value1) + ' ' + str(value2))


(a, b) = list(map(int, input().split()))
dp = min(a, b)
dt = 0
l = max(a, b) - dp
if l % 2 == 0:
	dt = round(l / 2)
elif l > 2:
	l -= 1
	dt = round(l / 2)
print(dp, dt)


n = list(map(int, input().split()))
a = (n[0] + n[1] - 2 * min(n[0], n[1])) // 2
print(min(n[0], n[1]), a)


(n, m) = map(int, input().strip().split())
print(min(n, m), end=' ')
print(int((max(n, m) - min(n, m)) / 2))


line = [int(i) for i in input().split()]
a = line[0]
b = line[1]
c = min(a, b)
remain = (a + b - 2 * c) // 2
print(c, remain)


(x, y) = map(int, input().split())
if x < y:
	print(x, (y - x) // 2)
else:
	print(y, (x - y) // 2)


ln = input().split(' ')
for i in range(2):
	ln[i] = int(ln[i])
mn = min(ln)
rem = max(ln) - mn
print(str(mn) + ' ' + str(rem // 2))


(r, b) = map(int, input().split())
t = 0
z = 0
while r > 0 and b > 0:
	t += 1
	r -= 1
	b -= 1
z += r // 2 + b // 2
print(t, z)


a = input()
a = a.split()
b = list()
for x in a:
	b.append(int(x))
d = 0
s = 0
while b[0] > 0 and b[1] > 0:
	b[0] -= 1
	b[1] -= 1
	d += 1
while b[0] > 1 or b[1] > 1:
	if b[0] > 1:
		b[0] -= 2
		s += 1
	elif b[1] > 1:
		b[1] -= 2
		s += 1
d = str(d)
s = str(s)
print(d + ' ' + s)


import sys
(a, b) = [int(x) for x in sys.stdin.readline().rstrip().split()]
diff = min(a, b)
if a == diff:
	same = (b - diff) // 2
else:
	same = (a - diff) // 2
print('%d %d' % (diff, same))


(s, k) = map(int, input().split())
print(min(s, k), (max(s, k) - min(s, k)) // 2)


x = input().split()
a = int(x[0])
b = int(x[1])
c = min(a, b)
d = (max(a, b) - c) // 2
print(c, d)


(a, b) = map(int, input().split())
fashion = min(a, b)
after_that = (a + b) // 2 - fashion
print(fashion, after_that)


(r, b) = list(map(int, input().split()))
t = r + b
m = 0
n = 0
while t != 0:
	if t == 1:
		break
	if r > 0 and b > 0:
		r = r - 1
		b = b - 1
		m = m + 1
		t = t - 2
	elif r > 1 and b == 0 or (b > 1 and r == 0):
		n = n + 1
		t = t - 2
print(m, n)


(a, b) = [int(i) for i in input().split()]
res = 0
while a > 0 and b > 0:
	res += 1
	a -= 1
	b -= 1
extra = (a + b) // 2
print(str(res) + ' ' + str(extra))


(red, blue) = map(int, input().split())
hipster = min(red, blue)
uncool = abs(red - blue) // 2
print(hipster, uncool)


def program(n):
	diff = 0
	while True:
		if n[0] and n[1]:
			diff += 1
			n[0] -= 1
			n[1] -= 1
		else:
			break
	maximum = max(n)
	if maximum % 2 != 0:
		maximum -= 1
	same = int(maximum // 2)
	return (diff, same)
n = list(map(int, input().strip().split()))
print(' '.join(map(str, program(n))))


(a, b) = map(int, input().split())
hb = 0
hs = 0
while a != 0 and b != 0:
	a -= 1
	b -= 1
	hb += 1
	if a == 0 or b == 0:
		break
if a == 0:
	while b > 1:
		b -= 2
		hs += 1
		if b < 2:
			break
elif b == 0:
	while a > 1:
		a -= 2
		hs += 1
		if a < 2:
			break
print(hb, hs)


(x, y) = map(int, input().split())
sameDays = 0
diffDays = 0
if x > y:
	sameDays = x - y
	diffDays = x - sameDays
	print(diffDays, sameDays // 2, end=' ')
elif x < y:
	sameDays = y - x
	diffDays = y - sameDays
	print(diffDays, sameDays // 2, end=' ')
else:
	print(x, 0)


socks = sorted(map(int, input().split()))
print(socks[0], (socks[1] - socks[0]) // 2)


import math
(red, blue) = [int(i) for i in input().split()]
diff = min(red, blue)
res = max(red - diff, blue - diff)
same = math.floor(res / 2)
print('{} {}'.format(diff, same))


(m, n) = map(int, input().split())
(l, k) = (max(m, n), min(m, n))
l = l - k
print(k, l // 2)


(a, b) = [int(x) for x in input().split()]
if a >= b:
	k = a - b
	print(b, end=' ')
	print(int(k / 2))
if b > a:
	k = b - a
	print(a, end=' ')
	print(int(k / 2))


def main():
	(a, b) = map(int, input().split())
	(a, b) = (max(a, b), min(a, b))
	c = (a - b) // 2
	print(b, c)
main()


(r, b) = list(map(int, input().split()))
fd = min(r, b)
rest = (max(r, b) - min(r, b)) // 2
print(fd, rest)


import math
n = input()
n = n.split()
m = int(n[0])
n = int(n[1])
k = m * (m <= n) + n * (m > n)
d = m - k + (n - k)
print(k, math.floor(d / 2))


def differentSock(red, blue):
	return min(red, blue)

def sameSock(red, blue):
	return (max(red, blue) - differentSock(red, blue)) // 2
(red, blue) = map(int, input().split(' '))
print(differentSock(red, blue), ' ', sameSock(red, blue))


socks = list(map(int, input().strip().split()))
hip = min(socks)
maximum = max(socks)
maximum -= hip
maximum //= 2
print(hip, maximum)


import math
(a, b) = [int(i) for i in input().split()]
x = min(a, b)
y = math.floor((a + b) / 2) - x
print(x, y)


(a, b) = [int(x) for x in input().split()]
mini = min(a, b)
maxi = max(a, b)
x = (maxi - mini) // 2
print(mini, x)


i = input()
li = list(i.split(' '))
li = [int(y) for y in li]
a = li[0]
b = li[1]
c = int(0)
d = int(0)
if a > b:
	d = b
	if (a - b) % 2 == 0:
		c = (a - b) // 2
	else:
		c = (a - b - 1) // 2
		if c < 0:
			c = 0
if b > a:
	d = a
	if (b - a) % 2 == 0:
		c = (b - a) // 2
	else:
		c = (b - a - 1) // 2
		if c < 0:
			c = 0
if b == a:
	d = (a + b) // 2
print(d, c)


L = list(map(int, input().split()))
L.sort()
x = 0
y = 0
while L[0] != 0 and L[1] != 0:
	x += 1
	L[0] -= 1
	L[1] -= 1
L.remove(0)
y = L[0] // 2
print(x, y)


(a, b) = input().split()
(a, b) = (int(a), int(b))
print(min(a, b), end=' ')
print(int((max(a, b) - min(a, b)) / 2))


(x, y) = map(int, input().split())
print(min(x, y), abs(x - y) // 2)


(a, b) = [int(i) for i in input().split()]
d1 = min(a, b)
if a > b:
	d2 = int((a - b) / 2)
else:
	d2 = int((b - a) / 2)
print(d1, d2)


(r, b) = list(map(int, input().split()))
if r > b:
	print(b, (r - b) // 2)
elif r < b:
	print(r, (b - r) // 2)
else:
	print(r, b - r)


(nr, nb) = map(int, input().split())
ds = 0
ss = 0
if nr == nb:
	ds = nr
	ss = 0
elif nb > nr:
	n1b = nb - nr
	ds = nr
	ss = n1b // 2
elif nr > nb:
	n1r = nr - nb
	ds = nb
	ss = n1r // 2
print(ds, ss)


(a, b) = map(int, input().split())
if a > b:
	rem = a - b
	diff = b
	same = rem // 2
	print(diff, same)
else:
	rem = b - a
	diff = a
	same = rem // 2
	print(diff, same)


q = list(map(int, input().split()))
print(min(q), int((max(q) - min(q)) / 2))


(n, m) = map(int, input().split())
print(min(m, n), (max(m, n) - min(n, m)) // 2)


(a, b) = map(int, input().split())
diff_days = min(a, b)
same_days = (max(a, b) - diff_days) // 2
print(str(diff_days) + ' ' + str(same_days))


(a, b) = [int(i) for i in input().split()]
c = 0
fashion = 0
pairs = 0
d = 0
if a > b:
	c = b
	d = a
elif b >= a:
	c = a
	d = b
fashion += c
d -= c
pairs += d // 2
print(fashion, pairs)


(n, v) = map(int, input().split())
print(min(n, v), (n - min(n, v)) // 2 + (v - min(n, v)) // 2)


(a, b) = map(int, input().split())
e = abs(a - b)
d = (a + b - e) // 2
c = e // 2
print(d, c)


(r, b) = [int(x) for x in input().split()]
print(min(r, b), end=' ')
print((max(r, b) - min(r, b)) // 2)


l = list(map(int, input().split()))
(a, b) = l
t = min(l)
x = sum(l)
p = x - t * 2
print(t, p // 2)


import math
(a, b) = map(int, input().split())
x = min(a, b)
y = abs(a - b) // 2
print(x, y)


(r, b) = map(int, input().split())
print(str(min(r, b)) + ' ' + str(abs(r - b) // 2))


a = list(map(int, input().split()))
p = a[0]
q = [1]
yo = min(a)
ro = max(a) - min(a)
roro = ro // 2
print(yo, roro)


(a, b) = map(int, input().split())
if (a >= 1 and a <= 100) and (b >= 1 and b <= 100):
	if a > b:
		diff = b
		same = (a - b) // 2
	else:
		diff = a
		same = (b - a) // 2
print(diff, same)


import math
n = input().split()
r = int(n[0])
b = int(n[1])
a = max(r, b)
c = min(r, b)
ans = math.floor((a - c) / 2)
c = str(c)
ans = str(ans)
print(c + ' ' + ans)


(m, n) = map(int, input().split())
k = l = 0
if m >= n:
	k = n
	l = m
else:
	k = m
	l = n
print(k, end=' ')
print((l - k) // 2)


(a, b) = map(int, input().split())
(m, m1) = (0, 0)
if a > b:
	m = b
else:
	m = a
k = abs(a - b)
m1 = k // 2
print(m, m1)


(int1, int2) = map(int, input().split(' '))
out1 = min(int1, int2)
out2 = (max(int1, int2) - min(int1, int2)) // 2
print(f'{out1} {out2}')


(red, blue) = map(int, input().split())
ret = red
plue = blue
if blue <= red:
	firstvar = blue
	colours = ret - plue
	secondvar = int(colours / 2)
elif red <= blue:
	firstvar = red
	colours = plue - ret
	secondvar = int(colours / 2)
print(firstvar, secondvar)


(z, zz) = (input, lambda : list(map(int, z().split())))
zzz = lambda : [int(i) for i in stdin.readline().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
from math import *
num = 1
for i in range(num):
	(a, b) = zz()
	print(min(a, b), (max(a, b) - min(a, b)) // 2)


(a, b) = [int(num) for num in input().split()]
print(min(a, b), (max(a, b) - min(a, b)) // 2)


(a, b) = map(int, input().split())
x = min(a, b)
a -= x
b -= x
if a == 0 and b == 0:
	print(str(x) + ' ' + str(0))
elif a == 0:
	print(str(x) + ' ' + str(b // 2))
else:
	print(str(x) + ' ' + str(a // 2))


(a, b) = [int(i) for i in input().split()]
x = min(a, b)
y = (max(a, b) - min(a, b)) // 2
print(x, y)


(a, b) = [int(elem) for elem in input().split()]
(a, b) = (max(a, b), min(a, b))
print(b, (a - b) // 2)


(a, b) = [int(i) for i in input().split()]
DFRT = min(a, b)
SAME = int(abs(a - b) / 2)
print(DFRT, SAME)


p = list(map(int, input().split()))
a = min(p)
c = max(p)
print(a, (c - a) // 2)


(n, k) = map(int, input().split())
print(min(n, k), end=' ')
if n >= k:
	n = n - k
	n //= 2
	print(n)
else:
	k -= n
	k //= 2
	print(k)


(a, b) = [int(i) for i in input().split()]
one_color_left = False
s = 0
while not one_color_left:
	if a <= 0 or b <= 0:
		one_color_left = True
	else:
		s += 1
		a -= 1
		b -= 1
socks_left = max(a, b)
print(s, socks_left // 2 if socks_left >= 2 else 0)


(a, b) = input().split()
a = int(a)
b = int(b)
if a // b > 0:
	print(b, (a - b) // 2)
else:
	print(a, (b - a) // 2)


l = list(map(int, input().split(' ')))
print(min(l), (max(l) - min(l)) // 2)


try:
	(a, b) = list(map(int, input().split()))
	w = min(a, b)
	c = max(a, b) - min(a, b)
	d = c // 2
	print(w, d)
except:
	pass


a = [int(i) for i in input().split()]
print(min(a), (max(a) - min(a)) // 2)


import sys
import math
input = sys.stdin.readline

def inp():
	return int(input())

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
(a, b) = invr()
print(min(a, b), abs(a - b) // 2)


string = input()
ls = list(map(int, string.split(' ')))
print(min(ls), int((max(ls) - min(ls)) / 2))


inp = input().split()
x = 0
y = 0
if int(inp[0]) > int(inp[1]):
	x = inp[1]
	y = (int(inp[0]) - int(inp[1])) // 2
elif int(inp[0]) == int(inp[1]):
	x = inp[0]
	y = 0
else:
	x = inp[0]
	y = (int(inp[1]) - int(inp[0])) // 2
print(str(x) + ' ' + str(y))


(m, n) = map(int, input().split())
a = min(m, n)
b = abs(m - n) // 2
print(a, b)


(a, b) = tuple(map(int, input().split()))
ans = []
if a > b:
	ans.append(b)
	ans.append((a - b) // 2)
else:
	ans.append(a)
	ans.append((b - a) // 2)
print(*ans)


input = list(map(int, input().split()))
if input[0] > input[1]:
	max = input[0]
	min = input[1]
else:
	min = input[0]
	max = input[1]
reminder = int((max - min) / 2)
print(min, reminder)


X = input().split(' ')
A = int(X[0])
B = int(X[1])
C1 = 0
C2 = 0
while min(A, B) > 0:
	A -= 1
	B -= 1
	C1 += 1
if B == 0:
	C2 = A // 2
else:
	C2 = B // 2
print(C1, C2)


(a, b) = map(int, input().split())
dCounterDifferentSocks = 0
dCounterSameSocks = 0
while a > 0 and b > 0:
	a -= 1
	b -= 1
	dCounterDifferentSocks += 1
while a > 1 or b > 1:
	if a > 1:
		a -= 2
	else:
		b -= 2
	dCounterSameSocks += 1
print(dCounterDifferentSocks, dCounterSameSocks)


s = input().split()
(a, b) = (int(s[0]), int(s[1]))
hip = max(a, b) - min(a, b)
print(min(a, b), hip // 2)


def solve(a, b):
	x = min([a, b])
	y = int((max([a, b]) - x) / 2)
	return ' '.join([str(x), str(y)])
(a, b) = input().split(' ')
print(solve(int(a), int(b)))


(red, blue) = map(int, input().split())
moda = min(red, blue)
red -= moda
blue -= moda
after = max(red, blue) // 2
print(moda, after)


from sys import stdin
minn = 0
same = 0
a = [int(x) for x in stdin.readline().split()]
minn = min(a[0], a[1])
same = abs(a[0] - a[1]) // 2
print(minn, end=' ')
print(same, end='')


details = input()
a = int(details.split()[0])
b = int(details.split()[1])
if a % 2 == 0 and b % 2 == 0:
	if a == b:
		p = a
		r = 0
	elif a > b:
		p = b
		r = (a - b) // 2
	elif b > a:
		p = a
		r = (b - a) // 2
elif a % 2 == 1 and b % 2 == 0:
	if a > b:
		p = b
		r = (a - b) // 2
	elif b > a:
		p = a
		r = (b - a) // 2
elif (a == 0 and b != 0) and (a != 0 and b == 0):
	p = 0
	r = abs(a - b) // 2
elif a % 2 == 0 and b % 2 == 1:
	if a > b:
		p = b
		r = (a - b) // 2
	elif b > a:
		p = a
		r = (b - a) // 2
elif a % 2 == 1 and b % 2 == 1:
	if a > b:
		p = b
		r = (a - b) // 2
	elif b > a:
		p = a
		r = (b - a) // 2
	elif a == b:
		p = a
		r = 0
print(p, r)


(a, b) = map(int, input().split())
if a < b:
	d = a
	b = b - a
	s = b // 2
	print(d, s)
elif a > b:
	d = b
	a = a - b
	s = a // 2
	print(d, s)
elif a == b:
	print(a, 0)


import math
socks = input().split(' ')
print(f'{min(int(socks[0]), int(socks[1]))} {math.floor(abs(int(socks[0]) - int(socks[1])) / 2)}')


(a, b) = map(int, input().split())
mn = min(a, b)
mx = max(a, b)
print(mn, (mx - mn) // 2)


(a, b) = map(int, input().split())
r = min(a, b)
a = a - r
b = b - r
t = int(a / 2 + b / 2)
print(r, end=' ')
print(t)


(red, blue) = map(int, input().split())
print(min(red, blue), abs(red - blue) // 2)


(r, b) = map(int, input().split())
if r > b:
	a = b
	c = (r - b) // 2
else:
	a = r
	c = (b - a) // 2
print(a, c)


socks = [int(i) for i in input().split()]
a = min(socks)
b = max(socks) - min(socks)
if b % 2 == 0:
	c = int(b / 2)
else:
	c = int((b - 1) / 2)
print(a, c)


l = input().split()
red = int(l[0])
blue = int(l[1])
if red > blue:
	first = blue
	second = (red - blue) // 2
	print(first, second)
elif blue > red:
	first = red
	second = (blue - red) // 2
	print(first, second)
else:
	print(red, 0)


inp = input().split()
mx = max(int(inp[0]), int(inp[1]))
mn = min(int(inp[0]), int(inp[1]))
t = mx - mn
if t % 2 == 0:
	print(mn, int(t / 2))
else:
	print(mn, int((t - 1) / 2))


(n, m) = map(int, input().strip().split())
dif = min(n, m)
same = (max(m, n) - min(m, n)) // 2
print(dif, same)


(red, blue) = [int(val) for val in input().split()]
print('%d %d' % (min(red, blue), abs(red - blue) // 2))


x = list(map(int, input().split()))
if x[0] > x[1]:
	s = (x[0] - x[1]) // 2
	print(x[1], s)
elif x[0] < x[1]:
	s = (x[1] - x[0]) // 2
	print(x[0], s)
elif x[0] == x[1]:
	print(x[0], 0)


s = input().split()
a = int(s[0])
b = int(s[1])
c = 0
d = 0
while a > 0 and b > 0:
	a -= 1
	b -= 1
	c += 1
while a > 1 or b > 1:
	if a > b:
		a -= 2
	else:
		b -= 2
	d += 1
print(c, d)


no_of_socks = list((int(x) for x in input().split()))
red = no_of_socks[0]
blue = no_of_socks[1]
print(min(red, blue), end=' ')
print(abs(red - blue) // 2)


(a, b) = map(int, input().split())
m = min(a, b)
a -= m
b -= m
if a > b:
	n = a // 2
else:
	n = b // 2
print(m, end=' ')
print(n)


(a, b) = map(int, input().split())
c = min(a, b)
x = (a + b - 2 * c) // 2
print(c, x)


(a, b) = input().split()
a = int(a)
b = int(b)
daysdif = min(a, b)
dayssame = (max(a, b) - min(a, b)) // 2
print(daysdif, dayssame)


(a, b) = [int(x) for x in input().split(' ')]
x = 0
y = 0
for i in range(a + b):
	if b > 0 and a > 0:
		a = a - 1
		b = b - 1
		x = x + 1
	elif b == 0:
		if a == 1:
			a = a - 1
		elif a > 0:
			a = a - 2
			y = y + 1
	elif a == 0:
		if b == 1:
			b = b - 1
		elif b > 0:
			b = b - 2
			y = y + 1
	elif a == 0 and b == 0:
		break
print(x, end=' ')
print(y)


(a, b) = input().split()
a = int(a)
b = int(b)
if a > b:
	k = a - b
	l = k // 2
	print(b, l)
else:
	k = b - a
	l = k // 2
	print(a, l)


n = input().split()
a = int(n[0])
b = int(n[1])
c = a - b
d = b - a
if a >= b:
	print(a - c, c // 2)
else:
	print(b - d, d // 2)


(red, blue) = map(int, input().split())
diff = min(red, blue)
same = (max(red, blue) - diff) // 2
print(diff, same)


(a, b) = map(int, input().split())
output = [None, None]
output[0] = min(a, b)
(a, b) = (a - min(a, b), b - min(a, b))
c = max(a, b)
output[1] = c // 2
print(' '.join([str(ele) for ele in output]))


import sys
input = sys.stdin.readline
(a, b) = map(int, input().split())
ans1 = min(a, b)
print(ans1, end=' ')
a -= ans1
b -= ans1
print(max(a, b) // 2)


(x, y) = input().split()
x = int(x)
y = int(y)
m = 0
s = 0
if y > x:
	m = x
	s = int((y - m) / 2)
else:
	m = y
	s = int((x - m) / 2)
print('%s %d' % (m, s))


(a, b) = map(int, input().split())
ans1 = min(a, b)
if a > b:
	c = a - b
	ans2 = c // 2
else:
	c = b - a
	ans2 = c // 2
print(ans1, ans2)


(a, b) = [int(i) for i in input().split()]
fashion_days = min(a, b)
left = max(a - b, b - a)
common_days = left // 2
print(fashion_days, common_days)


a = list(map(int, input().split()))
print(f'{min(a)} {(max(a) - min(a)) // 2}')


(p, q) = map(int, input().split()[:2])
if p == q:
	print(p, 0)
else:
	m = min(p, q)
	if p > q:
		t = (p - m) // 2
	else:
		t = (q - m) // 2
	print(m, t)


(a, b) = [int(x) for x in input().split()]
d = max(a, b)
x = min(a, b)
print(x, (d - x) // 2)


a = input()
b = a.split()
a1 = int(b[0])
a2 = int(b[1])
if a1 > a2:
	result = a2
else:
	result = a1
difference = int((a1 - a2) / 2)
if difference < 0:
	difference = -difference
else:
	difference = difference
print(result, difference)


(a, b) = input().split()
a = int(a)
b = int(b)
if a > b:
	n = b
	a = a - b
	m = int(a / 2)
else:
	n = a
	b = b - a
	m = int(b / 2)
print(n, m)


(n, m) = map(int, input().split())
if n == m:
	print(n, 0)
elif n > m:
	print(m, int((n - m) / 2))
elif m > n:
	print(n, int((m - n) / 2))


(a, b) = input().split()
a = int(a)
b = int(b)
fashion = min(a, b)
if a >= b:
	d = (a - b) // 2
else:
	d = (b - a) // 2
print(fashion, d)


lst = [int(k) for k in input().split(' ')]
print(str(min(lst[0], lst[1])) + ' ' + str((max(lst[0], lst[1]) - min(lst[0], lst[1])) // 2))


import sys
from sys import stdin, stdout
(a, b) = [int(x) for x in stdin.readline().rstrip().split()]
print(str(min(a, b)) + ' ' + str(int((max(a, b) - min(a, b)) / 2)))


(a, b) = [int(x) for x in input().split()]
if a == b:
	ms = a
if a > b:
	ms = b
	r = a - b
else:
	ms = a
	r = b - a
days = r / 2
print(ms, int(days))


(r, b) = map(int, input().split())
m = min(r, b)
s = max(r - m, b - m) // 2
print(m, ' ', s)


(a, b) = map(int, input().split(' '))
diff = 0
same = 0
if a >= 1 and a <= 100 and (b >= 1) and (b <= 100):
	remain = max(a, b) - min(a, b)
	same = remain // 2
	diff = min(a, b)
print(diff, same)


nums = [int(nums) for nums in input().split()]
red = nums[0]
blue = nums[1]
diff_socks = min(nums)
same_socks = int(abs(red - blue) / 2)
print(diff_socks, same_socks)


(a, b) = map(int, input().split())
minn = min(a, b)
maxx = max(a, b)
nonhip = abs(a - b) // 2
print(minn, nonhip)


(a, b) = [int(i) for i in input().split()]
different = min(a, b)
a -= different
b -= different
same = max(a, b)
print(different, same // 2)


a = input()
b = a.split()
print(min(int(b[0]), int(b[1])), (max(int(b[0]), int(b[1])) - min(int(b[0]), int(b[1]))) // 2)


(red, blue) = map(int, input().split())
dif = min((red, blue))
b = max((red, blue))
print(dif, (b - dif) // 2)


from math import floor
(red_socks, blue_socks) = list(map(int, input().split()))
num_alternate_socks = min(red_socks, blue_socks)
num_same_color = floor((max(red_socks, blue_socks) - num_alternate_socks) / 2)
print(num_alternate_socks, num_same_color)


(a, b) = map(int, input().split())
h = max(a, b)
l = min(a, b)
print(l, (h - l) // 2)


(a, b) = map(int, input().split())
c = abs(a - b)
if c % 2 == 0:
	print('{0} {1}'.format(min(a, b), c // 2))
else:
	print('{0} {1}'.format(min(a, b), c // 2))


(a, b) = map(int, input().split())
minsock = 0
maxsock = 0
left = 0
if a > b:
	minsock = b
	left = a - b
else:
	minsock = a
	left = b - a
left = left // 2
print(minsock, end=' ')
print(left)


(red, blue) = str.split(input(), sep=' ')
red = int(red)
blue = int(blue)
a = min(red, blue)
b = max(red, blue)
print(a, (b - a) // 2)


(a, b) = map(int, input().split())
X = min(a, b)
a = max(0, a - X)
b = max(0, b - X)
Y = a // 2 + b // 2
print(str(X) + ' ' + str(Y))


(n, m) = map(int, input().split())
different = 0
same = 0
while n > 0 and m > 0:
	n -= 1
	m -= 1
	different += 1
if n == 0 and m >= 2:
	for i in range(m // 2):
		m /= 2
		same += 1
elif m == 0 and n >= 2:
	for i in range(n // 2):
		n /= 2
		same += 1
print(different, same)


socks = list(map(int, input().split()))
different = min(socks)
same = (max(socks) - different) // 2
print(different, same)


(a, b) = map(int, input().split())
big = max(a, b)
small = a + b - big
print(small, (big - small) // 2)


z = input().split()
a = int(z[0])
b = int(z[1])
print(str(min(a, b)) + ' ' + str((max(a, b) - min(a, b)) // 2))


(a, b) = map(int, input().split())
A = max(a, b)
B = min(a, b)
if A == B:
	print(A, 0)
else:
	print(B, (A - B) // 2)


import math
import collections
import bisect

def arrPrint(a):
	return ' '.join([str(i) for i in a])

def gridPrint(a):
	return '\n'.join([' '.join([str(j) for j in a[i]]) for i in range(len(a))])

def isPalindrome(s):
	for i in range(len(s) // 2):
		if not s[i] == s[-i - 1]:
			return False
	return True

def solve(a, b):
	return arrPrint([min(a, b), (max(a, b) - min(a, b)) // 2])
(a, b) = list(map(int, input().split()))
result = solve(a, b)
print(result)


(r, b) = map(int, input().split(' '))
dd = min(r, b)
if r == dd:
	ds = (b - dd) // 2
elif b == dd:
	ds = (r - dd) // 2
else:
	ds = 0
print(dd, ds)


l = [int(x) for x in input().split()]
m = [x - min(l) for x in l]
print(min(l), end=' ')
print(sum(m) // 2)


(r, b) = map(int, input().split())
if r > b:
	print(b, (r - b) // 2)
if r < b:
	print(r, (b - r) // 2)
if r == b:
	print(r, 0)


(k, s) = map(int, input().split())
print(min(k, s), abs(k - s) // 2)


(cervenych, modrych) = map(int, input().split())
roznych = min(cervenych, modrych)
rovnakych = (max(cervenych, modrych) - roznych) // 2
print(roznych, rovnakych)


socks = input().split(' ')
red_socks = int(socks[0])
blue_socks = int(socks[1])
if red_socks < blue_socks:
	number_of_different_pairs = red_socks
	number_of_same_pairs = (blue_socks - red_socks) / 2
else:
	number_of_different_pairs = blue_socks
	number_of_same_pairs = (red_socks - blue_socks) / 2
print(number_of_different_pairs, int(number_of_same_pairs))


(n, m) = map(int, input().split(' '))
a = 0
if n >= m:
	a = m
else:
	a = n
b = (max(n, m) - a) // 2
print(f'{a} {b}')


from typing import List, Tuple

def parse_input() -> List[int]:
	return [int(x) for x in input().split()]

def solve(a: int, b: int) -> Tuple[int, int]:
	fashion_count = min(a, b)
	a -= fashion_count
	b -= fashion_count
	return (fashion_count, (a + b) // 2)
(a, b) = parse_input()
print(' '.join((str(x) for x in solve(a, b))))


a = [int(x) for x in input().split()]
m = min(a)
el = (a[0] + a[1]) // 2 - m
print(m, el)


(a, b) = [int(i) for i in input().split()]
if a > b:
	c = b
	d = (a - b) // 2
else:
	c = a
	d = (b - a) // 2
print(c, d)


(a, b) = list(map(int, input().split()))
differentSocksDays = min(a, b)
sameSocksDays = (max(a, b) - differentSocksDays) // 2
print(differentSocksDays, sameSocksDays)


socks = [*map(int, input().split())]
fashionable_days = min(socks)
non_fashionable_days = (sum(socks) - min(socks) * 2) // 2
print(str(fashionable_days) + ' ' + str(non_fashionable_days))


(m, n) = [int(i) for i in input().split()]
a = min(m, n)
b = (max(m, n) - min(m, n)) // 2
print(a, b)


(red, blue) = map(int, input().split())
print(min(red, blue), (max(red, blue) - min(red, blue)) // 2, end=' ')


n = list(map(int, input().split()))
print(min(n), int((max(n) - min(n)) / 2), sep=' ')


def func(a, b):
	print(min(a, b), (max(a, b) - min(a, b)) // 2, sep=' ')
(a, b) = map(int, input().split())
func(a, b)


(a, b) = map(int, input().split())
drazn = min(a, b)
dodin = (max(a, b) - drazn) // 2
print(drazn, dodin)


(a, b) = [int(j) for j in input().split()]
print(min(a, b), (max(a, b) - min(a, b)) // 2, sep=' ')


a = list(map(int, input().split()))
print(str(min(a[0], a[1])) + ' ' + str((max(a[0], a[1]) - min(a[0], a[1])) // 2))


from math import floor

def trial():
	(a, b) = list(map(int, input().split()))
	counter = int(floor(abs(a - b) / 2))
	return print(min([a, b]), counter)
trial()


(n, m) = map(int, input().split(' '))
b = []
s = (n + m - abs(n - m)) // 2
b.append(s)
b.append((n + m - s * 2) // 2)
print(' '.join([str(e) for e in b]))


(a, b) = [int(i) for i in input().split()]
day1 = 0
day2 = 0
while min(a, b) > 0:
	day1 += 1
	a -= 1
	b -= 1
day2 = max(a // 2, b // 2)
print(day1, day2)


(a, b) = map(int, input().split())
s = min(a, b)
a1 = a - s
b1 = b - s
s1 = max(a1, b1)
s1 = s1 // 2
print(s, s1)


isDebug = False
x = input().split(' ')
x = [int(i) for i in x]
a = x[0] if x[0] < x[1] else x[1]
b = x[1] if x[0] == a else x[0]
print(f'a={a}, b={b}') if isDebug else ''
print(f'{a} {int((b - a) / 2)}')


line = [int(k) for k in input().split()]
a = line[0]
b = line[1]
maximum = max(a, b)
minimum = min(a, b)
c = (maximum - minimum) // 2
print(minimum, c)


(a, b) = map(int, input().split())
k = 0
ma = max(a, b)
mi = min(a, b)
for i in range(mi):
	mi -= 1
	ma -= 1
	k += 1
	if mi == 0:
		break
print(k, ma // 2)


(r, b) = map(int, input().split())
styleday = 0
normday = 0
while r > 0 and b > 0:
	styleday += 1
	r -= 1
	b -= 1
if r > 0:
	normday = r // 2
else:
	normday = b // 2
print(styleday, normday)


import sys

def main():
	(a, b) = map(int, input().split())
	if a > b:
		dif_color = b
		a -= b
		one_color = int(a / 2)
	else:
		dif_color = a
		b -= a
		one_color = int(b / 2)
	print(dif_color, one_color)
	return
sys.exit(main())


(x, y) = input().split(' ')
d = [int(x), int(y)]
dif = max(d) - min(d)
print(min(d), end=' ')
if dif % 2 == 0:
	print(int(dif / 2))
else:
	print(int((dif - 1) / 2))


(red, blue) = [int(x) for x in input().split()]
m = min(red, blue)
red -= m
blue -= m
n = (red + blue) // 2
print(m, ' ', n)


n = list(map(int, input().split()))
if n[0] > n[1]:
	smaller = n[1]
	larger = n[0]
else:
	smaller = n[0]
	larger = n[1]
print(smaller, end=' ')
print((larger - smaller) // 2)


y = list(map(int, input().split()))
if y[0] > y[1]:
	print(y[1], (y[0] - y[1]) // 2)
else:
	print(y[0], (y[1] - y[0]) // 2)


(a, b) = map(int, input().strip().split())
ans1 = min((a, b))
a -= ans1
b -= ans1
ans2 = a // 2 + b // 2
print(ans1, ans2)


l = list(input().split())
a = []
for i in range(2):
	a.append(int(l[i]))
result = (max(a) - min(a)) // 2
print(min(a), end=' ')
print(result)


(a, b) = input().split()
a = int(a)
b = int(b)
l = 0
k = 0
if a >= b:
	l = a - b
	if l % 2 == 1:
		l = l - 1
		k = l // 2
	else:
		k = l // 2
	print(b, k)
else:
	l = b - a
	if l % 2 == 1:
		l = l - 1
		k = l // 2
	else:
		k = l // 2
	print(a, k)


x = input().split()
a = int(x[0])
b = int(x[1])
if a <= b:
	print(str(a) + ' ' + str((b - a) // 2))
else:
	print(str(b) + ' ' + str((a - b) // 2))


z = input().split()
t = int(z[0])
n = int(z[1])
k = min(t, n)
a = int((t + n - 2 * k) / 2)
print(k, a)


(a, b) = list(map(int, input().split()))
d = min(a, b)
e = (max(a, b) - d) // 2
print(d, e)


sock = [eval(i) for i in input().split()]
print(min(sock), (max(sock) - min(sock)) // 2)


(a, b) = map(int, input().split())
c = min(a, b)
e = max(a, b)
print(c, int((e - c) / 2))


(a, b) = [int(i) for i in input().split()]
import math
c = min(a, b)
d = math.floor(abs(a - b) / 2)
print('{:d} {:d}'.format(c, d))


(a, b) = input().split()
a = int(a)
b = int(b)
if a > b:
	c = b
	a = a - b
	k = a // 2
else:
	c = a
	b = b - a
	k = b // 2
print(c, k)


l = list(map(int, input().split()))
a = min(l[0], l[1])
b = int(abs(l[0] - l[1]) / 2)
print(a, b, end=' ')


def main():
	(red, blue) = [int(i) for i in input().split(' ')]
	xxx = max(red, blue) - min(red, blue)
	_ = min(red, blue)
	print(_, xxx // 2)
main()


(a, b) = map(int, input().split())
sum = a + b
temp = min(a, b)
sum -= 2 * temp
sum //= 2
print(str(temp) + ' ' + str(sum), end='')


x = input().split()
a = int(x[0])
b = int(x[1])
s = []
s.append(a)
s.append(b)
s.sort()
n = str(s[0])
o = s[1]
k = int(o) - int(n)
m = k // 2
y = str(m)
f = []
f.append(n)
f.append(y)
print(' '.join(f))


import math

def BuubleSort(a, b):
	(mini, maxi) = (a, b) if a < b else (b, a)
	return (mini, (maxi - mini) // 2)

def main():
	(a, b) = map(int, input().split())
	(ans1, ans2) = BuubleSort(a, b)
	print(ans1, ans2)
main()


(a, b) = input().split()
if int(a) < int(b):
	c = a
	d = b
else:
	c = b
	d = a
z = 0
for x in range(int(c), int(d)):
	z += 1
z = z // 2
print(c, z)


(a, b) = [int(i) for i in input().split()]
fashion = 0
normal = 0
if a > b:
	fashion += b
	a -= b
	b = 0
	normal += a // 2
else:
	fashion += a
	b -= a
	a = 0
	normal += b // 2
print(fashion, normal)


(x, y) = map(int, input().split())
z = min(x, y)
print(z, (x - z) // 2 + (y - z) // 2)


def vasya(a, b):
	if a == b:
		return (a, 0)
	elif a < b:
		return (a, (b - a - (b - a) % 2) // 2)
	elif a > b:
		return (b, (a - b - (a - b) % 2) // 2)
(A, B) = [int(i) for i in input().split()]
print(*vasya(A, B))


def vasyaTheHipster():
	values = input().split()
	a = int(values[0])
	b = int(values[1])
	minValue = min(a, b)
	later = (max(a, b) - minValue) // 2
	print(minValue, later)
vasyaTheHipster()


(r, b) = [int(x) for x in input().strip().split(' ')]
print(min(r, b), int(abs(r - b) / 2))


(a, b) = map(int, input().split())
if a == b:
	diff = a
	same = 0
elif a > b:
	diff = a - (a - b)
	same = (a - diff) // 2
elif b > a:
	diff = b - (b - a)
	same = (b - diff) // 2
print(diff, same, sep=' ')


(a, b) = tuple(map(int, input().split()))
dif = min(a, b)
on = abs(a - b) // 2
print(dif, on)


(a, b) = map(int, input().split())
if a >= b:
	a -= b
	print(str(b) + ' ' + str(a // 2))
else:
	b -= a
	print(str(a) + ' ' + str(b // 2))


(a, b) = list(map(int, input().split()))
print('{} {}'.format(min(a, b), (max(a, b) - min(a, b)) // 2))


(n1, n2) = map(int, input().split())
if n1 >= n2:
	print('{} {}'.format(n2, (n1 - n2) // 2))
else:
	print('{} {}'.format(n1, (n2 - n1) // 2))


(a, b) = [int(s) for s in input().split()]
fashon = min(a, b)
regular = max(a, b) - fashon
c = 0
while regular > 1:
	regular -= 2
	c += 1
print(fashon, c)


(a, b) = map(int, input().split())
r1 = 0
r2 = 0
if a > b:
	r1 = b
	a -= b
	r2 = a // 2
else:
	r1 = a
	b -= a
	r2 = b // 2
if r2 < 0:
	r2 = 0
print(r1, r2, sep=' ')


(n, m) = input().split()
n = int(n)
m = int(m)
if n == m:
	print(str(n) + ' ' + str(0))
	exit()
if n > m:
	z = int((n - m) / 2)
	print(str(m) + ' ' + str(z))
	exit()
if m > n:
	z = int((m - n) / 2)
	print(str(n) + ' ' + str(z))


x = [int(a) for a in input().split()]
print(min(x), int((max(x) - min(x)) / 2))


inputlist = input().split(' ')
inputlist[0] = int(inputlist[0])
inputlist[1] = int(inputlist[1])
print(str(min(inputlist)) + ' ' + str(int((max(inputlist) - min(inputlist)) / 2)))


(a, b) = map(int, input().split())
m = min(a, b)
s = a + b - 2 * m
l = s // 2
print(m, l)


str1 = input()
a = int(str1.split()[0])
b = int(str1.split()[1])
m = min(a, b)
n = (max(a, b) - min(a, b)) // 2
print(m, n)


inp = input()
lst = list()
for i in inp.split():
	lst.append(int(i))
lst.sort()
diff_aday = lst[0]
same_aday = int((lst[1] - lst[0]) / 2)
print(diff_aday, same_aday)


(a, b) = [int(i) for i in input().split()]
diff_sock_days = 0
same_sock_days = 0
while a != 0 and b != 0:
	diff_sock_days += 1
	a -= 1
	b -= 1
while a >= 2:
	same_sock_days += 1
	a -= 2
while b >= 2:
	same_sock_days += 1
	b -= 2
print(diff_sock_days, same_sock_days)


s = input().split()
a = int(s[0])
b = int(s[1])
k = 0
while a > 0 and b > 0:
	a = a - 1
	b = b - 1
	k = k + 1
if a > b:
	print(k, a // 2)
else:
	print(k, b // 2)


import sys
(b, r) = map(int, input().split())
different = min(b, r)
same = (max(b, r) - different) // 2
print('{} {}'.format(different, same))


[r, b] = [int(x) for x in input().split()]
a = min(r, b)
r = r - a
b = b - a
b = (r + b) // 2
print(f'{a} {b}')


(red, blue) = input().split()
red = int(red)
blue = int(blue)
fashion = min(red, blue)
remain = (max(red, blue) - min(red, blue)) // 2
print('{} {}'.format(fashion, remain))


a = map(int, input().split())
b = list(a)
c = min(b)
d = int(abs(b[0] - b[1]) / 2)
print(c, d)


(kras, sin) = map(int, input().split())
num_1 = 0
num_2 = 0
if 1 <= kras <= 100 and 1 <= sin <= 100:
	while kras != 0 and sin != 0:
		kras -= 1
		sin -= 1
		num_1 += 1
	if kras > 1 and sin == 0:
		num_2 = kras // 2
	if sin > 1 and kras == 0:
		num_2 = sin // 2
print(num_1, num_2)


(a, b) = map(int, input().split())
(diff, same) = (0, 0)
while True:
	if a and b:
		diff += 1
		a -= 1
		b -= 1
	elif a > 1:
		same += 1
		a -= 2
	elif b > 1:
		same += 1
		b -= 2
	else:
		break
print(diff, same)


(a, b) = [int(x) for x in input().split(' ')]
h = min(a, b)
n = (max(a, b) - min(a, b)) // 2
print(h, n)


line = input().split()
a = int(line[0])
b = int(line[1])
x = min(a, b)
y = (max(a, b) - min(a, b)) // 2
print(str(x) + ' ' + str(y))


number = input()
colours = number.split(' ')
red = int(colours[0])
blue = int(colours[1])
mismatched = min(red, blue)
matched = abs(red - blue) // 2
print(mismatched, matched)


import math
(a, b) = [int(x) for x in input().split()]
c = min(a, b)
d = max(a, b)
answer1 = c
answer2 = math.floor((d - c) / 2)
print(str(answer1) + ' ' + str(answer2))


(r, b) = map(int, input().split())
if r > b:
	d = b
	r = r - b
	b = 0
	s = r // 2
	print(d, s)
elif r < b:
	d = r
	b = b - r
	r = 0
	s = b // 2
	print(d, s)
else:
	print(r, 0)


a = list(map(int, input().split()))
k = min(a)
l = (max(a) - min(a)) // 2
print(k, l)


c = input().split()
a = int(c[0])
b = int(c[1])
print(min(a, b), int(max((a - min(a, b)) / 2, (b - min(a, b)) / 2)), sep=' ')


(reds, blues) = map(int, input().split())
fashion = min(reds, blues)
others = (max(reds, blues) - fashion) // 2
print(fashion, others)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

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

def min(a, b):
	if a <= b:
		return a
	return b

def main():
	socks = inlt()
	red = socks[0]
	blue = socks[1]
	diff = min(red, blue)
	rest = int((red + blue - 2 * diff) / 2)
	print(str(diff) + ' ' + str(rest))
main()


(a, b) = map(int, input().split(' '))
x = abs(a - b)
print(max(a, b) - x, x // 2)


__author__ = 'yarsanich'
(a, b) = map(int, input().split())
ans = 0
while a > 0 and b > 0:
	ans += 1
	a -= 1
	b -= 1
l = max(a, b)
ans1 = 0
while l > 0:
	if l - 2 >= 0:
		ans1 += 1
	l -= 2
print(ans, ans1)


def get_sorted_numlist():
	list_in = list(input().split())
	list_out = []
	for k in list_in:
		list_out += [int(k)]
	list_out.sort()
	return list_out

def main():
	list1 = get_sorted_numlist()
	a = str(list1[0])
	b = str(int((list1[1] - list1[0]) / 2))
	print(a + ' ' + b)
main()


(x, y) = map(int, input().split())
(fCount, sCount) = (0, 0)
while x != 0 and y != 0:
	x -= 1
	y -= 1
	fCount += 1
while not max(x, y) <= 1:
	x -= 2
	y -= 2
	sCount += 1
print(fCount, sCount)


x = list(map(int, input().split()))
x.sort()
print(x[0], end=' ')
print(int((x[1] - x[0]) / 2))


(a, b) = [int(i) for i in input().split()]
print(str(min(a, b)) + ' ' + str(int((max(a, b) - min(a, b)) / 2)))


(m, n) = list(map(int, input().split()))
if m > n:
	print(n, end=' ')
	a = m - n
	print(a // 2)
elif n > m:
	print(m, end=' ')
	a = n - m
	print(a // 2)
else:
	print(m, end=' ')
	print(0)


import math
(m, n) = input('').split(' ')
m = int(m)
n = int(n)
if m > n:
	x = n
	y = math.floor((m - n) / 2)
elif n > m:
	x = m
	y = math.floor((n - m) / 2)
else:
	x = m
	y = 0
print(x)
print(y)


(k, n) = map(int, input().split())
if k > n:
	print(n, int((k - n) // 2))
elif k < n:
	print(k, int((n - k) // 2))
else:
	print(n, 0)


(r, a) = list(map(int, input().split()))
if r == a:
	print(r, r - r)
elif r > a:
	print(a, (r - a) // 2)
elif a > r:
	print(r, (a - r) // 2)


(a, b) = map(int, input().split())
a1 = min([a, b])
a2 = max([a, b])
if a2 == 0 or a2 == a1:
	print(str(a1) + ' 0')
elif a2 == a:
	print(str(a1) + ' ' + str((a - b) // 2))
else:
	print(str(a1) + ' ' + str((b - a) // 2))


(a, b) = input().split()
a = int(a)
b = int(b)
lst = [a, b]
lst.sort()
print(lst[0], (lst[1] - lst[0]) // 2)


from sys import stdin
(a, b) = map(int, stdin.readline().rstrip().split())
m = min(a, b)
print(m, (max(a, b) - m) // 2)


RB = [int(i) for i in input().split()]
diff = min(RB)
same = (max(RB) - diff) // 2
print(diff, ' ', same, sep='')


a = input().split()
r = int(a[0])
b = int(a[1])
x = 0
if r > b:
	x = b
else:
	x = r
y = int(abs(r - b) // 2)
print(x, y)


l = list(map(int, input().split()))
l1 = []
count = 0
n = max(l) - min(l)
l1.append(min(l))
while n > 0 and n != 1:
	n = n - 2
	count = count + 1
l1.append(count)
for i in range(len(l1)):
	print(l1[i], end=' ')


A = input()
numlist = A.split(' ')
realnum = [int(i) for i in numlist]
A = min(realnum)
B = 0
for i in realnum:
	if i - A >= 2:
		B = (i - A) // 2
print(A, B)


(a, b) = [int(x) for x in input().split()]
t = [a, b]
t.sort()
t.reverse()
a = t[0]
b = t[1]
c = b
d = (a - b) // 2
print(c, d)


(a, b) = map(int, input().split())
k = min(a, b)
if k == b:
	print(k, (a - k) // 2)
else:
	print(k, (b - k) // 2)


(a, b) = list(map(int, input().strip().split()))
c1 = 0
while a > 0 and b > 0:
	c1 = c1 + 1
	a = a - 1
	b = b - 1
c2 = 0
if a > b:
	c2 = a // 2
else:
	c2 = b // 2
print(c1, c2, end='')


n = list(map(int, input().split(' ')))
print(min(n), end=' ')
print((max(n) - min(n)) // 2)


(reds, blues) = input().split()
reds = int(reds)
blues = int(blues)
n = 0
if reds == blues:
	print(reds, 0)
elif reds < blues:
	blues -= reds
	while blues > 1:
		blues -= 2
		n += 1
	print(reds, n)
elif reds > blues:
	reds -= blues
	while reds > 1:
		reds -= 2
		n += 1
	print(blues, n)


(t, m) = map(int, input().split())
k = min(t, m)
u = (max(t, m) - k) // 2
print(k, u)


(a, b) = input().split()
a = int(a)
b = int(b)
print(f'{min(a, b)} {abs(a - b) // 2}')


import pdb
(r, b) = map(int, input().split())
x = min(r, b)
y = max(r, b)
n = y - x
if n >= 2:
	print(x, n // 2)
else:
	print(x, 0)


aa = input().split()
a = int(aa[0])
b = int(aa[1])
s = min(a, b)
t = int((a + b) / 2) - s
print(s, t)


(a, b) = map(int, input().split())
c = min(a, b)
a -= c
b -= c
print(c, (a + b) // 2, sep=' ')


(n, t) = map(int, input().split(' '))
if n > t:
	temp = n
	n = t
	t = temp
t = (t - n) // 2
print(n, t)


(n, k) = map(int, input().split())
count1 = min(n, k)
count2 = max(n, k) - count1
print(count1, count2 // 2)


(a, b) = map(int, input().split())
a1 = min(a, b)
t = max(a, b)
b1 = (t - a1) // 2
print(a1, b1)


(a, b) = map(int, input().split())
s1 = min(a, b)
(a, b) = (a - min(a, b), b - min(a, b))
s2 = max(a, b) // 2
print(s1, s2)


(a, b) = map(int, input().split())
k = 0
p = 0
while a != 0 and b != 0:
	a = a - 1
	b = b - 1
	k = k + 1
d = a + b
while d > 1:
	d = d - 2
	p = p + 1
print(k, p, end='')


import math
(a, b) = input().split()
(a, b) = (int(a), int(b))
s = ''
if a > b:
	s += str(b) + ' '
	s += str(math.floor((a - b) / 2))
else:
	s += str(a) + ' '
	s += str(math.floor((b - a) / 2))
print(s)


(a, b) = map(int, input().split())
x = 0
if a <= b:
	x = a
else:
	x = b
a -= x
b -= x
y = a // 2 + b // 2
print(x, y)


(a, b) = map(int, input().split())
if a > b:
	first = b
else:
	first = a
if first == a:
	second = int((b - a) / 2)
else:
	second = int((a - b) / 2)
print(first, second)


prim = [int(i) for i in input().split()]
A = min(prim)
B = int((prim[0] + prim[1] - 2 * A) / 2)
print(A, B)


(m, n) = [int(x) for x in input().split()]
a = min(m, n)
b = max(m, n) - a
c = b // 2
print(str(a), str(c))


def Swap(a, b):
	return (b, a)
(a, b) = map(int, input().split())
if a > b:
	(a, b) = Swap(a, b)
print('%d %d' % (a, (b - a) // 2))


(r, b) = [int(i) for i in input().split(' ')]
min_ = min(r, b)
max_ = max(r, b)
print(min_, (max_ - min_) // 2)


(a, b) = list(map(int, input().split()))
if a == 0 or b == 0:
	print('0', end=' ')
	print(a // 2 + b // 2)
else:
	x = min(a, b)
	y = max(a, b)
	print(x, end=' ')
	z = abs(x - y)
	print(z // 2)


(a, b) = map(int, input().split())
mini = min(a, b)
a -= mini
b -= mini
maxi = (a + b) // 2
print(mini, maxi)


[a, b] = list(map(int, input().split()))
ans = [str(min(a, b)), str((a + b - 2 * min(a, b)) // 2)]
print(' '.join(ans))


import math
import os
import random
import re
import sys
(m, n) = map(int, input().rstrip().split())
l = []
a = min(m, n)
b = max(m, n)
l.append(a)
l.append((b - a) // 2)
l1 = [str(x) for x in l]
print(' '.join(l1))


(a, b) = map(int, input().split())
fas = min(a, b)
a -= fas
b -= fas
same = max(a, b) // 2
print(fas, same)


(red, blue) = map(int, input().split(' '))
daysFashion = 0
daysSimple = 0
daysFashion = min(red, blue)
daysSimple = max((red - min(red, blue)) / 2, (blue - min(red, blue)) / 2)
print(daysFashion, int(daysSimple))


(x, y) = map(int, input().split())
if x > y:
	print(y, end=' ')
	s = x - y
	if s > 1:
		print(s // 2, end=' ')
	else:
		print(0, end=' ')
if y > x:
	print(x, end=' ')
	s1 = y - x
	if s1 > 1:
		print(s1 // 2, end=' ')
	else:
		print(0, end=' ')
if x == y:
	print(x, 0)


nos = input()
nos = nos.split(' ')
(nos[0], nos[1]) = (int(nos[0]), int(nos[1]))
days_1clr = (nos[0] + nos[1] - min(nos) * 2) // 2
print(min(nos), days_1clr)


s = input()
s1 = s.split()
n1 = int(s1[0])
n2 = int(s1[1])
if n1 > n2:
	l = n1 - n2
	m = l // 2
	print(n2, m)
elif n2 > n1:
	l = n2 - n1
	m = l // 2
	print(n1, m)
else:
	print(n1, 0)


a = input().split()
b = [int(i) for i in a]
c = min(b[0], b[1])
d = (max(b[0], b[1]) - min(b[0], b[1]) - (max(b[0], b[1]) - min(b[0], b[1])) % 2) / 2
print('%i %i' % (c, d))


(a, b) = map(int, input().split())
if a > b:
	c = a + b - 2 * b
	print(b, end=' ')
else:
	c = a + b - 2 * a
	print(a, end=' ')
print(c // 2)


def __starting_point():
	(r, b) = list(map(int, input().split()))
	if r == b:
		print(r, 0)
	elif r > b:
		dp = b
		sp = (r - b) // 2
		print(dp, sp)
	else:
		dp = r
		sp = (b - r) // 2
		print(dp, sp)
__starting_point()


f = lambda : map(int, input().split())
(a, b) = f()
print(min(a, b), abs(a - b) // 2)


import math
import sys
import string

def ri():
	return input()

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

def li():
	return input().split()

def mi():
	return list(map(int, input().split()))
(a, b) = mi()
ans = min(a, b)
new = a + b - ans * 2
print(ans, new // 2)


(a, b) = (int(x) for x in input().split())
minima = min(a, b)
maxima = max(a, b)
ans = maxima - minima
ans //= 2
print(f'{minima} {ans}')


(n, m) = map(int, input().split())
res = min(n, m)
print(res, end=' ')
if n < m:
	m -= n
	res = m // 2
else:
	n -= m
	res = n // 2
print(res)


(a, b) = map(int, input().split())
(m, n) = (0, 0)
s = min(a, b)
r = max(a, b)
x = r - s
while s != 0:
	m += 1
	s = s - 1
for i in range(x):
	if x % 2 == 0:
		n += 1
	x = x - 1
print(m, n)


(a, b) = list(map(int, input().split(' ')))
count = min(a, b)
other = int(abs(a - b) / int(2))
print(str(count) + ' ' + str(other))


(x, y) = [int(i) for i in input().split()]
ans_1 = 0
ans_2 = 0
if x >= y:
	ans_1 = y
	remaining = x - y
	ans_2 = int(remaining / 2)
	print(ans_1, ans_2)
else:
	ans_1 = x
	remaining = y - x
	ans_2 = int(remaining / 2)
	print(ans_1, ans_2)


(n, m) = list(map(int, input().split()))
k = max(n, m) - min(n, m)
print(min(n, m).__str__() + ' ' + (k // 2).__str__())


(red, blue) = map(int, input().split())
cp = 0
cs = 0
if red > blue:
	(red, blue) = (blue, red)
blue = (blue - red) // 2
print(red, blue)


(a, b) = list(map(int, input().split()))
fd = min(a, b)
rd = (a - fd + b - fd) // 2
print(fd, rd)


socks = list(map(int, input().split(' ')))
socks.sort()
diff = socks[0]
left = socks[1] - socks[0]
same = left // 2
s = str(diff) + ' ' + str(same)
print(s)


(r, b) = map(int, input().split())
c1 = 0
c2 = 0
mn = min(r, b)
mx = max(r, b)
while mn >= 1:
	c1 += 1
	mn -= 1
print(c1, (mx - c1) // 2)


def socks(a, b):
	print(b, end=' ')
	r_d = a - b
	if r_d > 1:
		print(r_d // 2)
	else:
		print('0')
s = [int(a) for a in input().split()]
(a, b) = (s[0], s[1])
if b > a:
	(a, b) = (b, a)
socks(a, b)


n = list(map(int, input().split()))
ret_a = min(n)
for i in n:
	if i - ret_a == 0:
		print(ret_a, (n[1] - ret_a) // 2)
		break
	else:
		print(ret_a, (n[0] - ret_a) // 2)
		break


(a, b) = [int(i) for i in input().split()]
if a > b:
	a = a - b
	c = a // 2
	print(b, c)
elif a == b:
	print(a, 0)
else:
	b = b - a
	c = b // 2
	print(a, c)


(kras, sin) = map(int, input().split())
day2 = 0
if sin > kras:
	day1 = kras
	day2 = (sin - kras) // 2
elif sin < kras:
	day1 = sin
	day2 = (kras - sin) // 2
else:
	day1 = sin
print(day1, day2)


(a, b) = map(int, input().split())
print(min(a, b), end=' ')
d = max(a, b) - min(a, b)
print(d // 2)


(a, b) = map(int, input().split())
k1 = k2 = 0
while a > 0 or b > 0:
	k1 += 1
	a -= 1
	b -= 1
	if a == 0:
		break
	if b == 0:
		break
if a == 0:
	while b > 1:
		b -= 2
		k2 += 1
else:
	while a > 1:
		a -= 2
		k2 += 1
print(k1, k2)


first = list(map(int, input().split()))
a = first[0]
b = first[1]
Min = min(first)
if Min == a:
	x = int(abs(Min - b) / 2)
else:
	x = int(abs(Min - a) / 2)
print(Min, x)


(r, b) = map(int, input().split())
countdiff = 0
countsame = 0
while r > 0 and b > 0:
	r -= 1
	b -= 1
	countdiff += 1
	if r > 1 and b == 0:
		countsame += r // 2
	elif b > 1 and r == 0:
		countsame += b // 2
print(countdiff, countsame)


(a, b) = map(int, input().split())
f = 0
if b <= a:
	f = b
else:
	f = a
d = abs(b - a) // 2
print(f, d)


f = 0
s = 0
(a, b) = map(int, input().split())
while a != 0 and b != 0:
	s += 1
	a -= 1
	b -= 1
if a + b > 1:
	f = f + (a + b) // 2
print(s, f)


import sys
numbers = list(map(int, input().split()))
n_count_1 = min(numbers)
n_count_2 = (max(numbers) - n_count_1) // 2
answer = str(n_count_1) + ' ' + str(n_count_2)
print(answer)


(red, blue) = [int(x) for x in input().split(' ')]
min_socks = min(red, blue)
max_socks = max(red, blue)
print('{} {}'.format(min_socks, int((max_socks - min_socks) / 2)))


(a, b) = [int(el) for el in input().split()]
if a < b:
	print(a, (b - a) // 2, sep=' ')
else:
	print(b, (a - b) // 2, sep=' ')


import math
counter = 0
(x, y) = map(int, input().split())

def samepair():
	if x == 0 or y == 0:
		return math.floor((x + y) / 2)
for c in range(1, 101):
	x -= 1
	y -= 1
	if x == 0 or y == 0:
		print(c, samepair())
		break


import math

def s(ar):
	out = [min(ar), math.floor((max(ar) - min(ar)) / 2)]
	print(*out, sep=' ')
s(list(map(int, input().rstrip().split())))


(red, blue) = input().split(' ')
(red, blue) = (int(red), int(blue))
diffPair = min(red, blue)
samePair = (max(red, blue) - diffPair) // 2
print(diffPair, samePair)


ab = list(map(int, input().split()))
days = [0, 0]
while ab[0] != 0 and ab[1] != 0:
	ab[0] -= 1
	ab[1] -= 1
	days[0] += 1
if ab[0] == 0:
	days[1] = ab[1] // 2
elif ab[1] == 0:
	days[1] = ab[0] // 2
print(*days)


(a, b) = input().split()
(a, b) = (int(a), int(b))
if a > b:
	max_amount = b
	a = (a - max_amount) // 2
	print(max_amount, a)
elif a < b:
	max_amount = a
	b = (b - max_amount) // 2
	print(max_amount, b)
elif a == b:
	max_amount = a
	aa = 0
	print(max_amount, aa)


import math
(m, n) = map(int, input().split())
print(min(m, n), math.floor((max(m, n) - min(m, n)) / 2))


a = input().split()
r = int(a[0])
b = int(a[1])
if r > b:
	d = b
	s = (r - b) // 2
elif r < b:
	d = r
	s = (b - r) // 2
else:
	d = r
	s = 0
print(d, s)


(a, b) = [int(i) for i in input().split()]
print(min(a, b), end=' ')
print(abs(a - b) // 2)


(a, b) = map(int, input().split())
r1 = min(a, b)
r2 = (max(a, b) - min(a, b)) // 2
print(r1, r2)


import sys
from random import choice, randint
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def MI():
	return map(int, sys.stdin.readline().strip().split())

def LI():
	return list(map(int, sys.stdin.readline().strip().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().strip().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().strip().split()]

def LS():
	return sys.stdin.readline().strip().split()

def I():
	return int(sys.stdin.readline().strip())

def F():
	return float(sys.stdin.readline().strip())

def S():
	return sys.stdin.readline().strip()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))
inp = sys.stdin.readline
out = sys.stdout.write

def main():
	(a, b) = MI()
	print(min(a, b), (max(a, b) - min(a, b)) // 2)
main()


(a, b) = map(int, input().split())
c = min(a, b)
if a > b:
	x = a - b
else:
	x = b - a
if (a - b) % 2 == 0:
	print(c, x // 2, sep=' ')
else:
	print(c, (x - 1) // 2, sep=' ')


import math
n = input().split()
k = int(n[0])
l = int(n[1])
a = min(k, l)
b = math.floor(abs(k - l) / 2)
print(str(a) + ' ' + str(b))


(n, m) = map(int, input().split())
(t, k) = (0, 0)
while n > 0 and m > 0:
	t += 1
	n -= 1
	m -= 1
k = m // 2 if m > 0 else n // 2
print(t, k)


(a, b) = [int(i) for i in input().split()]
ans1 = min(a, b)
ans2 = abs(a - b) // 2
print(ans1, ans2)


A = input()
A = A.split()
B = int(A[0])
C = int(A[1])
z = max(B, C)
x = min(B, C)
sum = z - x
sum2 = sum // 2
print(x, sum2)


import math
from collections import Counter

def get(f):
	return map(f, input().split())

def divides(a, b):
	return a % b == 0

def main():
	(a, b) = get(int)
	fashion = min(a, b)
	a -= fashion
	b -= fashion
	if a == 0:
		(a, b) = (b, a)
	print(fashion, math.floor(a / 2))
main()


(blue_socks, red_socks) = input().split()
blue_socks = int(blue_socks)
red_socks = int(red_socks)
luxary = min(blue_socks, red_socks)
_luxary = (max(blue_socks, red_socks) - luxary) // 2
print(luxary, _luxary)


b = list(map(int, input().split()))
m = min(b)
print(m, end=' ')
if b[0] != m:
	y = (b[0] - m) // 2
else:
	y = (b[1] - m) // 2
print(y)


from sys import stdin, stdout
from math import sqrt
inp = stdin.readline
out = stdout.write
(a, b) = map(int, inp().strip().split())
if a == b:
	out(str(a) + ' 0')
elif a > b:
	out(str(b) + ' ' + str((a - b) // 2))
else:
	out(str(a) + ' ' + str((b - a) // 2))


(a, b) = [int(i) for i in input().split(' ')]
res = min(a, b)
if b >= a:
	res1 = (b - a) // 2
elif a >= b:
	res1 = (a - b) // 2
print(res, res1)


(a, b) = map(int, input().split())
out1 = min(a, b)
q = a - out1
q = q / 2
c = b - out1
c = c / 2
out2 = max(q, c)
print(int(out1), int(out2))


(a, b) = map(int, input().split())
total = a + b
largest = a if a > b else b
hip = 0
remain = 0
while a > 0 and b > 0:
	a = a - 1
	b = b - 1
	hip = hip + 1
remain = a // 2 if a > 0 else b // 2
print(hip, remain, sep=' ')


(a, b) = map(int, input().split())
c = 0
z = 0
z = a - b
if a >= b:
	m = int(z / 2)
	c = b
	print(c, m)
else:
	j = b - a
	h = int(j / 2)
	c = a
	print(c, h)


(r, b) = [int(p) for p in input().split()]
mi = min(r, b)
ma = max(r, b)
c = (ma - mi) // 2
print(mi, c)


s = input()
ast = [int(i) for i in s.split(' ')]
(a, b) = (ast[0], ast[1])
(r, p) = (min(a, b), max(a, b))
p = (p - r) // 2
print(r, p)


(a, b) = map(int, input().split())
min_red_blue = min(a, b)
diff = abs(a - b) // 2
print(min_red_blue, diff)


(a, b) = map(int, input().split())
print(a if a < b else b, abs(a - b) // 2)


(a, b) = list((int(x) for x in input().split()))
diff = min(a, b)
same = (max(a, b) - diff) // 2
print(str(diff) + ' ' + str(same))


import math
(a, b) = [int(i) for i in input().split()]
print(min(a, b), abs(a - b) // 2)


(n, m) = map(int, input().split())
if n >= m:
	print(m, (n - m) // 2)
else:
	print(n, (m - n) // 2)


(a, b) = map(int, input().split())
c = d = 0
while a > 0 and b > 0:
	a -= 1
	b -= 1
	c += 1
if a > 1 and b == 0:
	while a > 1:
		a -= 2
		d += 1
elif b > 1 and a == 0:
	while b > 1:
		b -= 2
		d += 1
print(c, d)


arr = input().split()
red = int(arr[0])
blue = int(arr[1])
if red <= blue:
	resp1 = red
else:
	resp1 = blue
resp2 = abs(red - blue) // 2
print(str(resp1) + ' ' + str(resp2))


(a, b) = map(int, input().split())
print('{0} {1}'.format(min(a, b), int(abs(a - b) / 2)))


(c, d) = input('').split(' ')
a = int(c)
b = int(d)
if a >= b:
	k = b
	h = int((a - b) / 2)
elif a <= b:
	k = a
	h = int((b - a) / 2)
print(str(k) + ' ' + str(h))


(a, b) = [int(k) for k in input().split(' ')]
print(min(a, b), (max(a, b) - min(a, b)) // 2)


data = list(map(int, input().split()))
(data[0], data[1]) = (max(data), min(data))
k = 0
while data[1] != 0:
	data[0] -= 1
	data[1] -= 1
	k += 1
print(k, data[0] // 2)


(blue, red) = map(int, input().split())
rest = abs(blue - red) // 2
actual = (blue + red - abs(blue - red)) // 2
print(actual, rest)


(a, b) = map(int, input().split())
c = abs(a - b) // 2
l = min(a, b)
print(l, c)


(a, b) = map(int, input().split())
tmp = max(a, b) - min(a, b)
print(min(a, b), abs(a - b) // 2)


socks = input().split(' ')
k = 0
(a, b) = (int(socks[0]), int(socks[1]))
d = (max(a, b) - min(a, b)) // 2
print(min(a, b), d)


(r, b) = map(int, input().split())
print(f'{min(r, b)} {abs(r - b) // 2}')


(a, b) = [int(i) for i in input().split()]
print(min(a, b), end=' ')
x = a - min(a, b)
y = b - min(a, b)
if x != 0:
	print(int(x / 2))
else:
	print(int(y / 2))


n = input().split()
m = []
for i in n:
	m.append(int(i))
s1 = m[0]
s2 = m[1]
z = 0
if s1 > s2:
	z = str((s1 - s2) // 2)
	print(str(s2) + ' ' + z)
if s1 < s2:
	z = str((s2 - s1) // 2)
	print(str(s1) + ' ' + z)
if s1 == s2:
	print(str(s1) + ' ' + '0')


s = input().split()
a = int(s[0])
b = int(s[1])
print(min(a, b), end=' ')
c = abs(a - b)
import math
print(math.floor(c / 2))


(x, y) = map(int, input().split())
a = min(x, y)
b = abs(x - y) // 2
print(a, b, sep=' ')


socks = str(input()).split()
red = int(socks[0])
blue = int(socks[1])
hip = min(red, blue)
days_left = (max(red, blue) - hip) // 2
print(f'{hip} {days_left}')


(n, m) = [int(i) for i in input().split()]
if n == m:
	print(n, 0)
elif n > m:
	print(m, int((n - m) / 2))
else:
	print(n, int((m - n) / 2))


(r, b) = map(int, input().split())
mins = min(r, b)
m = max(r, b)
same = (m - mins) // 2
print(mins, same)


(cr, ca) = input().split()
cr = int(cr)
ca = int(ca)
mn = 0
mm = 0
if cr > ca:
	mm = ca
	mn = cr - ca
else:
	mm = cr
	mn = ca - cr
print(mm, int(mn / 2))


n = list(map(int, input().split(' ')))
print(min(n), abs(n[0] - n[1]) // 2)


def count_days(r, b):
	hipster = min(r, b)
	normal = abs(r - b) // 2
	return (hipster, normal)
(red, blue) = map(int, input().split())
res = count_days(red, blue)
print(' '.join(map(str, res)))


n = [int(i) for i in input().split()]
minnum = str(min(n))
rest = str((n[0] + n[1] - 2 * min(n)) // 2)
print(minnum + ' ' + rest)


l = list(map(int, input().split()))
print(min(l[0], l[1]), abs(l[1] - l[0]) // 2)


def function(a, b):
	print(str(min(a, b)) + ' ' + str(abs(a - b) // 2))
(a, b) = map(int, input().strip().split(' '))
function(a, b)


a = [int(i) for i in input().split()]
a.sort(reverse=True)
c2 = 0
c1 = a[1]
if (a[0] - a[1]) % 2 == 0:
	c2 += (a[0] - a[1]) / 2
else:
	c2 += (a[0] - a[1]) // 2
print(c1, int(c2))


(r, b) = map(int, input().split())
differentSocks = min(r, b)
sameSocks = (max(r, b) - differentSocks) // 2
print(str(differentSocks) + ' ' + str(sameSocks))


(a, b) = map(int, input().split())
sum = min(a, b)
a = a - sum
b = b - sum
k = int((a + b) / 2)
print(sum, k)


import sys, math
wtf = sys.stdin.read()
wtf = wtf.strip().split('\n')
(a, b) = map(lambda x: int(x), wtf[0].split(' '))
assert a + b >= 2 and a + b <= 200, 'Precondition failure'
if a > b:
	c = b
	d = (a - b) // 2
else:
	c = a
	d = (b - a) // 2
print(c, d)


(n, k) = map(int, input().split())
if n < k:
	a = n
	b = (k - n) // 2
	print(a, b)
else:
	a = k
	b = (n - k) // 2
	print(a, b)


(a, b) = map(int, input().split())
n1 = min(a, b)
n2 = max(a - n1, b - n1)
n2 = n2 // 2
print(n1, n2)


z = [int(x) for x in input().split()]
print(min(z), (max(z) - min(z)) // 2)


(a, b) = input().split(' ')
a = int(a)
b = int(b)
c = min(a, b)
d = int(abs(a - b) // 2)
print(c, end=' ')
print(d)


l = input().split()
a = int(l[0])
b = int(l[1])
print(min(a, b), end=' ')
print((max(a, b) - min(a, b)) // 2)


(m, n) = (0, 0)
l = input().split(' ')
(a, b) = (int(l[0]), int(l[1]))
if a < b:
	m = a
	b -= m
	print(m, int(b / 2))
else:
	m = b
	a -= m
	print(m, int(a / 2))


(A, B) = map(int, input().split())
(C, D) = (min(A, B), max(A, B))
print(C, (D - C) // 2)


n = input().split()
red = int(n[0])
blue = int(n[1])
lalnil = 0
ekcolor = 0
if red > blue:
	lalnil += blue
	ekcolor = (red - blue) / 2
elif red < blue:
	lalnil += red
	ekcolor = (blue - red) / 2
elif red == blue:
	lalnil = red
print(lalnil, int(ekcolor))


socks = [int(n) for n in input().split()]
red = socks[0]
blue = socks[1]
count = 0
while red > 0 and blue > 0:
	red -= 1
	blue -= 1
	count += 1
if red == 0:
	if blue == 1:
		pair = 0
	else:
		pair = blue // 2
elif blue == 0:
	if red == 1:
		pair = 0
	else:
		pair = red // 2
print(f'{count} {pair}')


(a, b) = map(int, input().split())
(tempA, tempB) = (a, b)
countA = 0
countB = 0
if a > b:
	countB = b
	a -= b
	if a % 2 == 0:
		print(countB, a // 2)
	else:
		print(countB, a // 2)
elif a < b:
	countA = a
	b -= a
	if b % 2 == 0:
		print(countA, b // 2)
	else:
		print(countA, b // 2)
else:
	print(a, 0)


(a, b) = map(int, input().split())
t = min(a, b)
c = max(a, b) - t
y = c // 2
print(t, y)


import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *

class Scanner:

	@staticmethod
	def int():
		return int(sys.stdin.readline().rstrip())

	@staticmethod
	def string():
		return sys.stdin.readline().rstrip()

	@staticmethod
	def map_int():
		return [int(x) for x in Scanner.string().split()]

	@staticmethod
	def string_list(n):
		return [input() for i in range(n)]

	@staticmethod
	def int_list_list(n):
		return [Scanner.map_int() for i in range(n)]

	@staticmethod
	def int_cols_list(n):
		return [int(input()) for i in range(n)]

class Math:

	@staticmethod
	def gcd(a, b):
		if b == 0:
			return a
		return Math.gcd(b, a % b)

	@staticmethod
	def lcm(a, b):
		return a * b // Math.gcd(a, b)

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

	@staticmethod
	def round_up(a, b):
		return -(-a // b)

	@staticmethod
	def is_prime(n):
		if n < 2:
			return False
		if n == 2:
			return True
		if n % 2 == 0:
			return False
		d = int(n ** 0.5) + 1
		for i in range(3, d + 1, 2):
			if n % i == 0:
				return False
		return True

class PriorityQueue:

	def __init__(self, l=[]):
		self.q = l
		heapq.heapify(self.q)
		return

	def push(self, n):
		heapq.heappush(self.q, n)
		return

	def pop(self):
		return heapq.heappop(self.q)

def pop_count(x):
	x = x - (x >> 1 & 6148914691236517205)
	x = (x & 3689348814741910323) + (x >> 2 & 3689348814741910323)
	x = x + (x >> 4) & 1085102592571150095
	x = x + (x >> 8)
	x = x + (x >> 16)
	x = x + (x >> 32)
	return x & 127
MOD = int(1000000000.0) + 7
INF = int(1000000000000000.0)

def main():
	(a, b) = Scanner.map_int()
	c = min(a, b)
	print(c, (a + b - 2 * c) // 2)
main()


(a, b) = map(int, input().split(' '))
c = abs(a - b)
if a > b:
	print(b, end=' ')
else:
	print(a, end=' ')
if c % 2 == 0:
	print(c // 2)
else:
	c = c - 1
	print(c // 2)


(r, b) = map(int, input().split())
a = min(r, b)
b = max(r, b)
b1 = b - a
if b1 >= 2:
	b1 = b1 // 2
else:
	b1 = 0
print(a, b1)


socks = input().split()
red = int(socks[0])
blue = int(socks[1])
if blue > red:
	print(red, end=' ')
	blue -= red
	print(int(blue / 2))
else:
	print(blue, end=' ')
	red -= blue
	print(int(red / 2))


[a, b] = [int(a) for a in input().split(' ')]
sum = (a + b) // 2
if a < b:
	colors = a
else:
	colors = b
same = sum - colors
print(colors, same)


(x, y) = map(int, input().split(' '))
if x < y:
	print(x, ' ', end='')
else:
	print(y, ' ', end='')
print(int(abs(x - y) / 2))


import sys
a = sys.stdin.readline().rstrip()
a = a.split()
b = int(a[1])
a = int(a[0])
diff = 0
same = 0
if a < b:
	temp = a
	a = b
	b = temp
a -= b
a /= 2
a = int(a)
diff = b
same = a
print(diff, same)


angka = input().split()
a = int(angka[0])
b = int(angka[1])
hasil1 = 0
hasil2 = 0
while a != 0 and b != 0:
	a -= 1
	b -= 1
	hasil1 += 1
if a == 0:
	hasil2 = b // 2
elif b == 0:
	hasil2 = a // 2
print(hasil1, hasil2)


(s1, s2) = map(int, input().split())
print(min(s1, s2), abs(s1 - s2) // 2)


socks = list(map(int, input().split()))
if socks[0] >= socks[1]:
	different = socks[1]
	wait = (socks[0] - socks[1]) // 2
if socks[0] < socks[1]:
	different = socks[0]
	wait = (socks[1] - socks[0]) // 2
print(str(different) + ' ' + str(wait))


import math
(a, b) = [int(i) for i in input().split()]
c = min(a, b)
a = a - c
b = b - c
if a != 0:
	e = math.floor(a / 2)
else:
	e = math.floor(b / 2)
print(c, e)


(q, w) = map(int, input().split())
t = 0
while q != 0 and w != 0:
	q = q - 1
	w = w - 1
	t = t + 1
print(t, [q // 2, w // 2][q == 0])


(n, k) = map(int, input().split())
x = min(n, k)
print(x, (max(n, k) - x) // 2)


from math import fabs
(a, b) = map(int, input().split())
c = int(fabs(a - b))
print(str(min(a, b)) + ' ' + str(c // 2))


n = [int(x) for x in input().split()]
print(min(n), end=' ')
print((max(n) - min(n)) // 2)


(a, b) = map(int, input().split())
k = x = 0
print(min(a, b), (max(a, b) - min(a, b)) // 2)


l = list(map(int, input().split()))
c = min(l)
x = sum(l) - c * 2
print(str(c) + ' ' + str(x // 2))


(a, b) = list(map(int, input().split()))
d = min(a, b)
x = abs(a - b)
s = x // 2
print(d, s)


(a, b) = map(int, input().split())
days_in_fashion = min(a, b)
k = max(a, b) - min(a, b)
days_without_fashion = int(k / 2)
print(days_in_fashion, days_without_fashion)


(x, y) = map(int, input().split())
if x > y:
	print(y)
	print((x - y) // 2)
elif x == y:
	print(x)
	print(0)
else:
	print(x)
	print((y - x) // 2)


s = input().split()
a = int(s[0])
b = int(s[1])
if a > b:
	min = b
else:
	min = a
ans = (a + b - min * 2) // 2
print(min, ans)


(a, b) = input().strip().split()
(a, b) = (int(a), int(b))
a1 = min(a, b)
a2 = int((max(a, b) - a1) / 2)
print(a1, a2)


def answer():
	a = input().split()
	b = int(a[0])
	c = int(a[1])
	first = min(b, c)
	second = int((max(b, c) - min(b, c)) / 2)
	ans = str(first) + ' ' + str(second)
	return ans
print(answer())


a = [int(i) for i in input().split()]
s = a[0]
k = a[1]
q = 0
if k > s:
	z = (k - s) // 2
	q = (s + k) // 2 - z
else:
	z = (s - k) // 2
	q = (s + k) // 2 - z
print(q, z)


(a, b) = input().split()
tab = []
sec = []
tab.append(int(a))
tab.append(int(b))
tab.sort()
x = tab[0]
y = tab[1] - tab[0]
if y >= 2:
	y = int(y / 2)
else:
	y = 0
sec.append(str(x))
sec.append(str(y))
sec.insert(1, ' ')
print(''.join(sec))


(a, b) = input().split()
a = int(a)
b = int(b)
ans1 = min(a, b)
c = a - min(a, b)
d = b - min(a, b)
ans2 = max(c, d)
ans2 = ans2 // 2
print(ans1, ans2)


(x, y) = map(int, input().split())
ans1 = 0
ans2 = 0
if x >= y:
	ans1 = y
	ans2 = (x - y) // 2
else:
	ans1 = x
	ans2 = (y - x) // 2
print(ans1, ans2)


(a, b) = map(int, input().split())
sum = 0
ans = min(a, b)
sum += a - ans + b - ans
ans1 = sum // 2
print(ans, ans1)


x = input()
list_socks = x.split(' ')
red = int(list_socks[0])
blue = int(list_socks[-1])
colors = [red, blue]
odd_pair = None
if red == blue:
	print(red, 0)
else:
	for color in colors:
		if odd_pair is None:
			odd_pair = color
		elif color < odd_pair:
			odd_pair = color
	for color in colors:
		if color != odd_pair:
			larger_num = color
	same_color = larger_num - odd_pair
	if same_color % 2 != 0:
		same_color = same_color - 1
	even_pair = int(same_color / 2)
	print(odd_pair, even_pair)


(r, b) = map(int, input().split())
if r > b:
	smaller = b
	bigger = r
else:
	smaller = r
	bigger = b
print('{} {}'.format(smaller, (bigger - smaller) // 2))


def min(a, b):
	if a >= b:
		return b
	else:
		return a
import math
(a, b) = [int(i) for i in input().split()]
m = min(a, b)
n = abs(b - a) // 2
print(m, n)


(a, b) = input().split()
a = int(a)
b = int(b)
ndays_2colors = min(a, b)
ndays_1colors = (max(a, b) - min(a, b)) // 2
print(ndays_2colors, ndays_1colors)


(r, b) = map(int, input().split())
dif = min(r, b)
sam = (max(r, b) - dif) // 2
print(dif, sam)


(f, s) = [int(x) for x in input().split()]
if s < f:
	(s, f) = (f, s)
print('{} {}'.format(f, (s - f) // 2))


import math
(x, y) = [int(x) for x in input().split()]
biggerValue = int((x + y) / 2 + abs(x - y) / 2)
smallerValue = int((x + y) / 2 - abs(x - y) / 2)
takeBoth = smallerValue
takeSame = math.floor((biggerValue - smallerValue) / 2)
print(takeBoth, takeSame)


(m, n) = map(int, input().split())
a = abs(m - n)
x = a // 2
if m < n:
	print(m, x)
elif m >= n:
	print(n, x)


a = [0] * 2
a = [int(i) for i in input().split()]
a.sort()
print(a[0], end=' ')
print((a[1] - a[0]) // 2)


s = input()
a = s.split()
for i in range(len(a)):
	a[i] = int(a[i])
print(min(a), int((max(a) - min(a)) / 2))


(a, b) = map(int, input().split())
print(str(min(a, b)) + ' ' + str((a - min(a, b)) // 2 + (b - min(a, b)) // 2))


s = input().split()
a = int(s[0])
b = int(s[1])
c1 = min(a, b)
c2 = abs(a - b) // 2
print(c1, c2)


(n, m) = map(int, input().split())
mx = min(n, m)
ans = mx
n = n - mx
m = m - mx
ans_2 = n // 2 + m // 2
print(ans, ans_2)


s = [int(x) for x in input().split()]
a = s[0]
b = s[1]
x = min(a, b)
y = max(a, b) - x
t = int(y / 2)
z = str(x)
c = str(t)
print(z + ' ' + c)


l = input().split()
a = int(l[0])
b = int(l[1])
d1 = min(a, b)
r = max(a, b) - min(a, b)
d2 = r // 2
print(d1, d2)


(red, blue) = map(int, input().split())
redblue = min(red, blue)
onlyonecolor = abs(red - blue)
onlyonecolor = int(onlyonecolor / 2)
print(redblue, onlyonecolor)


def main(b, r):
	minim = min([b, r])
	maxim = max([b, r])
	if b != r:
		if (maxim - minim) % 2 != 0:
			cols = int((maxim - minim - 1) / 2)
		else:
			cols = int((maxim - minim) / 2)
		return ' '.join([str(minim), str(cols)])
	else:
		return ' '.join([str(b), str('0')])
inp = input().split(' ')
blue = int(inp[0])
red = int(inp[1])
print(main(blue, red))


(a, b) = map(int, input().split())
c = abs(a - b)
one_color = abs(a - b) // 2
two_color = (a + b - c) // 2
print(two_color, one_color)


(r, b) = input().split()
r = int(r)
b = int(b)
min_value = min(r, b)
max_value = max(r, b)
diff = int(min_value)
same = int((max_value - min_value) / 2)
print(str(diff) + ' ' + str(same))


s = input().split()
a = int(s[0])
b = int(s[1])
r1 = 0
r2 = 0
if a >= b:
	r1 = b
	r2 = abs(a - b) // 2
else:
	r1 = a
	r2 = abs(b - a) // 2
print(r1, r2)


(a, b) = input().split()
a = int(a)
b = int(b)
y = min(a, b)
t = (max(a, b) - y) // 2
print(y, t)


(a, b) = map(int, input().split())
x = a - b
y = b - a
c = max(x, y)
y = (a + b - c) / 2
u = c / 2
print(int(y), int(u))


(a, b) = [int(i) for i in input().split()]
total = 0
output_lst = []
total += min(a, b)
output_lst.append(str(total))
total = 0
total += int(abs(a - b) / 2)
output_lst.append(str(total))
print(' '.join(output_lst))


(a, b) = map(int, input().split())
k = 0
if a == b:
	print(a, 0)
else:
	while a > 0 and b > 0:
		a -= 1
		b -= 1
		k += 1
	big = max(a, b)
	mal = min(a, b)
	if big >= 2:
		print(k, big // 2)
	elif big < 2:
		print(k, 0)


(a, b) = map(int, input().split())
w = 0
if a < b:
	w = a
else:
	w = b
y = abs(a - b) // 2
print(w, y)


(a, b) = [int(i) for i in input().split()]
d = min(a, b)
s = int((max(a, b) - d) / 2)
print(d, s)


import math
line = input().split()
num_red = int(line[0])
num_blue = int(line[1])
num_sock = num_blue + num_red
dif_day = min(num_red, num_blue)
num_left = num_sock - 2 * dif_day
same_day = math.floor(num_left / 2)
print(dif_day, same_day)


from sys import stdin, exit
(a, b) = map(int, stdin.readline().rstrip().split(' '))
mismatch_pairs = min(a, b)
a -= mismatch_pairs
b -= mismatch_pairs
match_pairs = 0
while a > 1 or b > 1:
	match_pairs += a // 2
	a -= a // 2 * 2
	match_pairs += b // 2
	b -= b // 2 * 2
print(mismatch_pairs, match_pairs)


(a, b) = [int(x) for x in input().split()]
m = min(a, b)
M = max(a, b)
print(m, (M - m) // 2)


(a, b) = map(int, input().split())
f_count = 0
m_count = 0
if a > b:
	red = a
	blue = b
else:
	red = b
	blue = a
for i in range(red):
	while blue > 0:
		f_count += 1
		blue -= 1
		red -= 1
	if red > 1:
		m_count += 1
		red -= 2
	else:
		break
print(f_count, m_count)


(n, k) = map(int, input().split())
m = min(n, k)
n -= m
k -= m
print(m, n // 2 + k // 2)


s = input().split()
r = int(s[0])
b = int(s[1])
d = min(r, b)
same = (-d + max(r, b)) // 2
print('%d %d' % (d, same))


(a, b) = input().split()
a = int(a)
b = int(b)
da = int(max(a, b))
siao = int(min(a, b))
butong = siao
tong = (da - butong) // 2
print(butong, tong)


(r, b) = input().split()
(r, b) = [int(r), int(b)]
if r >= b:
	print(b, int((r - b) / 2))
elif b > r:
	print(r, int((b - r) / 2))


socks = input()
(a, b) = [int(i) for i in socks.split()]
if a > b:
	more = a
	less = b
else:
	more = b
	less = a
dif = more - less
if dif % 2 == 0:
	same = dif // 2
elif dif == 1:
	same = 0
else:
	same = dif // 2
print(less, same)


(a, b) = map(int, input().split())
t = min(a, b)
d = abs(b - a)
s = int(d / 2)
print(t, s)


s = input().split()
s = list(map(int, s))
a = min(s)
b = max(s) - min(s)
c = b // 2
print(a, c)


(p, q) = map(int, input().split())
print(min(p, q), (max(p, q) - min(p, q)) // 2)


(a, b) = map(int, input().split())
maxi = max(a, b)
mini = min(a, b)
cal = maxi - mini
ans = cal // 2
print(mini, ans)


(a, b) = map(int, input().split())
m = min(a, b)
k = max(a, b) - m
print(m, k // 2)


n = list(map(int, input().split()))
l = []
if n[0] < n[1]:
	l.append(n[0])
else:
	l.append(n[1])
x = (n[1] - n[0]) / 2
l.append(int(abs(x)))
for i in range(len(n)):
	print(l[i], end=' ')


(r, b) = [int(i) for i in input().split()]
mi = min(r, b)
ma = max(r, b)
ans1 = mi
ans2 = (ma - mi) // 2
print(ans1, ans2)


import math
(r, b) = [int(x) for x in input().split(' ')]
diff = min(r, b)
same = math.floor((max(r, b) - diff) / 2)
print('%i %i' % (diff, same))


n = list(map(int, input().split()))
i = 0
diff = 0
same = 0
while True:
	if n[0] >= 1 and n[1] >= 1:
		n[0] -= 1
		n[1] -= 1
		diff += 1
	elif n[0] >= 2:
		n[0] -= 2
		same += 1
	elif n[1] >= 2:
		n[1] -= 2
		same += 1
	else:
		break
print(diff, same)


a = [int(x) for x in input().split()]
print(min(a), (sum(a) - min(a) * 2) // 2)


inp = list(map(int, input().split()))
a = min(inp)
b = sum(inp) // 2 - a
print(a, b)


import sys
input = sys.stdin.readline

def main():
	(n, m) = map(int, input().split())
	print(min(n, m), abs(n - m) // 2)
main()


(n, m) = [int(i) for i in input().split()]
if n > m:
	n = n - m
	m = n + m
	n = m - n
print(n, end=' ')
print(int((m - n) / 2))


(a, b) = map(int, input().split())
t = 0
s = 0
for i in range(100):
	a -= 1
	b -= 1
	t += 1
	if a == 0 or b == 0:
		break
if a > b:
	while a >= 2:
		a -= 2
		s += 1
if b > a:
	while b >= 2:
		b -= 2
		s += 1
print(t, s)


(n1, n2) = [int(i) for i in input().split()]
day1 = min(n1, n2)
day2 = (max(n1, n2) - min(n1, n2)) // 2
print('%d %d' % (day1, day2))


(x, y) = [int(x) for x in input().split()]
a = x
if y < a:
	a = y
print(a, abs(x - y) // 2)


(a, b) = map(int, input().split())
x = min(a, b)
n = (max(a, b) - x) // 2
print(x, n)


numbers = list(map(int, input().split()))
red = numbers[0]
blue = numbers[1]
if red > blue:
	diff_socks = blue
	same_socks = (red - blue) // 2
else:
	diff_socks = red
	same_socks = (blue - red) // 2
print(diff_socks, same_socks)


s = input().split()
a = int(s[0])
b = int(s[1])
oneColor = abs(a - b)
print('{} {}'.format((a + b - abs(a - b)) // 2, oneColor // 2))


b = list(map(int, input().split()))
if (max(b) - min(b)) % 2 == 0:
	print(str(min(b)) + ' ' + str(int((max(b) - min(b)) / 2)))
else:
	print(str(min(b)) + ' ' + str(int((max(b) - min(b) - 1) / 2)))


(a, b) = map(int, input().split())
hip = min(a, b)
print(hip, (a + b - 2 * hip) // 2)


(a, b) = list(map(int, input().split()))
fashion = min(a, b)
notFashion = (a + b - fashion * 2) // 2
print(fashion, notFashion)


a = input().split()
m = int(a[0])
n = int(a[1])
if m >= n:
	s = n
	d = (m - n) // 2
else:
	s = m
	d = (n - m) // 2
print(s, d)


(a, b) = map(int, input().split())
l = []
l.append(min(a, b))
a = max(a, b) - min(a, b)
l.append(a // 2)
print(*l)


(a, b) = [int(tmp) for tmp in input().split()]
if a < b:
	print(a, (b - a) // 2, end=' ')
elif a > b:
	print(b, (a - b) // 2, end=' ')
else:
	print(a, '0', end=' ')


(a, b) = map(int, input().split())
c = min(a, b)
a -= c
b -= c
d = a / 2 + b / 2
print('{} {}'.format(c, int(d)))


(a, b) = map(int, input().split())
e = a - b
z = a - e
m = e // 2
l = b - a
r = b - l
k = l // 2
print(min(z, r), max(m, k))


(a, b) = map(int, input().split())
if a > b:
	k = a - b
	l = k // 2
	print(b, l, sep=' ')
else:
	k = b - a
	l = k // 2
	print(a, l, sep=' ')


l = [int(x) for x in input().split()]
print(min(l), (max(l) - min(l)) // 2)


(r, b) = input().split()
(r, b) = (int(r), int(b))
diff = 0
same = 0
while r != 0 or b != 0:
	if r > 0 and b > 0:
		r -= 1
		b -= 1
		diff += 1
	elif r > 1:
		r -= 2
		same += 1
	elif b > 1:
		b -= 2
		same += 1
	else:
		break
print(diff, same)


(n, m) = map(int, input().split())
k = min(n, m)
n -= k
m -= k
s = max(n, m) // 2
print(k, s)


a = list(map(int, input().split()))
print(min(a[0], a[1]))
if abs((a[0] - a[1]) % 2) == 0:
	print(int(abs((a[0] - a[1]) / 2)))
else:
	print(int((abs(a[0] - a[1]) - 1) / 2))


(a, b) = [int(_) for _ in input().split()]
print(min(a, b), (a + b - 2 * min(a, b)) // 2)


import math
n = input().split()
r = int(n[0])
b = int(n[1])
f = min(r, b)
o = math.floor((max(r, b) - min(r, b)) / 2)
print(f, o)


c = list(input().split())
a = int(c[0])
b = int(c[1])
if a >= b:
	print(b, end=' ')
	print((a - b) // 2)
else:
	print(a, end=' ')
	print((b - a) // 2)


(a, b) = map(int, input().split())
res = ''
m = min(a, b)
res += str(m) + ' '
res += str((max(a, b) - m) // 2)
print(res)


import sys
(a, b) = map(int, sys.stdin.readline().split())
print(min(a, b), int(abs(a - b) / 2))


import sys

def geti():
	return map(int, sys.stdin.readline().strip().split())
(a, b) = geti()
if a < b:
	(a, b) = (b, a)
print(b, (a - b) // 2)


(a, b) = input().split()
a = int(a)
b = int(b)
c = min(a, b)
g = max(a, b)
f = (g - c) // 2
print(c, f)


(a, b) = map(int, input().split())
diffd = min(a, b)
samed = abs(a - b) // 2
print(diffd, samed)


(a, b) = [int(i) for i in input().split()]
counter1 = 0
counter2 = 0
if a > b:
	for i in range(b):
		b -= 1
		a -= 1
		counter1 += 1
	counter2 += a // 2
else:
	for i in range(a):
		b -= 1
		a -= 1
		counter1 += 1
	counter2 += b // 2
print(counter1, counter2)


(red, blue) = map(int, input().split())
(big, small) = (max(red, blue), min(red, blue))
print(small, (big - small) // 2)


(a, b) = map(int, input().split())
min = a if a < b else b
c = 0
if a > b:
	min = b
	a -= min
	c = a / 2
else:
	min = a
	b -= min
	c = b / 2
print(min, int(c))


import sys
input = sys.stdin.readline

def inp():
	return int(input())

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
(r, b) = invr()
o1 = min(r, b)
o2 = (max(r, b) - o1) // 2
print(o1, o2)


(red, blue) = map(int, input().split())
small = 0
if red < blue:
	small = red
else:
	small = blue
small2 = small
for i in range(0, small2):
	if small > 0:
		red -= 1
		blue -= 1
		small -= 1
		num = i + 1
if small == blue:
	small = red
elif small == red:
	small = blue
if small <= 1:
	temp = 0
else:
	temp = small // 2
print(num, temp)


x = list(map(int, input().split()))
print(min(x), abs(x[0] - x[1]) // 2)


(a, b) = map(int, input().split())
if a > b:
	x = b
else:
	x = a
z = a + b - x * 2
c = z // 2
print(x, c)


(a, b) = map(int, input().split())
p = min(a, b)
(a1, b1) = (a - p, b - p)
q = max(a1, b1) // 2
print(str(p) + ' ' + str(q))


(a, b) = [int(x) for x in input().split()]
print(min(a, b), int((a + b) / 2) - min(a, b))


(r, b) = input().split()
r = int(r)
b = int(b)
(t, l) = (0, 0)
if r != b:
	t = min(r, b)
	m = max(r, b) - min(r, b)
	if m % 2 == 0:
		l = m // 2
	else:
		l = (m - 1) // 2
else:
	t = r
	l = 0
print(t, l)


s = input().split()
a = int(s[0])
b = int(s[1])
k = min(a, b)
c = (max(a, b) - k) // 2
print(k, c)


(n, m) = map(int, input().split())
ans1 = min(n, m)
n -= ans1
m -= ans1
if n == 0:
	ans2 = m // 2
else:
	ans2 = n // 2
print(ans1, ans2)


(a, b) = map(int, input().split())
if b <= a:
	c = b
elif a <= b:
	c = a
y = int(abs(a - b) / 2)
print(c, y)


(r, b) = map(int, input().split())
r1 = 0
r2 = 0
if r + b >= 2:
	r1 = min(r, b)
	r2 = (max(r, b) - min(r, b)) // 2
print(r1, r2)


socks = [int(sock) for sock in input().split(' ')]
pair_days = min(socks)
single_days = (max(socks) - pair_days) // 2
print(pair_days, single_days)


a = list(map(int, input().split()))
if a[0] < a[1]:
	print(a[0], end=' ')
	print(int((a[1] - a[0]) / 2))
elif a[0] == a[1]:
	print(a[0], end=' ')
	print('0')
else:
	print(a[1], end=' ')
	print(int((a[0] - a[1]) / 2))


(a, b) = map(int, input().split())
x = min(a, b)
y = (max(a, b) - x) // 2
print(str(x) + ' ' + str(y))


(red, blue) = [int(x) for x in input().split()]
total = red + blue
if red < blue:
	mh = red
else:
	mh = blue
ans = (total - mh * 2) // 2
print(mh, ans)


(n, m) = input().split()
n = int(n)
m = int(m)
li = []
li.append(n)
li.append(m)
li.sort()
x = li[1] - li[0]
y = x // 2
print(li[0], y)


(a, b) = map(int, input().split())
mi = min(a, b)
x = int((a + b - 2 * mi) / 2)
print(f'{mi} {x}')


(r, b) = map(int, input().split())
if r < b:
	x = b - r
	y = x // 2
	print(r, y)
elif r == b:
	print(r, 0)
elif b < r:
	x = r - b
	y = x // 2
	print(b, y)


(a, b) = map(int, input().split())
total = min(a, b)
r = 0
if a > b:
	r = a - b
else:
	r = b - a
print(total, r // 2)


(x, y) = map(int, input().split())
print(f'{min(x, y)} {(max(x, y) - min(x, y)) // 2}')


(a, b) = list(map(int, input().split()))
min = min(a, b)
ans = abs(a - b) // 2
print(min, ans)


i = input().split(' ')
a = int(i[0])
b = int(i[1])
if a - b < 0:
	miN = a
	maX = b
else:
	miN = b
	maX = a
print(miN, int((maX - miN) / 2))


import math

def sockPair(a, b):
	diffsock = min(a, b)
	samesock = math.floor(abs(a - b) / 2)
	return (diffsock, samesock)
ab = input().split()
a = int(ab[0])
b = int(ab[1])
(diffsock, samesock) = sockPair(a, b)
print(diffsock, samesock)


(a, b) = map(int, input().split())
(differnt, same) = (0, 0)
while a >= 1 or b >= 1:
	if a >= 1 and b >= 1:
		a -= 1
		b -= 1
		differnt += 1
	elif a > 1:
		a -= 2
		same += 1
	elif b > 1:
		b -= 2
		same += 1
	else:
		break
print(differnt, same)


try:
	(a, b) = list(map(int, input().split(' ')))
	k = min(a, b)
	l = (max(a, b) - min(a, b)) // 2
	print(str(k) + ' ' + str(l))
except:
	pass


(a, b) = input().split()
a = int(a)
b = int(b)
c = min(a, b)
a = a - c
b = b - c
d = (a + b) // 2
print(c, d)


li = list(map(int, input().split()))
print(min(li), (max(li) - min(li)) // 2)


(n, m) = map(int, input().split())
x = min(n, m)
a = (n + m) // 2 - x
print(x, a)


(a, b) = map(int, input().split())
if a > b:
	different = b
	same = int((a - b) / 2)
else:
	different = a
	same = int((b - a) / 2)
print(different, end=' ')
print(same)


(r, b) = map(int, input().split())
d = min(r, b)
s = (max(r, b) - d) // 2
print(str(d) + ' ' + str(s))


numbers = input().split(' ')
a = int(numbers[0])
b = int(numbers[1])
same = 0
diff = 0
if a > b:
	same = b
	a = a - b
	b = 0
	diff = a // 2
	print(str(same), str(diff))
elif b > a:
	same = a
	b = b - a
	a = 0
	diff = b // 2
	print(str(same), str(diff))
else:
	print(str(a), 0)


import math
q = input().split()
a = int(q[0])
b = int(q[1])
x = max(a, b)
z = min(a, b)
m = z
n = int(math.floor((x - z) / 2))
print(m, n)


first = input().split(' ')
a = int(first[0])
b = int(first[1])
u = min(a, b)
t = (max(a, b) - min(a, b)) // 2
print(str(u) + ' ' + str(t))


(a, b) = list(map(int, input().split()))
c2 = max(a, b)
c1 = 0
while a != 0 and b != 0:
	c1 = c1 + 1
	a = a - 1
	b = b - 1
print(c1, end=' ')
print(int((c2 - c1) / 2))


(red_socks, blue_socks) = list(map(int, input().split()))
min_socks = min(red_socks, blue_socks)
result = str(min_socks)
red_socks -= min_socks
blue_socks -= min_socks
max_socks = max(red_socks, blue_socks)
para = max_socks // 2
print(result, para)


(a, b) = map(int, input().split())
diff = min(a, b)
ide = (max(a, b) - diff) // 2
print(diff, ide)


s = list(map(int, input().split()))
a = s[0]
b = s[1]
x = min([a, b])
c = abs(a - b)
y = round((c - c % 2) / 2)
print('%d %d' % (x, y))


a = list(map(int, input().split()))
red = a[0]
blue = a[1]
if red < blue:
	print(red, (blue - red) // 2)
else:
	print(blue, (red - blue) // 2)


(a, b) = [int(i) for i in input().split()]
ans = []
ans.append(min(a, b))
ans_1 = abs(a - b) // 2
ans.append(ans_1)
for i in ans:
	print(i, end=' ')


(a, b) = [int(x) for x in input().split()]
dif = min(a, b)
same = max(a - dif, b - dif) // 2
print(dif, same)


(red, blue) = map(int, input().split())
a = min(red, blue)
c = abs(red - blue)
b = int(c / 2)
print(a, b)


(b, r) = map(int, input().split())
m = min(b, r)
ma = max(b, r)
ost = ma - m
dOst = ost // 2
print(m, dOst)


(a, b) = list(map(int, input().split()))
pair = 0
single = 0
while a != 0 and b != 0:
	a -= 1
	b -= 1
	pair += 1
for i in range(max(a, b)):
	if a > 1:
		a -= 2
		single += 1
	elif b > 1:
		b -= 2
		single += 1
print(pair, single)


def main():
	(a, b) = map(int, input().split())
	if a > b:
		(a, b) = (b, a)
	print(a, (b - a) // 2)
main()


(a, b) = input().split()
a = int(a)
b = int(b)
c = max(a, b)
d = min(a, b)
print(d, end=' ')
print((c - d) // 2)


from sys import stdin, stdout
input = stdin.readline
(a, b) = map(int, input().split())
ans = min(a, b)
stdout.write(str(ans) + ' ')
stdout.write(str(abs(a - b) // 2))


from sys import stdin
(red, blue) = map(int, stdin.readline().split())
print(min(red, blue), (max(red, blue) - min(red, blue)) // 2)


a = input().split()
m = int(a[0])
n = int(a[1])
c = min(m, n)
print(c, end=' ')
k = max(m, n) - min(m, n)
print(int(k / 2))


(a, b) = input().split()
a1 = int(a)
b1 = int(b)
if a1 == b1:
	print(a1, 0)
elif a1 > b1:
	sock = a1 - b1
	days = int(sock / 2)
	print(b1, days)
elif a1 < b1:
	sock = b1 - a1
	days = int(sock / 2)
	print(a1, days)


def socks(r, b):
	minimum = min(r, b)
	if r == minimum:
		final = (b - r) // 2
	else:
		final = (r - b) // 2
	return [minimum, final]
(r, b) = map(int, input().split())
print(*socks(r, b))


s = input()
datos = s.split(' ')
s_ = ''
num = 0
if int(datos[0]) < int(datos[1]):
	s_ = s_ + str(datos[0])
	num = int(datos[1]) - int(datos[0])
else:
	s_ = s_ + str(datos[1])
	num = int(datos[0]) - int(datos[1])
s_ = s_ + ' ' + str(int(num / 2))
print(s_)


(r, b) = map(int, input().split())
m1 = min(r, b)
m2 = (max(r, b) - min(r, b)) // 2
print(m1, m2)


import math
line = list(map(lambda i: int(i), input().split()))
min = min(line)
max = max(line) - min
print(min, math.floor(max / 2))


(x, y) = map(int, input().split())
c1 = min(x, y)
c2 = (max(x, y) - min(x, y)) // 2
print(c1, c2)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	(a, b) = LI()
	(a, b) = sorted([a, b])
	ans = a
	b -= a
	ans2 = b // 2
	print(ans, ans2)
main()


(n, m) = [int(i) for i in input().split()]
count = min(n, m)
print(count, end=' ')
if n > m:
	val = n - m
else:
	val = m - n
count = val // 2
print(count)


(a, b) = map(int, input().split())
z = int(b - a)
x = int(a - b)
bla1 = int(z / 2)
bla2 = int(x / 2)
if a == b:
	print(a, 0)
if a < b:
	print(a, bla1)
if b < a:
	print(b, bla2)


(a, b) = map(int, input().split())
if a >= b:
	x = a - b
	if x >= 2:
		print(a - x, x // 2)
	if x < 2:
		print(a - x, 0)
if b > a:
	x = b - a
	if x >= 2:
		print(b - x, x // 2)
	if x < 2:
		print(b - x, 0)


(n, m) = tuple(map(int, input().split()))
a = min(n, m)
print(a, end=' ')
a = (max(n, m) - min(n, m)) // 2
print(a)


(a, b) = map(int, input().split())
if a < b:
	(a, b) = (b, a)
n1 = 0
n2 = 0
while True:
	b -= 1
	if b < 0:
		break
	else:
		pass
	a -= 1
	n1 += 1
n2 = a // 2
print(n1, n2)


(n, h) = map(int, input().split())
print(min(n, h), max((n - min(n, h)) // 2, (h - min(n, h)) // 2))


lista = list(map(int, input().split()))
(a, b) = (lista[0], lista[1])
day2d = abs(a - b)
maxf = min(a, b)
print(maxf, end=' ')
print(day2d // 2)


(a, b) = map(int, input().split())
l = min(a, b)
j = max(a, b)
x = (j - l) // 2
print(l, x)


l = input().split(' ')
a = int(l[0])
b = int(l[1])
if a >= b:
	one = b
	a = a - b
	two = a // 2
else:
	one = a
	b = b - a
	two = b // 2
print(one, two, end=' ')
print()


(n, m) = map(int, input().split())
c = 0
d = 0
if n >= m:
	c = m
	d = (n - m) // 2
else:
	c = n
	d = (m - n) // 2
print(c, d)


xy = list(map(int, input().split()))
x = int(xy[0])
y = int(xy[1])
a = min(x, y)
b = max(x, y)
b -= a
b = b // 2
print(a, b)


(a, b) = [int(i) for i in input().split()]
answer = 0
if a > b:
	print(b, (a - b) // 2)
else:
	print(a, (b - a) // 2)


s = list(map(int, input().split()))
print(min(s), (max(s) - min(s)) // 2)


socks = str(input())
socks = socks.split(' ')
rsocks = int(socks[0])
bsocks = int(socks[1])
fas = 0
if rsocks > bsocks:
	fas = bsocks
	rsocks = rsocks - bsocks
	bsocks = 0
else:
	fas = rsocks
	bsocks = bsocks - rsocks
	rsocks = 0
dayz = int((rsocks + bsocks) / 2)
print(str(fas) + ' ' + str(dayz))


(a, b) = map(int, input().split())
c = min(a, b)
d = 0
if a > b:
	d = (a - b) // 2
elif b > a:
	d = (b - a) // 2
print(c, ' ', d)


(a, b) = map(int, input().split())
maxi = max(a, b)
mini = min(a, b)
ans1 = mini
left = maxi - mini
ans2 = left // 2
print(ans1, end=' ')
print(ans2)


def solution():
	(r, b) = (int(i) for i in input().split(' '))
	(a1, a2) = (r, 0) if r == b else (min(b, r), abs(r - b) // 2)
	print(a1, a2)
solution()


(n, m) = map(int, input().split())
k = 0
while n != 0 and m != 0:
	k = k + 1
	n = n - 1
	m = m - 1
print(k, (n + m) // 2)


(a, b) = [int(i) for i in input().split()]
output1 = min(a, b)
remain = max(a, b) - output1
output2 = int(remain / 2)
print(output1, output2)


def tpair(a1, b1):
	if a1 > b1:
		p1 = b1
	else:
		p1 = a1
	return p1

def opair(a1, b1):
	if a1 > b1:
		p2 = a1 - b1
	else:
		p2 = b1 - a1
	if p2 <= 1:
		return 0
	elif p2 == 2:
		return 1
	elif p2 % 2 == 0:
		return p2 / 2
	else:
		return (p2 - 1) / 2
(a, b) = input().split(' ')
a = int(a)
b = int(b)
c = opair(a, b)
c = int(c)
print(tpair(a, b), c)


socks = list(map(lambda x: int(x), input().split(' ')))
d_diff = 0
sim = 0
if socks[0] > socks[1]:
	d_diff = socks[1]
	sim = (socks[0] - socks[1]) // 2
else:
	d_diff = socks[0]
	sim = (socks[1] - socks[0]) // 2
print(d_diff, sim)


g = [int(x) for x in input().split()]
print(min(g), (max(g) - min(g)) // 2)


import math
(a, b) = map(int, input().split())
m = min(a, b)
ab = abs(a - b)
abd = math.floor(ab / 2)
print(m, abd)


l = list(map(int, input().split()))
li = []
m1 = min(l)
m2 = max(l)
li.append(m1)
li.append((m2 - m1) // 2)
print(*li)


n = list(map(int, input().split()))
if n[0] < n[1]:
	s = n[1] - n[0]
	print(n[0], s // 2)
elif n[1] < n[0]:
	s = n[0] - n[1]
	print(n[1], s // 2)
else:
	print(n[0], 0)


(a, b) = input().split()
a = int(a)
b = int(b)
maxi1 = min(a, b)
if a > b:
	a = a - b
	maxi = a // 2
else:
	maxi = (b - a) // 2
print(maxi1, maxi)


(a, b) = [int(j) for j in input().split(' ')]
c1 = 0
c2 = 0
if a == b:
	print(a, 0)
else:
	c1 = min(a, b)
	if a > b:
		a = a - c1
		c2 = a / 2
	else:
		b = b - c1
		c2 = b / 2
	print(c1, int(c2))


(a, b) = tuple(map(int, input().split()))
(m, x) = (min(a, b), max(a, b))
print(f'{m} {(x - m) // 2}')


col1 = 0
col2 = 0
(a, b) = [int(i) for i in input().split()]
while a != 0 and b != 0:
	a -= 1
	b -= 1
	col1 += 1
if b == 0:
	while a > 1:
		a -= 2
		col2 += 1
if a == 0:
	while b > 1:
		b -= 2
		col2 += 1
print(col1, '', col2)


(red, blue) = map(int, input().split())
fashion = min(red, blue)
nfashion = (max(red, blue) - min(red, blue)) // 2
print(fashion, end=' ')
print(nfashion)


n = list(map(int, input().split()))
a = n[0]
b = n[1]
if a > b:
	x = a
	y = b
else:
	x = b
	y = a
count = 0
for i in range(1, x + 1):
	if i <= y:
		count += 1
	else:
		break
print(count, end=' ')
if a > b:
	print(int((a - b) / 2))
else:
	print(int((b - a) / 2))


(x, y) = map(int, input().split())
z = x
zz = (y - x) // 2
if x > y:
	z = y
	zz = (x - y) // 2
print(z, zz)


(a, b) = map(int, input().split())
r1 = min(a, b)
r2 = abs(a - b) // 2
print(r1, r2)


s = [int(n) for n in input().split()]
print('{} {}'.format(min(s), (max(s) - min(s)) // 2))


def func(n):
	red_socks = n[0]
	blue_socks = n[1]
	different_counter = 0
	remainig_counter = 0
	while red_socks != 0 and blue_socks != 0:
		red_socks -= 1
		blue_socks -= 1
		different_counter += 1
	while blue_socks >= 2:
		blue_socks -= 2
		remainig_counter += 1
	while red_socks >= 2:
		red_socks -= 2
		remainig_counter += 1
	print(different_counter, remainig_counter)
n = list(map(int, input().split()))
func(n)


(a, b) = input().split()
a = int(a)
b = int(b)
if a >= b:
	n1 = b
	a = a - b
	n2 = int(a / 2)
else:
	n1 = a
	b = b - a
	n2 = int(b / 2)
print(n1, n2)


nlist = [int(i) for i in input().split()]
nlist = sorted(nlist)
dif = nlist[0]
same = int((nlist[1] - nlist[0]) / 2)
print(dif, same)


(a, b) = map(int, input().split())
time1 = min(a, b)
c = max(a, b) - time1
time2 = (c - c % 2) / 2
print(int(time1), int(time2))


(a, b) = map(int, input().split())
fa = min(a, b)
sa = int((max(a, b) - min(a, b)) / 2)
print(str(fa) + ' ' + str(sa))


(n, k) = map(int, input().split())
a = min(n, k)
b = max(n, k) - a
if b >= 1:
	b = b // 2
print(a, b)


(x, y) = [int(i) for i in input().split()]
n = min(x, y)
s = (x + y - 2 * n) // 2
print(n, s)


(a, b) = list(map(int, input().split()))
mi = min(a, b)
ma = max(a, b)
uf = (ma - mi) // 2
print(' '.join((str(i) for i in (mi, uf))))


import sys
(a, b) = map(int, sys.stdin.readline().split())
(x, y) = (min(a, b), int(abs(a - b) / 2))
print(x, y, sep=' ')


(a, b) = map(int, input().split())
Min = min(a, b)
ans = (max(a, b) - Min) // 2
print(Min, ans)


(a, b) = [int(x) for x in input().split()]
mn = min(a, b)
mx = max(a, b)
print(mn, (mx - mn) // 2)


n = str(input())
s = n.split(' ')
r = int(s[0])
b = int(s[1])
mi = int(min(r, b))
ma = int((int(max(r, b)) - mi) // 2)
r = str(mi) + ' ' + str(ma)
print(r)


(a, b) = list(map(int, input().split()))
x = 0
if a > b:
	print(b, end=' ')
	x = a - b
else:
	print(a, end=' ')
	x = b - a
print(x // 2)


(n, m) = [int(x) for x in input().split()]
print(max(n, m) - abs(n - m), abs(n - m) // 2)


(a, b) = tuple(map(int, input().split()))
flag = True
ctr = 0
ex = ''
while flag:
	a -= 1
	b -= 1
	ctr += 1
	if a == 0 or b == 0:
		flag = False
ctr2 = 0
x = 0
if a == 0:
	x = b
else:
	x = a
flag2 = True
while flag2:
	if x - 2 >= 0:
		x -= 2
		ctr2 += 1
	else:
		print(ctr, ctr2)
		break


(a, b) = map(int, input().split())
same = int((a + b - abs(a - b)) / 2)
different = int((a + b) // 2 - same)
print(same, ' ', different)


(a, b) = map(int, input().split())
c = max(a, b) - min(a, b)
if c % 2 == 1:
	d = (c - 1) / 2
	print(min(a, b), int(d))
else:
	d = c / 2
	print(min(a, b), int(d))


(n, k) = map(int, input().split())
print(min(n, k), abs(n - k) // 2)


hipsterDays = 0
normalDays = 0
line = [int(n) for n in input().split()]
subtraction = min(line)
hipsterDays = subtraction
line[0] -= subtraction
line[1] -= subtraction
normalDays = int(max(line) / 2)
print(str(hipsterDays) + ' ' + str(normalDays))


(a, b) = map(int, input().split())
x = min(a, b)
a -= x
b -= x
print(x, max(a, b) >> 1)


a = [int(x) for x in input().split()]
b = []
if a[0] > a[1]:
	b.append(a[1])
	a[0] = a[0] - a[1]
	b.append(a[0] // 2)
else:
	b.append(a[0])
	a[1] = a[1] - a[0]
	b.append(a[1] // 2)
print(b[0], end=' ')
print(b[1])


print(' '.join(map(str, (lambda arr: (min(arr), (max(arr) - min(arr)) // 2))(list(map(int, input().split()))))))


l = [int(x) for x in input().split()]
a = l[0]
b = l[1]
x = min(a, b)
a = a - x
b = b - x
y = 0
if a:
	y = y + int(a / 2)
else:
	y = y + int(b / 2)
print(x, y)


(a, b) = map(int, input().split())
(count1, count2) = (0, 0)
if a > b:
	a = a - b
	count1 = count1 + b
	count2 = count2 + int(a / 2)
else:
	b = b - a
	count1 = count1 + a
	count2 = count2 + int(b / 2)
print(count1, count2)


(m, n) = map(int, input().split())
if m > n:
	temp = m
	m = n
	n = temp
n = (n - m) // 2
print(m, n)


socks = [int(i) for i in input().split()]
socks = sorted(socks)
answer = str(socks[0]) + ' ' + str(int((socks[1] - socks[0]) / 2))
print(answer)


(p, q) = [int(x) for x in input().split()]
x = min(p, q)
y = max(p - x, q - x)
z = y // 2
print(x, z)


import math
(a, b) = [int(i) for i in input().split()]
if a > b:
	d = math.floor((a - b) / 2)
	print(b, d)
else:
	d = math.floor((b - a) / 2)
	print(a, d)


x = list(map(int, input().split()))
print(min(x), sum(x) // 2 - min(x))


(r, b) = map(int, input().split())
diff = min(r, b)
r = r - diff
b = b - diff
print(diff, end=' ')
if r == 0:
	print(b // 2)
else:
	print(r // 2)


line = input()
(a, b) = line.split(' ')
a = int(a)
b = int(b)
full_hipster = min(a, b)
wearing_pairs_a = (a - full_hipster) // 2
wearing_pairs_b = (b - full_hipster) // 2
print(f'{full_hipster} {wearing_pairs_a + wearing_pairs_b}')


inp = input().split(' ')
a = int(inp[0])
b = int(inp[1])
temp = min(a, b)
a -= temp
b -= temp
temp1 = 0
if a > 1:
	temp1 = a // 2
else:
	temp1 = b // 2
print(str(temp) + ' ' + str(temp1))


socks = list(map(int, input().split()))
print(min(socks), int(abs(socks[1] - socks[0]) / 2))


(a, b) = map(int, input().split())
k = 0
k2 = 0
while a > 0 and b > 0:
	a -= 1
	b -= 1
	k += 1
if a > 0:
	k2 = int(a // 2)
elif b > 0:
	k2 = int(b // 2)
print(k, k2)


(a, b) = map(int, input().split(' '))
if a > b:
	print(f'{b} {int((a - b) / 2)}')
else:
	print(f'{a} {int((b - a) / 2)}')


(a, b) = map(int, input().split())
if a < b:
	(a, b) = (b, a)
a1 = b
a = a - b
a2 = a // 2
print(a1, a2)


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

def remaining(x, y):
	z = (max(x, y) - min(x, y)) // 2
	print(min(x, y), z)
if a == b:
	print(a, '0')
else:
	remaining(a, b)


(a, b) = map(int, input().split())
d = min(a, b)
D = (max(a, b) - d) // 2
print(d, D)


(a, b) = map(int, input().split())
ans1 = 0
if a == b:
	ans1 = a
else:
	ans1 = min(a, b)
ans2 = 0
x = abs(a - b)
if x <= 1:
	ans2 = 0
else:
	ans2 = x // 2
print(ans1, ans2)


(a, b) = [int(i) for i in input().split()]
m1 = min(a, b)
m2 = max(a, b)
print(m1, (m2 - m1) // 2)


(first, second) = input().split()
first = int(first)
second = int(second)
x = abs(first - second)
if x % 2 == 0:
	if first > second:
		print(second, int(x / 2))
	else:
		print(first, int(x / 2))
elif first > second:
	print(second, int(x / 2))
else:
	print(first, int(x / 2))


s = input()
k = list(map(int, s.split()))
n = k[0]
m = k[1]
fashion = min(k)
single = abs(m - n)
single2 = single // 2
print(str(fashion) + ' ' + str(single2))


(a, b) = map(int, input().split())
first_counter = 0
second_counter = 0
while a != 0 and b != 0:
	first_counter += 1
	a -= 1
	b -= 1
while a >= 2:
	a -= 2
	second_counter += 1
while b >= 2:
	b -= 2
	second_counter += 1
print(first_counter, second_counter)


(a, b) = [int(__) for __ in input().strip().split()]
ans = min(a, b)
a = max(0, a - ans)
b = max(0, b - ans)
print(ans, a // 2 + b // 2)


import math
(a, b) = map(int, input().split())
n1 = min(a, b)
n2 = math.floor(abs(a - b) / 2)
print(n1, n2)


[a, b] = list(map(int, input().split()))
if a < b:
	print(a, b - a >> 1, end='')
else:
	print(b, a - b >> 1, end='')


list1 = list(map(int, input().split()))
(a, b) = (list1[0], list1[1])
s1 = min(a, b)
print(s1, end=' ')
s2 = (max(a, b) - s1) // 2
print(s2)


X = list(map(int, input().split()))
print(str(min(X)), int(abs(X[0] - X[1]) / 2))


(r, b) = map(int, input().split())
a = min(r, b)
a1 = r - a
a2 = b - a
a3 = max(a1, a2)
a4 = a3 // 2
print(a, a4)


(a, b) = map(int, input().split())
d = 0
while a and b:
	b -= 1
	a -= 1
	d += 1
s = 0
while a > 1:
	s += 1
	a -= 2
while b > 1:
	s += 1
	b -= 2
print(d, s)


s = input().split()
a = int(s[0])
b = int(s[1])
ans = str(min(a, b)) + ' ' + str(int((max(a, b) - min(a, b)) / 2))
print(ans)


(a, b) = map(int, input().split())
if a < b:
	smaller = a
	bigger = b
else:
	smaller = b
	bigger = a
d = bigger - smaller
print(smaller, d // 2)


(a, b) = map(int, input().split())
if a > b:
	min = b
	max = a
else:
	min = a
	max = b
print(min, (max - min) // 2)


(a, b) = list(map(int, input().split()))
if a > b:
	res = b
else:
	res = a
print(res, abs(a - b) // 2)


def main():
	(n, m) = [int(v) for v in input().split()]
	diff = min(n, m)
	print(diff, (max(m, n) - diff) // 2)
main()


(a, b) = map(int, input().split())
(days, same) = (0, 0)
if a < b:
	(smaller, bigger) = (a, b)
	days = smaller
	bigger = bigger - smaller
	same += int(bigger / 2)
elif a > b:
	(smaller, bigger) = (b, a)
	days = smaller
	bigger = bigger - smaller
	same += int(bigger / 2)
else:
	days = a
print(days, same)


inp = list(map(int, input().split()))
print(min(inp), end=' ')
print((max(inp) - min(inp)) // 2)


(s, k) = map(int, input().split())
b = abs(s - k) // 2
a = abs((s + k) // 2 - b)
print(a, b)


(a, b) = list(map(int, input().split()))
d = 0
s = 0
if a < b:
	d = a
	b -= a
	s = b // 2
else:
	d = b
	a -= b
	s = a // 2
print('{} {}'.format(d, s))


(a, b) = map(int, input().split())
hip = min(a, b)
nor = abs(a - b) >> 1
print(hip, nor)


(a, b) = map(int, input().split())
if a < b:
	c = a
	p = b - c
	if p <= 1:
		z = 0
	else:
		z = p // 2
	print(c, end=' ')
	print(z)
elif a == b:
	c = a
	z = 0
	print(c, end=' ')
	print(z)
else:
	c = b
	p = a - c
	if p <= 1:
		z = 0
	else:
		z = p // 2
	print(c, end=' ')
	print(z)


string = input().split(' ')
a = int(string[0])
b = int(string[1])
fashion_days = 0
normal_days = 0
if a < b:
	fashion_days = a
	normal_days = (b - a) / 2
else:
	fashion_days = b
	normal_days = (a - b) / 2
print(fashion_days, int(normal_days))


rb = [int(i) for i in input().split()]
(r, b) = (rb[0], rb[1])
day1 = 0
while True:
	if r != 0 and b != 0:
		r -= 1
		b -= 1
		day1 += 1
	else:
		break
socks = max(r, b)
day2 = socks // 2
print(day1, day2)


(p, y) = [int(i) for i in input().split()]
if p <= y:
	u = y - p
	print(p, u // 2)
elif p > y:
	i = p - y
	print(y, i // 2)


import math
(a, b) = map(int, input().split())
d = 0
if a >= b:
	d = b
	a = a - b
	b = 0
	print(d, math.floor(a / 2))
else:
	d = a
	b = b - a
	a = 0
	print(d, math.floor(b / 2))


(red, blue) = map(int, input().strip().split())
days_different_socks = min(red, blue)
days_same_color = (max(red, blue) - days_different_socks) // 2
print('{} {}'.format(days_different_socks, days_same_color))


(a, b) = map(int, input().split())
z = min(a, b)
if z == a:
	b -= a
	y = b // 2
else:
	a -= b
	y = a // 2
print(z, y)


(r, b) = [int(i) for i in input().split()]
f = min(r, b)
s = max(r, b) - min(r, b)
s = (s - s % 2) / 2
print(str(int(f)) + ' ' + str(int(s)))


s = input().split(' ')
s = [int(s[0]), int(s[1])]
print(int(min(s)), ' ', int((int(max(s)) - int(min(s))) / 2))


ab = input()
(a, b) = (int(i) for i in ab.split())
pairs = min(a, b)
odd = (a + b) // 2 - pairs
print(pairs, odd)


I = [int(i) for i in input().split()]
(x, y) = (I[0], I[1])
(z, t) = (min(x, y), max(x, y))
k = (t - z) // 2
l = [z, k]
for i in l:
	print(i, end=' ')


n = list(map(int, input().split(' ')))
a = n[0]
b = n[1]
x3 = min(a, b)
x4 = x3 * 2
a -= x3
b -= x3
x1 = int(a / 2)
x = int(b / 2)
x2 = x1 + x
print(x3, x2)
x3 = min(a, b)


e = input().split(' ')
a = int(e[0])
b = int(e[-1])
x = 0
y = 0
while a + b >= 2:
	if a >= 1 and b >= 1:
		x += 1
		a -= 1
		b -= 1
	elif a >= 2 and b == 0:
		y += 1
		a -= 2
	elif b >= 2 and a == 0:
		y += 1
		b -= 2
print(x, y)


(a, b) = map(int, input().split())
print(min(a, b), end=' ')
print((a + b) // 2 - min(a, b))


(x, y) = map(int, input().split())
c = max(x, y)
d = min(x, y)
print(d, int((c - d) // 2))


(a, b) = input().split()
a = int(a)
b = int(b)
M = max(a, b)
m = min(a, b)
t = (M - m) // 2
print('%d %d' % (m, t))


(a, b) = list(map(int, input().split()))
d = min(a, b)
y = (a + b - 2 * d) // 2
print(d, y)


ab = [int(x) for x in input().split()]
print(min(ab), (max(ab) - min(ab)) // 2)


from sys import *
inp = lambda : stdin.readline()

def main():
	(a, b) = map(int, inp().split())
	if a < b:
		(a, b) = (b, a)
	an1 = min(a, b)
	a -= an1
	print(an1, a // 2)
main()


(r, b) = map(int, input().split())
print(min(r, b), end=' ')
j = max(r, b) - min(r, b)
print(int(j / 2))


(a, b) = map(int, input().split())
f = min(a, b)
diff = abs(a - b)
print(f, diff // 2)


[a, b] = [int(j) for j in input().split()]
if a <= b:
	ans = str(a) + ' '
	b -= a
	num = b // 2
	ans += str(num)
else:
	ans = str(b) + ' '
	a -= b
	num = a // 2
	ans += str(num)
print(ans)


(b, r) = map(int, input().split())
m = min(b, r)
print(m, (b + r - 2 * m) // 2)


(n, m) = map(int, input().split())
s = 0
b = 0
while n > 0 and m > 0:
	n -= 1
	m -= 1
	s += 1
if n > 0:
	for i in range(1, n, 2):
		b += 1
else:
	for i in range(1, m, 2):
		b += 1
print(s, b)


(a, b) = list(map(int, input().split()))
t = (a + b) // 2
c = min(a, b)
print(c, t - c)


import math
(n, m) = input().split()
n = int(n)
m = int(m)
print(min(n, m), abs(n - m) // 2)


(a, b) = map(int, input().split())
diff_pairs = min(a, b)
a -= diff_pairs
b -= diff_pairs
if a:
	same_pairs = a // 2
elif b:
	same_pairs = b // 2
else:
	same_pairs = 0
print(diff_pairs, same_pairs)


(r, b) = map(int, input().split())
c = 0
if r == b:
	print(r, 0)
else:
	print(min(r, b), (max(r, b) - min(r, b)) // 2)


(a, b) = map(int, input().split())
d1 = 0
d2 = 0
if a > b:
	d1 = b
	d2 = int((a - b) / 2)
else:
	d1 = a
	d2 = int((b - a) / 2)
print(d1, d2)


l = list(map(int, input().split()))
if l[0] > l[1]:
	x = l[0] - l[1]
	s1 = l[1]
	if x == 1:
		s2 = 0
	else:
		s2 = x // 2
elif l[0] < l[1]:
	x = l[1] - l[0]
	s1 = l[0]
	if x == 1:
		s2 = 0
	else:
		s2 = x // 2
else:
	s1 = l[0]
	s2 = 0
print(s1, end=' ')
print(s2)


a = list(map(int, input().split()))
m = 0
n = 0
while a[0] > 0 and a[1] > 0:
	a[0] -= 1
	a[1] -= 1
	m += 1
while a[0] > 1 or a[1] > 1:
	a[0] -= 2
	a[1] -= 2
	n += 1
print(m, n)


p = [int(i) for i in input().split()]
q = []
q.append(min(p))
a = max(p) - min(p)
if a / 2 < 1:
	a = 0
q.append(a // 2)
for i in q:
	print(i, end=' ')


(a, b) = input().split()
different = 0
same = 0
a = int(a)
b = int(b)
if a < b:
	different = a
	same = int((b - different) / 2)
else:
	different = b
	same = int((a - different) / 2)
print(different, same)


(a, b) = map(int, input().split())
res1 = min(a, b)
res2 = abs(a - b) // 2
print(res1, res2)


(a, b) = map(int, input().split())
m = min(a, b)
v = abs(a - b) // 2
print(m, v)


(a, b) = map(int, input().split())
if a < b:
	print(a, end=' ')
	b = (b - a) // 2
	print(b)
elif b < a:
	print(b, end=' ')
	a = (a - b) // 2
	print(a)
elif a == b:
	print(a, '0', sep=' ')


(a, b) = [int(x) for x in input().split()]
if a >= b:
	res1 = b
	a -= b
	b = 0
else:
	res1 = a
	b -= a
	a = 0
res2 = int(a / 2) + int(b / 2)
print(res1, res2)


(a, b) = [int(i) for i in input().split()]
a1 = min(a, b)
a -= a1
b -= a1
k = max(a, b)
a2 = int(k / 2)
print('%d %d' % (a1, a2))


(x, y) = [int(x) for x in input().split()]
smaller = min(x, y)
print('%d %d' % (smaller, abs(x - y) // 2))


(a, b) = map(int, input().split())
day1 = 0
day2 = 0
if a < b:
	day1 = a
	b = b - a
	a = 0
	day2 = int(b / 2)
	print(day1, day2)
else:
	day1 = b
	a -= b
	b = 0
	day2 = int(a / 2)
	print(day1, day2)


string = input()
numbers = string.split(' ')
a = int(numbers[0])
b = int(numbers[1])
total = a + b
f = 0
d = 0
while total > 1:
	total -= 2
	d += 1
	if a > 0 and b > 0:
		a -= 1
		b -= 1
		f += 1
d -= f
print(f, d)


(a, b) = map(int, input().split(' '))
mix = min(a, b)
same = (max(a, b) - mix) / 2
print(mix, int(same))


(a, b) = [int(i) for i in input().split()]
first = min(a, b)
if a == first:
	b = b - a
	second = int(b / 2)
else:
	a = a - b
	second = int(a / 2)
print('%d %d' % (first, second))


nums = [int(s) for s in input().split()]
days = 0
while nums[0] > 0 and nums[1] > 0:
	nums[0] -= 1
	nums[1] -= 1
	days += 1
print(days, nums[0] // 2 + nums[1] // 2)


(a, b) = map(int, input().split())
s = []
if a > b:
	s.append(str(b))
	s.append(str(int((a - b) / 2)))
else:
	s.append(str(a))
	s.append(str(int((b - a) / 2)))
print(' '.join(s))


import math
(a, b) = map(int, input().split())
k = max([a, b])
h = min([a, b])
print(h, (k - h) // 2)


sock = list(map(int, input().split()))
actual = min(sock)
rem = int((max(sock) - actual) / 2)
print(actual, rem)


import sys
inf = float('inf')
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
(mod, MOD) = (1000000007, 998244353)
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
(a, b) = get_ints()
maxi = max(a, b)
mini = min(a, b)
ans1 = mini
ans2 = (maxi - mini) // 2
print(ans1, ans2)


(a, b) = (int(i) for i in input().split())
c = ((a - b) ** 2) ** 0.5
d = min(a, b)
e = int(c // 2)
print(d, ' ', e, sep='')


x = input().split()
a = int(x[0])
b = int(x[1])
if a < b:
	c = a
	d = b
	e = b - a
else:
	c = b
	d = a
	e = a - b
print(c, e // 2)


socks = input().split()
import math as m

def pairs(n1, n2):
	if n1 > n2:
		return n2
	else:
		return n1
total = int(socks[0]) + int(socks[1])
stuf = pairs(int(socks[0]), int(socks[1]))
print(stuf, m.floor((total - stuf * 2) / 2))


(m, n) = map(int, input().split())
if m > n:
	print(n, end=' ')
else:
	print(m, end=' ')
print(abs(m - n) // 2)


(z, m) = map(int, input().split())
q = abs(z - m)
Q = q // 2
w = int((z + m - q) / 2)
print(w, Q)


(a, b) = map(int, input().strip().split())
if a > b:
	t = a
	a = b
	b = t
b = (b - a) // 2
print(str(a) + ' ' + str(b))


inp = list(map(int, input().split()))
(red, blue) = (inp[0], inp[1])
hipCount = 0
regCount = 0
while True:
	if red >= 1 and blue >= 1:
		red -= 1
		blue -= 1
		hipCount += 1
	elif red >= 2:
		red -= 2
		regCount += 1
	elif blue >= 2:
		blue -= 2
		regCount += 1
	else:
		break
print(hipCount, regCount)


s = input()
l = list(s.split(' '))
r = int(l[0])
b = int(l[1])
if r > b:
	min = b
	n = (r - b) // 2
else:
	min = r
	n = (b - r) // 2
print(min, n)


s = input()
t = s.split()
(a, b) = list(map(int, t))
if a > b:
	r = a - b
	e = a + b - r
	if e % 2 == 0 and r % 2 == 0:
		print(e // 2, r // 2)
	else:
		print(e // 2, r // 2)
else:
	r = b - a
	e = b + a - r
	if e % 2 == 0 and r % 2 == 0:
		print(e // 2, r // 2)
	else:
		print(e // 2, r // 2)


import re
import math
import copy
(a, b) = [int(i) for i in input().split()]
c = min(a, b)
d = max(a, b)
f = d - c
e = math.floor(f / 2)
print(c, e)


import math
(a, b) = [int(i) for i in input().split()]
m = min(a, b)
a -= m
b -= m
n = math.floor(a / 2) + math.floor(b / 2)
print('{} {}'.format(m, n))


(n, m) = [int(i) for i in input().split()]
q = max(n, m)
r = min(n, m)
t = (q - r) // 2
print(r, t)


import math as m
(a, b) = map(int, input().split())
print(min(a, b), end=' ')
print(m.floor((max(a, b) - min(a, b)) / 2))


(b, c) = map(int, input().split())
x = min(b, c)
y = (max(b, c) - x) // 2
print(x, y)


(a, b) = map(int, input().split())
rez_hip = min(a, b)
rez_norm = (max(a, b) - min(a, b)) // 2
print(rez_hip, rez_norm)


(a, b) = map(int, input().split())
u = min(a, b)
m = max(a, b)
r = (m - u) // 2
print(u, r)


l = [int(x) for x in input().split(' ')]
sum1 = 0
k = min(l)
l = [x - k for x in l]
sum1 = sum1 + k
print(sum1, end=' ')
print(sum(l) // 2)


d = list(map(int, input().split()))
print(min(d), (max(d) - min(d)) // 2)


(red, blue) = map(int, input().split())
print(min(red, blue), (red + blue - 2 * min(red, blue)) // 2, sep=' ')


(a, b) = list(map(int, input().split()))
mini = min(a, b)
remaining = b - a if mini == a else a - b
print(mini, remaining // 2)


ch = input()
a = int(ch[:ch.index(' ')])
b = int(ch[ch.index(' ') + 1:])
dif = 0
while a != 0 and b != 0:
	dif += 1
	a = a - 1
	b = b - 1
same = 0
while a > 1:
	same += 1
	a = a - 2
while b > 1:
	same += 1
	b = b - 2
ch = str(dif) + ' ' + str(same)
print(ch)


(a, b) = input().split()
a = int(a)
b = int(b)
if a <= b:
	min = a
	max = b
else:
	min = b
	max = a
dr = min
do = (max - min) // 2
print(dr, do)


def main():
	(a, b) = map(int, input().strip().split())
	min_val = min(a, b)
	max_val = max(a, b)
	print(f'{min_val} {max_val - min_val >> 1}')
main()


from sys import stdin
input = stdin.readline
(a, b) = map(int, input().split())
c = min(a, b)
a -= c
b -= c
print(c, (a + b) // 2)


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
(a, b) = map(int, input().split())
print(min(a, b), abs(a - b) // 2)


s = input().split()
a = int(s[0])
b = int(s[1])
fst = min(a, b)
snd = (max(a, b) - fst) // 2
print(fst, snd)


(a, b) = map(int, input().split())
z = 0
x = 0
q = 0
if a == b:
	z = a
	x = 0
else:
	if b > a:
		q = a
		a = b
		b = q
	z = b
	x = int(a / 2 - b / 2)
hhh = str(z) + ' ' + str(x)
print(hhh)


(a, b) = map(int, input().split())
dif = a if a < b else b
dif_a = (a - dif) // 2
dif_b = (b - dif) // 2
print('{0} {1}'.format(dif, dif_a + dif_b))


import math
(a, b) = map(int, input().split())
print(str(min(a, b)) + ' ' + str(int(math.floor((a - min(a, b)) / 2)) + int(math.floor((b - min(a, b)) / 2))))


(a, b) = map(int, input().split())
fash = min(a, b)
same = int((max(a, b) - min(a, b)) / 2)
print(fash, same)


(a, b) = map(int, input().split())
day = min((a, b))
c = abs(a - b)
other_day = 0
while True:
	if c == 0 or c == 1:
		print(day, other_day)
		break
	else:
		c -= 2
		other_day += 1


(a, b) = map(int, input().split())
dday = 0
sday = 0
while a != 0 and b != 0:
	a -= 1
	b -= 1
	dday += 1
sday = (a + b) // 2
print(str(dday) + ' ' + str(sday))


import math
(a, b) = map(int, input().split(' '))
if a > b:
	print(b, end=' ')
else:
	print(a, end=' ')
x = math.fabs(a - b)
if x % 2 == 0:
	print(int(x // 2))
else:
	print(int(math.floor(x / 2)))


(n, m) = [int(i) for i in input().split()]
print(min(n, m), end=' ')
print((max(n, m) - min(n, m)) // 2)


socks = list(map(int, input().split()))
print(min(socks), (max(socks) - min(socks)) // 2)


(r, b) = map(int, input().split())
print(min(r, b), end=' ')
a = abs(r - b)
if a <= 1:
	print(0)
else:
	print(a // 2)


from sys import stdin
(blue_socks_number, red_socks_number) = [int(x) for x in stdin.read().rstrip().split()]
min_socks_number = min(blue_socks_number, red_socks_number)
other_socks_pair_number = min_socks_number
blue_socks_number -= min_socks_number
red_socks_number -= min_socks_number
max_socks_number = max(red_socks_number, blue_socks_number)
same_socks_pair_number = max_socks_number // 2
print('{0} {1}\n'.format(other_socks_pair_number, same_socks_pair_number))


(a, b) = [int(x) for x in input().split()]
if a > b:
	print(str(b) + ' ' + str(int((a - b) / 2)))
if b > a:
	print(str(a) + ' ' + str(int((b - a) / 2)))
if a == b:
	print(str(a) + ' ' + str(0))


R = lambda : map(int, input().split())
(a, b) = list(R())
ans1 = min(a, b)
a -= ans1
b -= ans1
t = max(a, b)
ans2 = int(t / 2)
print(ans1, ans2)


(i, j) = input().split()
i = int(i)
j = int(j)
counter1 = 0
counter2 = 0
while i > 0 and j > 0:
	counter1 += 1
	i -= 1
	j -= 1
while i > 1:
	counter2 += 1
	i -= 2
while j > 1:
	counter2 += 1
	j -= 2
print(counter1, counter2)


(n, m) = input('').split(' ')
(n, m) = (int(n), int(m))
print(min(n, m))
if (max(n, m) - min(m, n)) // 2 <= 0:
	print(0)
else:
	print((max(n, m) - min(m, n)) // 2)


inp = input().split()
a = int(inp[0])
b = int(inp[1])
fash = 0
c = True
while c == True:
	if a == 0 or b == 0:
		break
	a = a - 1
	b = b - 1
	fash += 1
total = a + b
print(fash, total // 2)


import math
(a, b) = [int(i) for i in input().split()]
print(min(a, b), end=' ')
left = max(a, b) - min(a, b)
print(math.floor(left / 2))


import sys
try:
	while True:
		(a, b) = map(int, input().split())
		print(str(min(a, b)) + ' ' + str(abs(a - b) // 2))
except EOFError:
	pass


import math
import itertools
gh = lambda : map(int, input().split())
mod = 998244353
mod = int(mod)

def main():
	(x, y) = gh()
	print(min(x, y), (max(x, y) - min(x, y)) // 2)
main()


(a, b) = input().split()
a = int(a, 10)
b = int(b, 10)
if a <= b:
	p1 = a
	p2 = b - a
else:
	p1 = b
	p2 = a - b
print(p1, int(p2 / 2))


(a, b) = map(int, input().split())
diff = min(a, b)
mx = max(a, b)
sm = (mx - diff) // 2
print(diff, sm)


v = [int(x) for x in input().split()]
print(min(v), int((max(v) - min(v)) / 2))


socks = list(map(int, input().split()))
m = min(socks)
socks[0] -= m
socks[1] -= m
socks.sort(reverse=True)
print(m, socks[0] // 2)


x = input().split()
a = int(x[0])
b = int(x[1])
p = []
p.append(a)
p.append(b)
mi = min(p)
ma = max(p)
same = 0
dif = 0
while mi != 0:
	ma -= 1
	same += 1
	mi -= 1
while ma > 1:
	dif += 1
	ma -= 2
print(same, dif)


(n, m) = list(map(int, input().strip().split()))
if n > m:
	print(m, (n - m) // 2)
elif m > n:
	print(n, (m - n) // 2)
else:
	print(n, 0)


import sys
import math
for s in sys.stdin:
	socks = list(map(int, str(s).split(' ')))
	print(min(socks), math.floor((max(socks) - min(socks)) / 2))


(j, k) = map(int, input().split())
df = int(abs(j - k) / 2)
print(min(j, k), df)


(a, b) = map(int, input().split())
m = min(a, b)
print(m, (a + b - m * 2) // 2)


(a, b) = map(int, input().split())
min1 = min(a, b)
ans1 = min1
ans2 = abs(a - b) // 2
print(ans1, ans2)


slist = list(map(int, input().split()))
slist.sort()
print(slist[0], int((slist[1] - slist[0]) / 2))


(R, B) = input().split()
r = int(R)
b = int(B)
f = 0
u = 0
if r >= b:
	for i in range(b):
		r -= 1
		b -= 1
		f += 1
elif b > r:
	for i in range(r):
		r -= 1
		b -= 1
		f += 1
if r > 0:
	u = int(r / 2)
if b > 0:
	u = int(b / 2)
print(f, u)


(a, b) = map(int, input().split())
c = min(a, b)
d = max(a, b)
e = d - c
print(c, int(e * 0.5))


(a, b) = [int(item) for item in input().split()]
print(min(a, b), (max(a, b) - min(a, b)) // 2)


list1 = input().split(' ')
list2 = [int(i) for i in list1]
a = list2[0]
b = list2[1]
if a == b:
	print(a, '0')
if a < b or b < a:
	print(min(list2), (max(list2) - min(list2)) // 2)


(a, b) = [int(x) for x in input().split(' ')]
fash = 0
nub = 0
fash = min(a, b)
nub = abs(a - b) // 2
print(fash, nub)


from sys import stdin, stdout
import math, sys
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
from os import path
import bisect as bi
import heapq

def yes():
	print('YES')

def no():
	print('NO')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

	def I():
		return int(input())

	def In():
		return map(int, input().split())
else:

	def I():
		return int(stdin.readline())

	def In():
		return map(int, stdin.readline().split())

def main():
	try:
		(a, b) = In()
		z = min(a, b)
		a = a - z
		b = b - z
		t = 0
		if a != 0:
			t = a // 2
		elif b != 0:
			t = b // 2
		print(z, t)
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(1):
	main()


a = list(map(int, input().split()))
a.sort()
print(a[0], (a[1] - a[0]) // 2)


import math
l = input().split()
p = []
a = int(l[0])
b = int(l[1])
if a > b:
	p.append(b)
	p.append(math.floor((a - b) / 2))
else:
	p.append(a)
	p.append(math.floor((b - a) / 2))
for i in range(len(p)):
	print(p[i], end=' ')


(red, blue) = map(int, input().split())
print(min(red, blue), end=' ')
diff = abs(red - blue)
if diff == 2:
	print(1)
elif diff == 1:
	print(0)
else:
	count = 0
	while diff >= 2:
		count += 1
		diff -= 2
	print(count)


(a, b) = map(int, input().split())
n = max(a, b)
if max(a, b) - min(a, b) > 1:
	print(min(a, b), (n - min(a, b)) // 2)
else:
	print(a, 0)


n = input()
red_socks = int(n.split()[0])
blue_socks = int(n.split()[1])
first_counter = 0
while red_socks > 0 and blue_socks > 0:
	first_counter += 1
	red_socks -= 1
	blue_socks -= 1
if red_socks > 0:
	blue_socks = red_socks
second_counter = int(blue_socks / 2)
print(str(first_counter) + ' ' + str(second_counter))


(a, b) = map(int, input().split())
d1 = min(a, b)
d2 = (max(a, b) - min(a, b)) // 2
print(d1, d2)


(red, blue) = list(map(int, input().split()))
counter_1 = 0
counter_2 = 0
while red >= 2 or blue >= 2 or (red >= 1 and blue >= 1):
	if red and blue:
		red -= 1
		blue -= 1
		counter_1 += 1
	elif red:
		red -= 2
		counter_2 += 1
	elif blue:
		blue -= 2
		counter_2 += 1
print(counter_1, counter_2)


L = [int(x) for x in input().split()]
print(min(L), (L[0] + L[1] - 2 * min(L)) // 2)


(a, b) = map(int, input().split())
if a > b:
	a = a - b
	res = b
	res2 = a // 2
else:
	b = b - a
	res = a
	res2 = b // 2
print(res, res2)


(a, b) = map(int, input().split())
k = 0
x = min(a, b)
if a > b:
	k = a - b
else:
	k = b - a
l = k // 2
print(x, l)


(a, b) = map(int, input().split())
flag = True
count = 0
count2 = 0
if a > b:
	flag = False
else:
	flag = True
if flag == True:
	while a != 0:
		a = a - 1
		b = b - 1
		count = count + 1
	if b / 2 >= 1:
		while b >= 2:
			b = b - 2
			count2 = count2 + 1
else:
	while b != 0:
		a = a - 1
		b = b - 1
		count = count + 1
	if a / 2 >= 1:
		while a >= 2:
			a = a - 2
			count2 = count2 + 1
print(count, count2)


line = input().split()
r = int(line[0])
b = int(line[1])
x = min(r, b)
r -= x
b -= x
y = max(r // 2, b // 2)
print(x, y)


(n, m) = map(int, input().split())
l = []
l1 = min(n, m)
z = max(n, m) - l1
count = 0
z1 = z // 2
l.append(l1)
l.append(z1)
for i in l:
	print(i, end=' ')


(a, b) = map(int, input().split())
diff = min(a, b)
a -= diff
b -= diff
print(diff, a // 2 + b // 2)


(a, b) = list(map(int, input().split()))
fashion = 0
same = 0
if a > b:
	fashion = b
	same = (a - b) // 2
elif a == b:
	fashion = b
	same = 0
elif a < b:
	fashion = a
	same = (b - a) // 2
ans = '%s %s' % (fashion, same)
print(ans.lstrip())


(a, b) = map(int, input().split())
khacmau = 0
cungmau = 0
A = a
B = b
for i in range(a):
	B -= 1
	A -= 1
	khacmau += 1
	if B == 0:
		break
cungmau = (a + b) / 2 - khacmau
print(khacmau, int(cungmau))


(a, b) = map(int, input().split())
pair = 0
sin = 0
pair += min(a, b)
sin = max(a, b) - min(a, b)
sin = sin // 2
print(pair, sin, end=' ')


ab = input().split()
a = int(ab[0])
b = int(ab[1])
bleh = min(a, b)
a -= bleh
b -= bleh
if a == 0:
	lol = int(b / 2)
else:
	lol = int(a / 2)
print(str(bleh) + ' ' + str(lol))


(n, m) = [int(i) for i in input().split(' ')]
sum = n + m
socks = min(n, m)
sum -= 2 * socks
print(socks, sum // 2)


(n, m) = input().split()
a = int(n)
b = int(m)
print(min(a, b), ' ', int((max(a, b) - min(a, b)) / 2))


ab = [int(x) for x in input().split()]
fashionable = min(ab[0], ab[1])
print(fashionable, int((ab[0] + ab[1] - 2 * fashionable) / 2))


(a, b) = list(map(int, input().split()))
n = min(a, b)
print(n, (a - n) // 2 if a > b else (b - n) // 2)


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

def fi():
	return float(input())

def si():
	return input()

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

def li():
	return list(mi())
import math
(a, b) = mi()
x = min(a, b)
y = (a + b - x * 2) // 2
print(x, y)


__author__ = 'dwliv_000'
(a, b) = (int(i) for i in input().split())
print(min(a, b), (max(a, b) - min(a, b)) // 2)


__author__ = 'artyom'

def main():
	(a, b) = read(3)
	if a > b:
		(b, a) = (a, b)
	return (a, (b - a) // 2)

def read(mode=2, size=None):
	if mode == 0:
		return input().strip()
	if mode == 1:
		return input().strip().split()
	if mode == 2:
		return int(input().strip())
	if mode == 3:
		return list(map(int, input().strip().split()))
	a = []
	for _ in range(size):
		a.append(read(3))
	return a

def write(s='\n'):
	if s is None:
		s = ''
	if isinstance(s, tuple) or isinstance(s, list):
		s = ' '.join(map(str, s))
	s = str(s)
	print(s, end='\n')
res = main()
write(res)


(n, n1) = map(int, input().split())
diff = n - n1
if diff > 0:
	res = n1
	res1 = diff
elif diff < 0:
	res = n
	res1 = n1 - n
else:
	res = n
	res1 = diff
print(res, res1 // 2)


a = input()
b = [int(x) for x in a.split()]
r1 = 0
r2 = 0
s = 0
if b[0] >= b[1]:
	r1 = b[1]
	s = b[0] - b[1]
else:
	r1 = b[0]
	s = b[1] - b[0]
r2 = int(s / 2)
print(r1, r2)


def main():
	(a, b) = map(int, input().split())
	if a < b:
		r = a
		m = b - a
	elif b < a:
		r = b
		m = a - b
	else:
		r = a
		m = 0
	if m % 2 == 0:
		print('{} {}'.format(r, m // 2))
	else:
		print('{} {}'.format(r, (m - 1) // 2))
main()


(a, b) = [int(i) for i in input().split()]
(res1, res2) = (0, 0)
if a > b:
	while b != 0:
		a -= 1
		b -= 1
		res1 += 1
	res2 = a // 2
else:
	while a != 0:
		a -= 1
		b -= 1
		res1 += 1
	res2 = b // 2
print(res1, res2)


(red, blue) = map(int, input().split(' '))
one = 0
two = 0
while red != 0 and blue != 0:
	if red and blue:
		red -= 1
		blue -= 1
		one += 1
while red >= 2:
	red -= 2
	two += 1
while blue >= 2:
	blue -= 2
	two += 1
print(str(one) + ' ' + str(two))


(a, b) = map(int, input().split())
ans = 0
nex = 0
if a >= b:
	ans = b
	nex = (a - b) // 2
else:
	ans = a
	nex = (b - a) // 2
print(ans, nex)


socks = list(map(int, input().split()))
socks.sort()
print(socks[0], (socks[1] - socks[0]) // 2)


(r, b) = [int(i) for i in input().split()]
(p, q) = (min(r, b), max(r, b))
print(p, (q - p) // 2)


import math
queries = [int(i) for i in input().split()]
first = queries[0]
second = queries[1]
maximum = max(queries)
minimum = min(queries)
ans = math.floor((first + second - 2 * minimum) / 2)
print(str(minimum) + ' ' + str(ans))


(red, blue) = map(int, input().split())
day = 0
day1 = 0
while red > 0 and blue > 0:
	red = red - 1
	blue = blue - 1
	day = day + 1
if red >= 2 and blue == 0:
	while red > 1:
		red = red - 2
		day1 = day1 + 1
elif blue >= 2 and red == 0:
	while blue > 1:
		blue = blue - 2
		day1 = day1 + 1
print(day, day1)


(a, b) = [int(i) for i in input().split()]
summ = 0
if a < b:
	summ = a
	b = b - a
else:
	summ = b
	b = a - b
summ1 = b // 2
print(summ, summ1)


n = input()
(n1, n2) = n.split(' ')
diff = 0
same = 0
if int(n1) <= int(n2) and int(n1) != 0:
	diff = int(n1)
elif int(n2) <= int(n1) and int(n2) != 0:
	diff = int(n2)
else:
	diff = 0
n1 = int(n1) - diff
n2 = int(n2) - diff
same += n1 // 2
same += n2 // 2
print(diff, ' ', same)


(a, b) = input().split()
a = int(a)
b = int(b)
m = min(a, b)
x = max(a, b)
r = (x - m) // 2
print(m, r)


(a, b) = map(int, input().split())
k = 0
if a > b:
	k = b
elif a <= b:
	k = a
a = a - k
b = b - k
f = 0
f = a // 2 + b // 2
print(k, f)


import sys
import math
(a, b) = [int(j) for j in input().split()]
print(str(min([a, b])) + ' ' + str(math.floor((max([a, b]) - min([a, b])) / 2)))


(a, b) = map(int, input().split())
ret1 = min([a, b])
a -= ret1
b -= ret1
ret2 = max([a, b]) // 2
print(str(ret1) + ' ' + str(ret2))


from math import floor, ceil, log

def main():
	(a, b) = map(int, input().split())
	print(min(a, b), (max(a, b) - min(a, b)) // 2)
main()


(a, b) = map(int, input().split())
s_tot = 0
d_tot = 0
if a > b:
	a -= b
	d_tot += b
	s_tot += a // 2
else:
	b -= a
	d_tot += a
	s_tot += b // 2
print(f'{d_tot} {s_tot}')


(a, b) = map(int, input().split())
if a > b:
	diff = b
	same = (a - b) // 2
elif a < b:
	diff = a
	same = (b - a) // 2
else:
	diff = a
	same = 0
print(str(diff) + ' ' + str(same))


a = input().split()
b = int(a[0])
c = int(a[1])
if b >= c:
	d = c
else:
	d = b
f = b - c
if f < 0:
	f = -f
g = f // 2
print('%d %d' % (d, g))


(a, b) = map(int, input().split())
days1 = 0
days2 = 0
while a + b > 1 and a and b:
	a -= 1
	b -= 1
	days1 += 1
if not a:
	while b > 1:
		b -= 2
		days2 += 1
else:
	while a > 1:
		a -= 2
		days2 += 1
print(days1, days2)


(r, b) = map(int, input().split())
count = 0
while r - 1 >= 0 and b - 1 >= 0:
	count = count + 1
	r = r - 1
	b = b - 1
if r > 0:
	c = r // 2
elif b > 0:
	c = b // 2
else:
	c = 0
print(str(count) + ' ' + str(c))


(n, m) = input().split()
(n, m) = (int(n), int(m))
if n < m or n == m:
	print(n, (m - n) // 2)
else:
	print(m, (n - m) // 2)


(a, b) = map(int, input().split())
hipster = min(a, b)
total = (a + b - 2 * hipster) // 2
print(hipster, total)


(a, b) = (int(i) for i in input().split())
s = 0
s1 = 0
while a > 0 and b > 0:
	a -= 1
	b -= 1
	s += 1
while a > 1:
	s1 += 1
	a -= 2
while b > 1:
	s1 += 1
	b -= 2
print(s, s1)


(a, b) = map(int, input().split())
abs = lambda x: x if x >= 0 else -x
print(min(a, b), abs(a - b) // 2)


(a, b) = map(int, input().split())
dpair = min(a, b)
spair = (max(a, b) - dpair) // 2
print(dpair, spair)


(A, B) = input().split()
A = int(A)
B = int(B)
if A > B:
	K = A - B
	L = K // 2
	print(B, L)
else:
	K = B - A
	L = K // 2
	print(A, L)


a = list(map(int, input().split()))
d = min(a)
s = (max(a) - min(a)) // 2
print(d, end=' ')
print(s)


(a, b) = map(int, input().split())
c = d = 0
while a >= 1 and b >= 1:
	c += 1
	a -= 1
	b -= 1
d = max(a, b) // 2
print(c, d)


from collections import deque, Counter
import array
from itertools import combinations, permutations
from math import sqrt
import unittest

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

def read_int_array():
	return [int(i) for i in input().strip().split(' ')]
(a, b) = read_int_array()
print(min(a, b), (a + b - 2 * min(a, b)) // 2)


(a, b) = [int(i) for i in input().split()]
if a >= b:
	m = b
	n = a - b
else:
	m = a
	n = b - a
print(str(m) + ' ' + str(n // 2))


s = str(input())
(a, b) = [int(elt) for elt in s.split(' ')]
if a == b:
	print(a, '0')
else:
	(a, b) = (max([a, b]), min([a, b]))
	print('{} {}'.format(b, (a - b) // 2))


n = input('')
n = n.split(' ')
red = int(n[0])
blue = int(n[1])
ausgabe = ''
diffrent = 0
same = 0
if red < blue:
	diffrent = red
	same = int((blue - (blue - red) % 2 - red) / 2)
if blue < red:
	diffrent = blue
	same = int((red - (red - blue) % 2 - blue) / 2)
if blue == red:
	diffrent = blue
if same < 0:
	same = 0
print(str(diffrent) + ' ' + str(same))


(x, y) = map(int, input().split())
z = abs(x - y)
l = min(x, y)
print(l, end=' ')
print(z // 2)


a = input().split()
dif = min(int(a[0]), int(a[1]))
res = (int(a[0]) + int(a[1])) // 2 - dif
print(dif, res)


def days(a, b):
	different = min(a, b)
	remain = max(a, b) - different
	ans = 0
	while remain > 1:
		remain -= 2
		ans += 1
	print(different, ans)
x = list(map(int, input().rstrip().split()))
a = x[0]
b = x[1]
days(a, b)


(r, b) = map(int, input().split())
mx = max(r, b)
mi = min(r, b)
print(mi, (mx - mi) // 2)


s = input()
a = []
for i in s.split(' '):
	a.append(int(i))
print(min(a[0], a[1]), int(abs(a[0] - a[1]) / 2))


(n, m) = map(int, input().split())
count = 0
if n > m:
	x = n - m
	y = int(x / 2)
	print(m, end=' ')
	print(y, end='')
elif n == m:
	print(m, end=' ')
	print(count, end='')
elif m > n:
	x = m - n
	y = int(x / 2)
	print(n, end=' ')
	print(y, end='')


(x, y) = input().split()
red = int(x)
blue = int(y)
normal = 0
same = 0
while red > 0 and blue > 0:
	if blue > 0:
		red -= 1
		blue -= 1
		normal += 1
while red > 1 or blue > 1:
	if red > 1:
		red -= 2
		same += 1
	else:
		blue -= 2
		same += 1
print(normal, same)


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
sys.setrecursionlimit(100000000)
ii = lambda : int(input())
si = lambda : input()
jn = lambda x, l: x.join(map(str, l))
sl = lambda : list(map(str, input().strip()))
mi = lambda : map(int, input().split())
mif = lambda : map(float, input().split())
lii = lambda : list(map(int, input().split()))
ceil = lambda x: int(x) if x == int(x) else int(x) + 1
ceildiv = lambda x, d: x // d if x % d == 0 else x // d + 1
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))
mod = 1000000007
(a, b) = mi()
count = min(a, b)
a -= count
b -= count
sol = 0
if a > 0:
	sol = a // 2
elif b > 0:
	sol = b // 2
print(count, sol)


(k, b) = map(int, input().split())
h = 0
l = min(k, b)
u = max(k, b)
print(l, (u - l) // 2)


(a, b) = input().split()
a = int(a)
b = int(b)
mi = min(a, b)
ma = a + b - mi
print(mi, (ma - mi) // 2, end=' ')


line = input().split()
(r, b) = (int(line[0]), int(line[1]))
d = min(r, b)
s = max(r, b) - d >> 1
print(d, s)


import sys
(a, b) = input().strip().split(' ')
(a, b) = [int(a), int(b)]
main = min(a, b)
same = max(a, b)
same = same - main
same = int(same / 2)
print('{} {}'.format(main, same))


tup = tuple(map(int, input().split()))
(mn, mx) = (min(tup), max(tup))
print(mn, (mx - mn) // 2)


(a, b) = map(int, input().split(' '))
if a == 0 or b == 0:
	print(0, 0)
else:
	left = abs(a - b) // 2
	diff = min(a, b)
	print(diff, left)


n = input().split()
a = int(n[0])
b = int(n[1])
if a < b:
	x = a
	y = (b - a) // 2
	print(x, y)
elif a > b:
	x = b
	y = (a - b) // 2
	print(x, y)
else:
	print(a, 0)


def main():
	(a, b) = map(int, input().split(' '))
	if a == b:
		print(a, 0)
	else:
		print(min(a, b), (max(a, b) - min(a, b)) // 2)
main()


n = input().split()
for i in range(len(n)):
	n[i] = int(n[i])
n.sort()
print(n[0], int((n[1] - n[0]) / 2))


(a, b) = list(map(int, input().split()))
q = min(a, b)
w = max(a, b) - min(a, b)
e = w // 2
print(q, e)


(red, blue) = [int(x) for x in input().split()]
diff_pair = min(red, blue)
same_pair = int((max(red, blue) - diff_pair) / 2)
print(diff_pair, same_pair)


ipt = [int(x) for x in input().split()]
a = ipt[0]
b = ipt[1]
print(min(a, b), (max(a, b) - min(a, b)) // 2)


s = list(map(int, input().split()))
p = min(s)
s[0] = s[0] - p
s[1] = s[1] - p
q = 0
if s[0] == 0:
	q = s[1] // 2
elif s[1] == 0:
	q = s[0] // 2
print(str(p) + ' ' + str(q))


(a, b) = [int(s) for s in input().split()]
c = abs(a - b)
if a > b:
	print(b, c // 2)
else:
	print(a, c // 2)


(b, r) = [int(i) for i in input().split()]
print('%d %d' % (min(b, r), (max(b, r) - min(b, r)) // 2))


(r, b) = map(int, input().split())
c = 0
n = 0
while r > 0 and b > 0:
	r = r - 1
	b = b - 1
	c = c + 1
if r > 1:
	n = r // 2
if b > 1:
	n = b // 2
print(c, n)


x = n = c = 1
(x, n) = [int(c) for c in input().split()]
sum = 0
if x > n:
	sum = x - n
	sum /= 2
	print(n, int(sum))
elif x == n:
	sum = n - x
	sum /= 2
	print(n, int(sum))
elif n > x:
	sum = n - x
	sum /= 2
	print(x, int(sum))


(a, b) = map(int, input().split())
diff = 0
same = 0
if a < b:
	diff = a
	if b - a != 1:
		same = (b - a) // 2
	else:
		same = 0
elif b < a:
	diff = b
	if a - b != 1:
		same = (a - b) // 2
	else:
		same = 0
else:
	diff = a
	same = 0
print(diff, same, end='')


n = input().split()
nred = int(n[0])
nblue = int(n[1])
M = max(nred, nblue)
m = min(nred, nblue)
print(m, int((M - m) / 2))


(n, m) = map(int, input().split())
x = min(n, m)
y = max(m, n)
print(str(x) + ' ' + str(int((y - x) / 2)))


het = 1
het = 0
s = input().split()
x = int(s[0])
x1 = int(s[1])
het = min(x, x1)
het1 = abs(x - x1) // 2
print(het, het1)


lis = list(map(int, input().split()))
lis.sort()
(l, m) = lis
sol = int((m - l - (m - l) % 2) / 2)
print(l, sol)


(a, b) = map(int, input().split())
cnt1 = min(a, b)
cnt2 = (max(a, b) - min(a, b)) // 2
print(cnt1, cnt2)


import sys
val = 0
minval = sys.maxsize
maxval = -1 * sys.maxsize
list1 = list(map(int, input().split()))
for i in range(len(list1)):
	if minval > list1[i]:
		minval = list1[i]
	if maxval < list1[i]:
		maxval = list1[i]
print(minval, end=' ')
print(int((maxval - minval) / 2))


(red, blue) = [int(i) for i in input().split()]
fashion = min(red, blue)
ordinary = abs(red - blue) // 2
print(fashion, ordinary)


(a, b) = map(int, input().split())
days1 = 0
days2 = 0
if a > b and a != 0 and (b != 0):
	while b > 0:
		a = a - 1
		days1 += 1
		b = b - 1
	while a > 1:
		a = a - 2
		days2 += 1
elif b > a and a != 0 and (b != 0):
	while a > 0:
		b = b - 1
		a = a - 1
		days1 += 1
	while b > 1:
		b = b - 2
		days2 += 1
elif a == 0 and b == 0:
	days1 = 0
	days2 = 0
elif a == b:
	while a > 0 and b > 0:
		a = a - 1
		b = b - 1
		days1 += 1
print(str(days1) + ' ' + str(days2))


k = list(map(int, input().split()))
n = int(k[0])
m = int(k[1])
p = min(k)
s = max(k)
t = (s - p) // 2
print(p, end=' ')
print(t)


(a, b) = [int(x) for x in input().split()]
pair = min(a, b)
remain = int((max(a, b) - min(a, b)) / 2)
print(pair, remain)


(a, b) = input().split()
a = int(a)
b = int(b)
x = min(a, b)
y = (max(a, b) - min(a, b)) // 2
print(x, y)


(r, b) = list(map(int, input().split()))
if r >= b:
	num_days = b
	c = r - b
	pairs = c // 2
else:
	num_days = r
	c = b - r
	pairs = c // 2
print(num_days, pairs)


(a, b) = (int(x) for x in input().split())
print(min(a, b), end=' ')
leftover = max(a, b) - min(a, b)
print(leftover // 2)


(x, y) = [int(i) for i in input(' ').split()]
lyst = [x, y]
n = min(lyst)
m = int((max(lyst) - min(lyst)) // 2)
print(n, m)


(a, b) = map(int, input().split())
x = min(a, b)
print(x, end=' ')
if x == a:
	p = b - a
if x == b:
	p = a - b
print(int(p / 2))


a = input().split()
print(min(int(a[0]), int(a[1])), abs(int(a[0]) - int(a[1])) // 2)


(a, b) = input().split()
a = int(a)
b = int(b)
days_diffsocks = 0
while a != 0 and b != 0:
	a -= 1
	b -= 1
	days_diffsocks += 1
if a != 0:
	restliche = int(a / 2)
else:
	restliche = int(b / 2)
print(days_diffsocks, restliche)


socks = [int(x) for x in input().split()]
if socks[0] >= socks[1]:
	n1 = socks[1]
	socks[0] -= n1
	n = 0
else:
	n1 = socks[0]
	socks[1] -= n1
	n = 1
print(n1, socks[n] // 2)


(a, b) = map(int, input().split(' '))
f = min(a, b)
sober = max(a, b) - min(a, b)
r = int(sober / 2)
print(f'{f} {r}')


(a, b) = input().split()
a = int(a)
b = int(b)
if a >= b:
	fashion_day = b
	normal_day = int((a - b) / 2)
else:
	fashion_day = a
	normal_day = int((b - a) / 2)
print(f'{fashion_day} {normal_day}')


(a, b) = input().split()
a = int(a)
b = int(b)
k = a + b - 2 * min(a, b)
print(min(a, b), k // 2)


n = input().split(' ')
g = int(n[0])
f = int(n[1])
l = min(g, f)
s = g - l
k = f - l
r = (s + k) // 2
print(l, r)


(a, b) = sorted(map(int, input().split()))
if a < b:
	print(a, (b - a) // 2)
else:
	print(a, (a - b) // 2)


def main():
	(a, b) = [int(i) for i in input().split()]
	print(min(a, b), abs(a - b) // 2)
main()


(a, b) = map(int, input().split())
t = min(a, b)
s = max(a, b) - t
print(t, s // 2)


(x, y) = input().split()
x = int(x)
y = int(y)
if (x, y != 0):
	z = abs(x - y)
	z = int(z / 2)
	print(str(min(x, y)) + ' ' + str(z))


input_s = input().split(' ')
a = int(input_s[0])
b = int(input_s[1])
number_min = min(a, b)
number_max = max(a, b)
print('{} {}'.format(number_min, (number_max - number_min) // 2))


s = list(map(int, input().split()))
s.sort()
print(s[0], int((s[1] - s[0]) / 2))


x = list(map(int, input().split()))
if x[0] <= x[1]:
	print(x[0])
if x[0] > x[1]:
	print(x[1])
c = abs(x[0] - x[1])
if c == 0:
	print('0')
else:
	print(c // 2)


(a, b) = list(map(int, input().split()))
print(min(a, b), end=' ')
print((max(a, b) - min(a, b)) // 2)


inp = input().split()
blue = int(inp[0])
red = int(inp[1])
different = min(blue, red)
print(different, end=' ')
last = max(blue, red) - different
last //= 2
print(last)


a = input()
jo = 0
a = a.split(' ')
for huy in range(int(len(a))):
	a[huy] = int(a[huy])
if a[0] > a[1] and jo == 0:
	c = a[1]
	for i in range(a[1]):
		if a[1] > 0:
			a[1] -= 1
			a[0] -= 1
	a[0] = a[0] // 2
	print(c, a[0])
	jo = 1
if a[1] > a[0] and jo == 0:
	c = a[0]
	for i in range(a[0]):
		if a[0] > 0:
			a[0] -= 1
			a[1] -= 1
	a[1] = a[1] // 2
	print(c, a[1])
	jo = 1
if a[1] == a[0] and jo == 0:
	print(a[1], 0, sep=' ')
	jo = 1


l = []
n = input()
a = 0
b = 0
c = 0
l = n.split(' ')
for i in range(len(l)):
	l[i] = int(l[i])
a = min(l)
b = max(l)
c = int((b - a) / 2)
print(a, end=' ')
print(c)


(a, b) = map(int, input().split())
p = min(a, b)
q = (max(a, b) - min(a, b)) // 2
print(p, end=' ')
print(q)


(a, b) = input().split()
a = int(a)
b = int(b)
day_1 = str(min(a, b))
day_2 = str(int((max(a, b) - min(a, b)) / 2))
print(day_1 + ' ' + day_2)


(a, b) = map(int, input().split())
c = 0
check = min(a, b)
check1 = max(a, b)
c = check1 - check
count = 0
while c > 1:
	c -= 2
	count += 1
print(check, count)


import sys
(a, b) = map(int, sys.stdin.readline().split())
different = min(a, b)
a -= different
b -= different
same = max(a, b) // 2
print('{} {}'.format(different, same))


def read_array():
	x = []
	x1 = []
	x = input()
	x = x.split(' ')
	for r in range(len(x)):
		x1.append(int(x[r]))
	return x1

def result(x):
	res = []
	if min(x) != 0:
		res.append(min(x))
	else:
		res.append(0)
	new = abs(x[0] - x[1]) // 2
	res.append(new)
	return res
x = read_array()
res = result(x)
for v in res:
	print(v, end=' ')


s = input().split()
(a, b) = (int(s[0]), int(s[1]))
x = min(a, b)
y = int((a + b) / 2) - x
print(x, y)


line = input().split()
a = int(line[0])
b = int(line[1])
if a == b:
	day1 = a
	day2 = 0
elif a > b:
	day1 = b
	day2 = (a - b) // 2
elif a < b:
	day1 = a
	day2 = (b - a) // 2
print(day1, day2)


Num = list(map(int, input().split()))
dif_day = min(Num)
Num.sort()
same_day = int((Num[1] - Num[0]) / 2)
result = '{} {}'.format(dif_day, same_day)
print(result)


n = list(map(int, input().split()))
print(min(n), sum(n) // 2 - min(n))


(s1, s2) = map(int, input().split())
s = abs(s1 - s2) // 2
d = int((s1 + s2 - abs(s1 - s2)) / 2)
print(d, s)


(a, b) = [int(x) for x in input().split(' ')]
p = min(a, b)
a = a - p
b = b - p
q = max(a // 2, b // 2)
print(' '.join([str(p), str(q)]))


(blue, red) = tuple(map(int, input().split()))
pair = (max(blue, red) - min(blue, red)) // 2 if max(blue, red) - min(blue, red) >= 2 else 0
print(min(blue, red), pair)


(a, b) = map(int, input().split())
value = 0
while a > 0 and b > 0:
	a -= 1
	b -= 1
	value += 1
print(value, b // 2 if b > a else a // 2)


(m, n) = map(int, input().split())
print(abs(max(m, n) - abs(m - n)), abs(int((m - n) / 2)))


def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())
import collections as c

def solve():
	(A, B) = getInts()
	if A > B:
		(A, B) = (B, A)
	ans = (A, (B - A) // 2)
	print(*ans)
solve()


(a, b) = map(int, input().split())
tim = a - b
z = tim / 2
z = int(z)
if z < 0:
	z = z * -1
if a > b:
	print(b, z)
else:
	print(a, z)


def function1(r, b):
	return str(min(r, b)) + ' ' + str(abs(r - b) // 2)

def main():
	(red, blue) = list(map(int, input().split()))
	print(function1(red, blue))
main()


(a, b) = map(int, input().split())
mi = min(a, b)
ma = max(a, b)
same = ma - mi
if same >= 2:
	res = same // 2
else:
	res = 0
print(mi, res)


num = input().split()
a = int(num[0])
b = int(num[1])
ans = []
if a >= b:
	ans.append(str(b))
	ans.append(str(int((a - b) / 2)))
else:
	ans.append(str(a))
	ans.append(str(int((b - a) / 2)))
print(' '.join(ans))


import sys
numbers = [int(i) for i in sys.stdin.readline().split()]
a = numbers[0]
b = numbers[1]
different_colour = min(a, b)
a -= different_colour
b -= different_colour
print('%d %d' % (different_colour, int((a + b) / 2)))


l = input().split()
x = int(l[0])
y = int(l[1])
fashion = 0
nofashion = 0
while x and y != 0:
	x = x - 1
	y = y - 1
	fashion = fashion + 1
while x != 1 and x != 0:
	x = x - 2
	nofashion = nofashion + 1
while y != 1 and y != 0:
	y = y - 2
	nofashion = nofashion + 1
print(str(fashion) + ' ' + str(nofashion))


def hipster():
	(a, b) = list(map(int, input().split()))
	a1 = min(a, b)
	a2 = (max(a, b) - min(a, b)) // 2
	print(a1, a2)
hipster()


(a, b) = map(int, input().split())
c = abs(a - b)
d = max(a, b) - c
h = (max(a, b) - d) // 2
print(d, h)


(red, blue) = map(int, input().split())
days_both = 0
days_lonely = 0
if red > blue:
	days_both = blue
	days_lonely = (red - blue) // 2
else:
	days_both = red
	days_lonely = (blue - red) // 2
print(days_both, days_lonely)


s = input().split(' ')
a = int(s[0])
b = int(s[1])
if a > b:
	m = b
	n = (a - b) // 2
	print(m, n, sep=' ')
else:
	m = a
	n = (b - a) // 2
	print(m, n, sep=' ')


ab = list(map(int, input().split()))
a = ab[0]
b = ab[1]
print(min(ab), end=' ')
c = max(ab) - min(ab)
print(c // 2)


(a, b) = input().split(' ')
a = int(a)
b = int(b)
different = None
same = None
if a - b != 0 or a - b != 0:
	calc = a - b if a - b > 0 else b - a
	different = b if b < a else a
	if calc > 1:
		check = calc % 2
		if check != 0:
			same = int((calc - check) / 2)
		else:
			same = int(calc / 2)
	else:
		same = 0
else:
	different = a
	same = 0
print(f'{different} {same}')


(a, b) = map(int, input().split())
equalAmount = min(a, b)
onlyOne = (max(a, b) - equalAmount) // 2
print(equalAmount, onlyOne)


(n, m) = map(int, input().split())
x = min(n, m)
y = abs(n - m)
y = int(y / 2)
print('{} {}'.format(x, y))


(a, b) = list(map(int, input().split()))
res = min(a, b)
print(res, (max(a, b) - res) // 2)


(a, b) = [int(x) for x in input().split()]
if a < b:
	(a, b) = (b, a)
print(f'{b} {(a - b) // 2}')


arr = list(map(int, input().split()))
print(min(arr), end=' ')
print((max(arr) - min(arr)) // 2)


a = input().split()
red = int(a[0])
blue = int(a[1])
if red >= blue:
	b = blue
	c = int((red - blue) / 2)
else:
	b = red
	c = int((blue - red) / 2)
print(str(b) + ' ' + str(c))


args = input().split(' ')
for i in range(0, len(args)):
	args[i] = int(args[i])
print(str(min(args)) + ' ' + str(int((max(args) - min(args)) / 2)))


(red_socks, blue_socks) = list(map(int, input().split()))
if red_socks >= blue_socks:
	days_alternate_socks = blue_socks
	red_socks -= days_alternate_socks
	blue_socks -= days_alternate_socks
	days_matching_socks = red_socks // 2
else:
	days_alternate_socks = red_socks
	red_socks -= days_alternate_socks
	blue_socks -= days_alternate_socks
	days_matching_socks = blue_socks // 2
print(days_alternate_socks, days_matching_socks)


ab = tuple(map(int, input().split()))
r = ab[0]
b = ab[1]
fash = 0
sme = 0
while r > 0 and b > 0:
	fash += 1
	r -= 1
	b -= 1
mx = max(r, b)
while mx > 1:
	sme += 1
	mx -= 2
print(fash, sme)


(red_socks, blue_socks) = map(int, input().split())
balance = max(red_socks, blue_socks) - min(red_socks, blue_socks)
print(min(red_socks, blue_socks), balance // 2)


line = [int(j) for j in input().split()]
t = min(line)
a = line[1] + line[0] - 2 * t
p = int(a / 2)
print(t, p)


n = list(map(int, input().split()))
p = min(n)
q = int((max(n) - p) / 2)
print(p, q)


(red, blue) = input().split()
red = int(red)
blue = int(blue)
minSocks = min(red, blue)
(red, blue) = (red - minSocks, blue - minSocks)
print(minSocks, (red + blue) // 2)


(a, b) = [int(i) for i in input().split()]
dpairs = 0
dsame = 0
while a > 0 and b > 0:
	b -= 1
	a -= 1
	dpairs += 1
dsame += a // 2 + b // 2
print(dpairs, dsame)


(a, b) = [int(a) for a in input().split()]
ans1 = min(a, b)
ans2 = (max(a, b) - ans1) // 2
print('{} {}'.format(ans1, ans2))


s = input().split(' ')
(a, b) = (int(s[0]), int(s[1]))
c = min(a, b)
a -= c
b -= c
d = (a + b) // 2
print(str(c) + ' ' + str(d))


a = [int(i) for i in input().split(' ')]
x = a[0]
y = a[1]
if x > y:
	print(y, end=' ')
	x = x - y
	print(x // 2)
else:
	print(x, end=' ')
	y = y - x
	print(y // 2)


(a, b) = map(int, input().split())
if a <= b:
	D = a % b or (a + b) // 2
	S = (b - a) // 2
	print(D, S)
else:
	D1 = b % a
	S1 = (a - b) // 2
	print(D1, S1)


a = [int(i) for i in input().split()]
print(min(a), int(sum(a) / 2) - min(a))


(n, k) = map(int, input().split())
if n > k:
	print(k, end=' ')
	l = k
else:
	print(n, end=' ')
	l = n
l = abs(n - k) // 2
print(l)


(a, b) = map(int, input().split())
res1 = min(a, b)
res2 = (max(a, b) - min(a, b)) // 2
print('%d %d' % (res1, res2))


(a, b) = [int(x) for x in input().strip().split(' ')]
fashion = 0
days = 0
while a > 0 or b > 0:
	if a > 0 and b > 0:
		a -= 1
		b -= 1
		fashion += 1
	elif a > 0:
		if a < 2:
			break
		a -= 2
		days += 1
	elif b > 0:
		if b < 2:
			break
		b -= 2
		days += 1
print('{} {}'.format(fashion, days))


def main():
	(a, b) = [int(x) for x in input().split()]
	if a > b:
		small = b
	else:
		small = a
	ans = abs(a - b) // 2
	print(small, ans)
main()


(a, b) = [int(i) for i in input().split()]
odnocvet = 0
if a < b:
	razn = a
	print(razn, (b - a) // 2)
elif a > b:
	razn = b
	print(razn, (a - b) // 2)
else:
	razn = (a + b) // 2
	print(razn, 2 % 2)


import math
(r, b) = map(int, input().split())
fash = pair = 0
fash = min(r, b)
da = max(r, b)
pair = math.floor((da - fash) / 2)
print(fash, pair)


def vasyaHipster(a, b):
	no_days = min(a, b)
	same_sock = (max(a, b) - no_days) // 2
	print(no_days, same_sock)
(a, b) = map(int, input().split())
vasyaHipster(a, b)


def solve():
	(a, b) = [int(s) for s in input().split()]
	(m, nm) = (0, 0)
	m = min(a, b)
	nm = (max(a, b) - m) // 2
	print(m, nm)
solve()


(a, b) = map(int, input().split())
v1 = min(a, b)
v2 = a + b - v1 - v1
print(v1, v2 // 2)


import math
(a, b) = list(map(int, input().split()))
print(min(a, b), abs(a - b) // 2)


(n, m) = map(int, input().split())
if n == m:
	print(str(n) + ' ' + '0')
elif n > m:
	dif = n - m
	rest = int(dif / 2)
	print(str(m) + ' ' + str(rest))
elif n < m:
	dif = m - n
	rest = int(dif / 2)
	print(str(n) + ' ' + str(rest))


[a, b] = [int(n) for n in input().split()]
print(min(a, b), abs(a - b) // 2)


user_input = list(map(int, input().split()))
min_val = min(user_input)
balance = 0
for item in user_input:
	if min_val != item:
		balance = item - min_val
print(min_val, balance // 2)


def socks(a, b):
	fashion = min(a, b)
	a -= fashion
	b -= fashion
	if a != 0:
		single = a // 2
	else:
		single = b // 2
	print(fashion, single)
ab = input().split()
a = int(ab[0])
b = int(ab[1])
socks(a, b)


(a, b) = map(int, input().split())
ost = abs(a - b)
moda = min(a, b)
count = 0
for i in range(2, ost + 1):
	if i % 2 == 0:
		count += 1
print(moda, count)


def solve(i):
	return str(min(i)) + ' ' + str((max(i) - min(i)) // 2)
print(solve(list(map(int, input().split(' ')))))


socks = input().split()
socks = [int(i) for i in socks]
socks_d = [x - min(socks) for x in socks]
print(min(socks), int(sum(socks_d) / 2))


(n, k) = map(int, input().split())
if n == 1 and k == 1:
	print(1, 0)
else:
	print(min(n, k), abs(n - k) // 2)


a = input().split()
(l, r) = (int(a[0]), int(a[1]))
print(min(l, r), (max(l, r) - min(l, r)) // 2)


(x, y) = map(int, input().split())
t = min(x, y)
m = max(x, y)
k = m - t
print(t, k // 2)


(a, b) = map(int, input().split())
countd = 0
counts = 0
while a > 0 or b > 0:
	if a > 0 and b > 0:
		countd = countd + 1
		a = a - 1
		b = b - 1
	elif a >= 2 and b == 0:
		counts = counts + 1
		a = a - 2
	elif a == 0 and b >= 2:
		counts = counts + 1
		b = b - 2
	else:
		a = 0
		b = 0
print(countd, counts)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nlargest, nsmallest, _heapify_max, _heapreplace_max
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from fractions import Fraction
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
(a, b) = sp()
(a, b) = (min(a, b), max(a, b))
out(a, (b - a) // 2)


(a, b) = map(int, input().split())
k1 = min(a, b)
t = max(a, b) - k1
k2 = t // 2
print(k1, k2)


inp = input()
lis = list((int(i) for i in inp.split()))
print(min(lis), end=' ')
diff = max(lis) - min(lis)
print(diff // 2)


A = input().split()
a = int(A[0])
b = int(A[1])
c = min(a, b)
d = abs(int((b - a) / 2))
print(c, d)


(a, b) = map(int, input().split())
r = min(a, b)
o = (max(a, b) - min(a, b)) // 2
print(r, o)


(a, b) = input().split(' ')
a = int(a)
b = int(b)
mi = min(a, b)
ma = max(a, b)
k = (ma - mi) // 2
print(mi, k)


L1 = list(map(int, input().split()))
print(min(L1), (max(L1) - min(L1)) // 2)


(a, b) = map(int, input().split(' '))
fash = min(a, b)
left = (max(a, b) - fash) // 2
print(fash, left)


import sys
import math
a = list(input().split())
a = [int(i) for i in a]
maax = max(a)
miin = min(a)
x = maax - miin
print(maax - x, end=' ')
print(x // 2)


def maxDays(a, b):
	return ' '.join((str(i) for i in [a, (b - a) // 2]))
(a, b) = map(int, input().split())
print(maxDays(min(a, b), max(a, b)))


(red, blue) = map(int, input().split())
print('%d %d' % (min(red, blue), (max(red, blue) - min(red, blue)) / 2))


f = lambda : map(int, input().split())
(a, b) = f()
k = []
if a > b:
	k.append(b)
	e = a - b
	r = e // 2
	k.append(r)
	print(*k)
elif b > a:
	k.append(a)
	e = b - a
	r = e // 2
	k.append(r)
	print(*k)
else:
	print(a, 0)


import itertools as it
import functools
import operator
import collections
import math
import sys

def solve(a, b):
	return (min(a, b), abs(a - b) // 2)

def main():
	[a, b] = [int(i) for i in input().strip().split()]
	(red, blue) = solve(a, b)
	print(red, blue)
main()


(a, b) = map(int, input().split())
maxi = max(a, b)
mini = a + b - maxi
print(mini, (maxi - mini) // 2)


(n, m) = map(int, input().split())
if n > m:
	ans1 = m
	ref = n - m
else:
	ans1 = n
	ref = m - n
if ref % 2 == 0:
	ans2 = int(ref / 2)
else:
	ans2 = int((ref - 1) / 2)
print(ans1, ans2)


import math
inp = input()
inp = inp.split(' ')
red = int(inp[0])
blue = int(inp[1])
diff_days = min(red, blue)
same_days = math.floor((max(red, blue) - diff_days) / 2)
print(str(diff_days) + ' ' + str(same_days))


(r, b) = map(int, input().split())
count1 = 0
count2 = 0
if r >= b:
	x = r - b
	y = x // 2
	count1 = count1 + b
	count2 = count2 + y
if b > r:
	x = b - r
	y = x // 2
	count1 = count1 + r
	count2 = count2 + y
print(count1, end=' ')
print(count2)


(a, b) = [int(i) for i in input().strip().split(' ')]
ab_min = a
ab_same = int((b - a) / 2)
if b < a:
	ab_min = b
	ab_same = int((a - b) / 2)
print('{} {}'.format(ab_min, ab_same))


(x, y) = map(int, input().split())
m = min(x, y)
s = x + y - 2 * m
l = s // 2
print(m, l)


(n, k) = list(map(int, input().split()))
a = min(n, k)
s = max(n, k)
f = (s - a) // 2
print(a, f)


import sys, math, string
input = sys.stdin.readline
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
(a, b) = M()
print(min(a, b), max(a - min(a, b), b - min(a, b)) // 2)


l = list(map(int, input().split()))
l.sort()
m = l[0]
l[1] = l[1] - m
n = l[1] // 2
print(str(m) + ' ' + str(n))


(a, b) = map(int, input().split())
res = min(a, b)
res1 = (max(a, b) - min(a, b)) // 2
print(res, res1)


(a, b) = input().split()
(a, b) = (int(a), int(b))
ans1 = min(a, b)
(a, b) = (a - ans1, b - ans1)
left = max(a, b)
if left == 1:
	ans2 = 0
else:
	ans2 = int(left / 2)
print(ans1, ans2)


(n1, n2) = map(int, input().split())
(m1, m2) = (min(n1, n2), max(n1, n2))
print(m1, (m2 - m1) // 2)


(a, b) = map(int, input().split())
different_count = 0
if a >= b:
	different_count = b
elif b >= a:
	different_count = a
same_count = abs(b - a) // 2
print(different_count, same_count)


(a, b) = [int(i) for i in input().split()]
nfashion = min(a, b)
nhave = (a + b - 2 * nfashion) // 2
print(nfashion, nhave)


(a, b) = map(int, input().split())
a1 = 0
b1 = 0
while True:
	if a > 0 and b > 0:
		a -= 1
		b -= 1
		a1 += 1
	elif a > 1 and b == 0:
		a -= 2
		b1 += 1
	elif b > 1 and a == 0:
		b -= 2
		b1 += 1
	else:
		break
print(a1, b1)


(r, b) = [int(i) for i in input().split()]
f = min(r, b)
a = max(r, b) - f
print(f, end=' ')
if a > 0:
	print(a // 2)
else:
	print(0)


import random
import time
m = 0
nm = 0
a = input().split()
k = int(a[0])
s = int(a[1])
m = min(k, s)
nm = abs(k - s)
print(m, nm // 2)


n = input()
ns = n.split()
r = int(ns[0])
b = int(ns[1])
a = min(r, b)
if r > b:
	h = r - b
	d = h // 2
else:
	h = b - r
	d = h // 2
print(a, d)


a = input().split()
b = int(a[0])
r = int(a[1])
if b > r:
	(r, b) = (b, r)
print(b, (r - b) // 2)


(a, b) = map(int, input().split())
d = 0
while min(a, b) > 0:
	a -= 1
	b -= 1
	d += 1
print(d, max(a, b) // 2)


sock = [int(i) for i in input().split()]
a = sock[0]
b = sock[1]
na = min(a, b)
nb = max(a - na, b - na)
print(str(na) + ' ' + str(int(0.5 * nb)))


inp = [int(x) for x in input().split()]
a = inp[0]
b = inp[1]
if a < b:
	print(a, end=' ')
	remainder = b - a
	print(remainder // 2)
else:
	print(b, end=' ')
	remainder = a - b
	print(remainder // 2)


(a, b) = map(int, input().split())
a1 = min(a, b)
print(a1, end=' ')
print((max(a, b) - a1) // 2)


def hipster(a, b):
	return (min(a, b), abs(a - b) // 2)
print(*hipster(*map(int, input().split())))


import math
a = [int(x) for x in input().split()]
n1 = min(a)
n2 = math.floor((sum(a) - 2 * min(a)) / 2)
print(n1, n2)


s = input()
n = [int(i) for i in s.split()]
a = n[0]
b = n[1]
if a < b:
	my = [a, int((b - a) / 2)]
else:
	my = [b, int((a - b) / 2)]
print(*my)


(a, b) = map(int, input().split())
z = 0
while a != 0 and b != 0:
	z += 1
	a -= 1
	b -= 1
x = a // 2 + b // 2
print(z, x)


(a, b) = map(int, input().split())
if a <= b:
	b -= a
	print('{} {}'.format(a, b // 2))
else:
	a -= b
	print('{} {}'.format(b, a // 2))


(a, b) = map(int, input().split())
different_socks = min(a, b)
if different_socks == a:
	color = a
else:
	color = b
if color == a:
	extra_socks = b - a
else:
	extra_socks = a - b
extra_days = extra_socks // 2
total_days = different_socks + extra_days
print(different_socks, extra_days)


import math
(a, b) = input().split(' ')
a = int(a)
b = int(b)
c = b if a > b else a
n = abs(a - b) // 2
print(c, n)


(a, b) = input().split()
(a, b) = (int(a), int(b))
print(min(a, b), end=' ')
i = 0
k = max(a, b) - min(a, b)
while k > 1:
	k -= 2
	i += 1
print(i)


def main():
	(n, m) = map(int, input().split())
	a = n if n < m else m
	b = abs(n - m) // 2
	print(a, b)
main()


n = list(map(int, input().split()))
r1 = min(n[0], n[1])
d = max(n[0], n[1]) - min(n[0], n[1])
c = 0
while d > 1:
	d = d - 2
	c = c + 1
print(r1, end=' ')
print(c)


[a, b] = [int(x) for x in input().split()]
fashion = min(a, b)
rest = abs(a - b) // 2
print(fashion, rest)


import math
import array
arr1 = array.array('l', [])
arr2 = array.array('l', [])
arr1 = [int(j) for j in input().split()]
a = arr1[0]
b = arr1[1]
q = abs(a - b)
qq = int(q / 2)
if a >= b:
	p = int(a - q)
	arr2.append(p)
else:
	p = int(b - q)
	arr2.append(p)
arr2.append(qq)
print(*arr2)


(red, blue) = map(int, input().split())
minsock = min(red, blue)
fd = abs(red - blue) // 2
print(minsock, fd)


inp = input().split()
a = int(inp[0])
b = int(inp[1])
print(min(a, b), end=' ')
print(abs(a - b) // 2)


(a, b) = map(int, input().split())
i = 0
c = 0
c1 = min(a, b)
c2 = max(a, b)
for i in range(min(a, b)):
	while a != 0 and b != 0:
		a = a - 1
		b = b - 1
		c = c + 1
d = (c2 - c) / 2
d = int(d)
print(c, d, end='')


(a, b) = input().split()
a = int(a)
b = int(b)
day1 = 0
day2 = 0
num = min(a, b)
day1 += num
a -= num
b -= num
if a == 0:
	var = b
else:
	var = a
while var > 0:
	if var == 1:
		break
	day2 += 1
	var -= 2
print(str(day1) + ' ' + str(day2))


(a, b) = map(int, input().split())
if a > b:
	x = a - b
	x = int(x // 2)
	print(b, x)
else:
	x = b - a
	x = int(x // 2)
	print(a, x)


line = input()
a = int(line.split(' ')[0])
b = int(line.split(' ')[1])
if a < b:
	t = a
	a = b
	b = t
print(b, int((a - b) / 2))


inp = input().split()
inp = [int(x) for x in inp]
print(f'{min(inp)} {(max(inp) - min(inp)) // 2}')


(x, y) = sorted(map(int, input().split()))
print(x, end=' ')
print((y - x) // 2, end='')


def main():
	(a, b) = [int(x) for x in input().split()]
	x = abs(a - b)
	result = '{} {}'.format(min(a, b), x // 2)
	print(result)
main()


(a, b) = map(int, input().split())
D2 = abs(a - b) // 2
D = (a + b) // 2
D1 = D - D2
print(D1, D2)


(a, b) = map(int, input().split())
chm = 0
chost = 0
while b != 0 and a > 0 or (a != 0 and b > 0):
	a -= 1
	b -= 1
	chm += 1
chost = a // 2 + b // 2
print(chm, chost)


arr = list(map(int, input().split()))
ans1 = min(arr)
ans2 = (max(arr) - ans1) // 2
print(ans1, ans2)


l = list(map(int, input().split()))
s = min(l)
a = l[0]
b = l[1]
k = 0
if a == s:
	b = b - a
	k = k + int(b // 2)
else:
	a = a - b
	k = k + int(a // 2)
print(s, k)


__author__ = 'Bian'
(a, b) = [int(x) for x in input().split()]
print(min(a, b), end=' ')
print(int((a + b - 2 * min(a, b)) / 2))


(a, b) = map(int, input().split(' '))
k = 0
k1 = 0
while a != 0 and b != 0:
	k += 1
	a -= 1
	b -= 1
if a == 0:
	k1 = int(b / 2)
else:
	k1 = int(a / 2)
print(k, k1)


(a, b) = map(int, input().split())
if a < b:
	s = a
	b = b - a
	a = 0
else:
	s = b
	a = a - b
	b = 0
r = 0
if a > 0:
	r = a // 2
if b > 0:
	r = b // 2
print(s, r)


import math
(s, n) = [int(t) for t in input().split()]
M = max(s, n)
m = min(s, n)
if M - m != 0:
	M = math.floor((M - m) / 2)
else:
	M = 0
print(m, M)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	(a, b) = LI()
	r = min(a, b)
	t = (max(a, b) - r) // 2
	return '{} {}'.format(r, t)
print(main())


(a, b) = map(int, input().split())
dif = min(a, b)
more = max(a, b) - dif
print(dif, more // 2)


l = list(map(int, input().split()))
c = l.index(max(l))
print(l[1 - c], end=' ')
print(abs(l[0] - l[1]) // 2)


li = list(map(int, input().split()))
m = max(li)
mi = min(li)
print(mi, (m - mi) // 2)


(a, b) = map(int, input().split())
pair = 0
if a < b:
	small = a
else:
	small = b
if a == 0:
	pair = 0
	days = b
elif b == 0:
	pair = 0
	days = a
else:
	for i in range(small):
		if a != 0 and b != 0:
			a = a - 1
			b = b - 1
			pair += 1
			if a == 0:
				days = b
			elif b == 0:
				days = a
print(pair, days // 2)


inp1 = list(map(int, input().split()))
out = min(inp1)
out1 = max(inp1)
out2 = (out1 - out) // 2
if inp1[0] * inp1[1] != 0:
	print(out, out2)
else:
	print(0, out2)


(a, b) = list(map(int, input().split()))
c = min(a, b)
z = abs(a - b) // 2
print(c, z)


import sys

def solve():
	(a, b) = [int(x) for x in input().split(' ')]
	fashion_days = min(a, b)
	dull_days = int((max(a, b) - min(a, b)) // 2)
	return str(fashion_days) + ' ' + str(dull_days)
ans = solve()
print(ans)


(r, b) = map(int, input().split())
different = min(r, b)
a = max(r, b)
same = (a - different) // 2
print(different, same)


(a, b) = map(int, input().split())
smaller = min([a, b])
larger = max([a, b])
print(str(smaller) + ' ' + str((larger - smaller) // 2))


(r, b) = map(int, input().split())
if r < b:
	z = r
	b -= r
	l = b // 2
elif r == b:
	z = r
	l = 0
else:
	z = b
	r -= b
	l = r // 2
print(z, l)


(a, b) = [int(i) for i in input().split()]
print(min(a, b), (a + b - 2 * min(a, b)) // 2)


s = [int(i) for i in input().split()]
s.sort()
a = s[0]
b = (s[1] - s[0]) // 2
print(a, b)


(n, m) = map(int, input().split())
q = min(n, m)
w = max(n, m)
r = (w - q) // 2
print(q, r)


(reds, blues) = tuple(map(int, input().split()))
max_diff = min(reds, blues)
max_same = (max(reds, blues) - min(reds, blues)) // 2
print(max_diff, max_same)


(a, b) = [int(x) for x in input().split()]
gr = a if a > b else b
sm = a if a < b else b
print(sm, end=' ')
gr = gr - sm
print(gr // 2)


x = [int(i) for i in input().split()]
if x[0] > x[1]:
	(x[0], x[1]) = (x[1], x[0])
sisa = abs(x[1] - x[0])
print(x[0], sisa // 2)


(a, b) = [int(v) for v in input().split()]
print(min(a, b), abs(a - b) // 2)


s = input().split()
a = int(s[0])
b = int(s[1])
m1 = max(a, b)
m2 = min(a, b)
if m1 - m2 > 1:
	normal = (m1 - m2) // 2
	print(m2, normal)
else:
	print(m2, 0)


(x, y) = map(int, input().split())
s = 0
c = 0
while 1:
	if x == 0 or y == 0:
		break
	else:
		x -= 1
		y -= 1
		c += 1
if x != 0:
	s = s + x // 2
if y != 0:
	s = s + y // 2
print(c, s)


socks = input().split(' ')
red = int(socks[0])
blue = int(socks[1])
print('%d %d' % (min(red, blue), (max(red, blue) - min(red, blue)) / 2))


(a, b) = map(int, input().split())
m = min(a, b)
if a > b:
	d = a - b
elif b > a:
	d = b - a
else:
	d = 0
if d % 2 == 0:
	z = int(d / 2)
else:
	z = int((d - 1) / 2)
print(str(m) + ' ' + str(z))


data = input()
arr = data.split(' ')
n = int(arr[0])
m = int(arr[1])
answer1 = min(n, m)
end = (max(n, m) - answer1) // 2
print(answer1, end)


x = [*map(int, input().split())]
print(min(x[0], x[1]), (max(x[0], x[1]) - min(x[0], x[1])) // 2)


(r, b) = map(int, input().split())
count = 0
count1 = 0
if b > r:
	temp = b
	b = r
	r = temp
count = count + b
r = r - b
count1 = count1 + r // 2
print(f'{count} {count1}')


import sys
n = input().split()
n = list(map(int, n))
n.sort()
result = (n[1] - n[0]) // 2
print(str(n[0]) + ' ' + str(result))


(z, s) = map(int, input().split())
print(min(z, s), (max(z, s) - min(z, s)) // 2)


(a, b) = input().split()
a = int(a)
b = int(b)
d = min(a, b)
e = abs(int(a) - int(b))
f = int(d)
g = int(e) // 2
print(f, g)


a = input().split()
i1 = int(a[0])
i2 = int(a[1])
if i1 > i2:
	o1 = i2
	o2 = int((i1 - i2) / 2)
else:
	o1 = i1
	o2 = int((i2 - i1) / 2)
print(o1, o2)


a = input().split()
b = int(a[0])
c = int(a[1])
d = min(b, c)
e = max(b, c)
f = e - d
if f % 2 == 0 or (f - 1) % 2 == 0:
	z = f // 2
print(d, z)


(a, b) = map(int, input().split())
t = min(a, b)
b = max(a, b)
a = t
b -= a
if b & 1 == 1:
	b -= 1
b //= 2
print(a, b)


(a, b) = map(int, input().split())
if a <= b:
	j = int((b - a) / 2)
	print(a, j)
else:
	j = int((a - b) / 2)
	print(b, j)


l = list(map(int, input().split()))
(a, b) = (l[0], l[1])
if a > b:
	p = b
	q = (a - b) // 2
	print(p, q)
else:
	p = a
	q = (b - a) // 2
	print(p, q)


(a, b) = list(map(int, input().strip().split(' ')))
res1 = min(a, b)
res2 = (max(a, b) - min(a, b)) // 2
print('{} {}'.format(res1, res2))


(a, b) = [int(c) for c in input().split()]
ans1 = min(a, b)
ans2 = (a + b - ans1 * 2) // 2
print(ans1, ans2)


def inputsocks(a, b):
	mixedpairs = min((a, b))
	singlesocks = max((a, b)) - mixedpairs
	singlepairs = int(singlesocks / 2)
	return (mixedpairs, singlepairs)
(a, b) = [int(x) for x in input().split()]
results = inputsocks(a, b)
print(results[0], results[1])


(red_socks, blue_socks) = map(int, input().split(' '))
same_pairs = 0
if blue_socks > red_socks:
	same_pairs = (blue_socks - red_socks) // 2
elif red_socks > blue_socks:
	same_pairs = (red_socks - blue_socks) // 2
print('{max_days} {same_pairs}'.format(max_days=min(red_socks, blue_socks), same_pairs=same_pairs))


l = list(map(int, input().split()))
a = l[0]
b = l[1]
x = 0
y = 0
if a < b:
	x = a
	a = 0
	b = b - x
	if b >= 2:
		y = int(b / 2)
elif b < a:
	x = b
	b = 0
	a = a - x
	if a >= 2:
		y = int(a / 2)
else:
	x = a
	y = 0
print(x, y)


__author__ = 'Admin'
(a, b) = map(int, input().split())
ans1 = 0
ans2 = 0
if a > b:
	ans1 = b
	ans2 = (a - b) // 2
elif a == b:
	ans1 = a
else:
	ans1 = a
	ans2 = (b - a) // 2
print(ans1, ans2)


li = list(map(int, input().split()))
(r, b) = (li[0], li[1])
maxi = min(r, b)
ans = max(r, b) - min(r, b)
mini = ans // 2
print(maxi, mini)


n = input().split()
(n[0], n[1]) = (int(n[0]), int(n[1]))
n.sort()
print(n[0], end=' ')
print(int((int(n[1]) - int(n[0])) / 2))


from sys import stdin
(a, b) = map(int, stdin.readline().split())
res1 = min(a, b)
print(res1, (max(a, b) - res1) // 2)


(x, z) = map(int, input().split())
print(min(x, z), (max(x, z) - min(x, z)) // 2)


l = list(map(int, input().strip().split()))
a = l[0]
b = l[1]
count = 0
cnt = 0
x = 0
if a < b:
	count = count + a
	b = b - a
	cnt = cnt + b // 2
else:
	count = count + b
	a = a - b
	cnt = cnt + a // 2
print(count, end=' ')
print(cnt)


y = [int(i) for i in input().split()]
print(min(y), end=' ')
print((max(y) - min(y)) // 2)


(n, m) = input('').split(' ')
n = int(n)
m = int(m)
if n < m:
	print(n, (m - n) // 2)
elif m < n:
	print(m, (n - m) // 2)
else:
	print(n, 0)


(red, blue) = map(int, input().split())
different = min(red, blue)
a = max(red, blue)
same = (a - different) // 2
print(different, same)


m = [int(i) for i in input().split()]
a = m[0]
b = m[1]
if a > b:
	a = a - b
	print(b, int(a / 2))
elif b > a:
	b = b - a
	print(a, int(b / 2))
else:
	print(a, '0')


(a, b) = list(map(int, input().split()))
n = 0
while a > 0 and b > 0:
	n += 1
	a -= 1
	b -= 1
d = 0
if a > b:
	if a % 2 != 0:
		a -= 1
		a = a / 2
		a = int(a)
		for i in range(a):
			d += 1
			a -= 2
	else:
		a = a / 2
		a = int(a)
		for i in range(a):
			d += 1
			a -= 2
if b > a:
	if b % 2 != 0:
		b -= 1
		b = b / 2
		b = int(b)
		for i in range(b):
			d += 1
			b -= 2
	else:
		b = b / 2
		b = int(b)
		for i in range(b):
			d += 1
			b -= 2
print(n, d)


(a, b) = map(int, input().split())
d1 = min(a, b)
d2 = (a + b - 2 * d1) // 2
print(f'{d1} {d2}')


(a, b) = map(int, input().split())
greater = max(a, b)
lesser = min(a, b)
print(lesser, (greater - lesser) // 2)


a = str(input())
a = a.split(' ')
b = list(map(int, a))
val = ''
cont = 0
if b[0] >= b[1]:
	val = val + f'{b[1]}'
	cont = b[0] - b[1]
	if cont % 2 == 0:
		val = val + f' {round(cont / 2)}'
	else:
		cont = cont - 1
		val = val + f' {round(cont / 2)}'
elif b[0] <= b[1]:
	val = val + f'{b[0]}'
	cont = b[1] - b[0]
	if cont % 2 == 0:
		val = val + f' {round(cont / 2)}'
	else:
		cont = cont - 1
		val = val + f' {round(cont / 2)}'
print(val)


p = input().split()
r = int(p[0])
b = int(p[1])
ans1 = min(r, b)
ans2 = int((max(r, b) - min(r, b)) / 2)
print(ans1, ans2)


n = input().split()
red = int(n[0])
blue = int(n[1])
if red == blue:
	day1 = red
	day2 = 0
elif red > blue:
	day1 = blue
	dif = red - blue
	if dif <= 1:
		day2 = 0
	else:
		day2 = dif // 2
else:
	day1 = red
	dif = blue - red
	if dif <= 1:
		day2 = 0
	else:
		day2 = dif // 2
print('{} {}'.format(day1, day2))


(a, b) = list(map(int, input().split()))
d1 = min(a, b)
d2 = abs(a - b) // 2
print('%d %d' % (d1, d2))


import sys

def main():
	(red, blue) = map(int, sys.stdin.readline().split())
	count = 0
	while red > 0 and blue > 0:
		red -= 1
		blue -= 1
		count += 1
	sys.stdout.write(f'{count} ')
	count *= 0
	max_ele = max(red, blue)
	while max_ele > 0 and max_ele >= 2:
		max_ele -= 2
		count += 1
	sys.stdout.write(f'{count}')
main()


from math import *
from time import *
from calendar import *
(a, b) = [int(x) for x in input().split()]
if a > b:
	(a, b) = (b, a)
print(a, int((b - a) / 2))


n = list(map(int, input().split()))
M = max(n)
m = min(n)
leave = M - m
print(m, leave // 2)


(a, b) = map(int, input().split())
if b < a:
	c = b
	d = a - b
	if d % 2 == 0:
		d /= 2
	else:
		d -= 1
		d /= 2
elif a < b:
	c = a
	d = b - a
	if d % 2 == 0:
		d /= 2
	else:
		d -= 1
		d /= 2
else:
	c = b
	d = 0
print(c, int(d))


from math import floor
(a, b) = map(int, input().split())
withDiffPairs = min(a, b)
withSameColors = floor((max(a, b) - min(a, b)) / 2)
print(withDiffPairs, withSameColors)


(left, right) = map(int, input().split())
print(min(left, right), (max(left, right) - min(left, right)) // 2)


a = list(map(float, input().strip().split()))[:2]
print(int(min(a)), int(max((a[0] - min(a)) / 2, (a[1] - min(a)) / 2)))


import math
import os
import random
import re
import sys
ab = input().split()
a = int(ab[0])
b = int(ab[1])
if a < b:
	c = b - a
	d = c // 2
	print(a, d)
else:
	c = a - b
	d = c // 2
	print(b, d)


(a, b) = [int(i) for i in input().split()]
t1 = min(a, b)
t2 = (max(a, b) - t1) // 2
print(t1, t2)


(a, b) = input().split()
a = int(a)
b = int(b)
s = a + b
f = min(a, b)
r = s - 2 * f
if int(r % 2) == 0:
	g = int(r / 2)
else:
	g = int(r / 2)
print(str(f) + ' ' + str(g))


a = list(map(int, input().split()))
b = True
c = 0
e = a[0]
g = a[1]
s = 0
m = 0
while b:
	if g == 0:
		m = int(e / 2)
		s -= 1
		b = False
	elif e == 0:
		m = int(g / 2)
		s -= 1
		b = False
	s += 1
	e -= 1
	g -= 1
print('%d %d' % (s, m))


l = [int(i) for i in input().split()]
mini = min(l)
left = max(l) - min(l)
z = left // 2
print(mini, z)


(r, b) = input().split()
r = int(r)
b = int(b)
a = [r, b]
print(min(a), (max(a) - min(a)) // 2)


def vasya(a, b):
	res = []
	x = min(a, b)
	res.append(str(x))
	y = max((a - x) // 2, (b - x) // 2)
	res.append(str(y))
	return ' '.join(res)
(a, b) = map(int, input().split(' '))
print(vasya(a, b))


a = input().split()
s = int(a[0])
d = int(a[1])
i = min(s, d)
print(i, (s + d - i * 2) // 2)


(red, blue) = map(int, input().split())
hipster = 0
nhipster = 0
for i in range(red + blue):
	if red > 0 and blue > 0:
		red -= 1
		blue -= 1
		hipster += 1
	elif red == 0 and blue > 1:
		blue -= 2
		nhipster += 1
	elif red > 1 and blue == 0:
		red -= 2
		nhipster += 1
	else:
		print(hipster, nhipster)
		exit()
print(hipster, nhipster)


import math
n = [int(i) for i in input().split()]
a = n[0]
b = n[1]
c = min(a, b)
d = math.floor((max(a, b) - min(a, b)) / 2)
print(c, d)


from math import floor
(a, b) = map(int, input().split())
c = 0
if a > b:
	c = floor((a - b) / 2)
	print(b, c)
else:
	c = floor((b - a) / 2)
	print(a, c)


import math
(a, b) = list(map(int, input().split()))
if a > b:
	s = b
	d = math.floor((a - b) / 2)
elif b > a:
	s = a
	d = math.floor((b - a) / 2)
elif a == b:
	s = a
	d = 0
print(s, d)


def maxx(a, b):
	if a >= b:
		return a
	else:
		return b

def minn(a, b):
	if a <= b:
		return a
	else:
		return b
(a, b) = [int(x) for x in input().split()]
sur = maxx(a, b) - minn(a, b)
print(str(minn(a, b)) + ' ' + str(int(sur / 2)))


import math
from bisect import bisect_left, bisect, bisect_right
from itertools import accumulate

def index(a, x):
	i = bisect_left(a, x)
	if i != len(a) and a[i] == x:
		return i
	raise ValueError

def find_lt(a, x):
	i = bisect_left(a, x)
	if i:
		return a[i - 1]
	raise ValueError

def find_le(a, x):
	i = bisect_right(a, x)
	if i:
		return a[i - 1]
	raise ValueError

def find_gt(a, x):
	i = bisect_right(a, x)
	if i != len(a):
		return a[i]
	raise ValueError

def find_ge(a, x):
	i = bisect_left(a, x)
	if i != len(a):
		return a[i]
	raise ValueError
st = ''

def func(a, b):
	diff = min(a, b)
	a -= diff
	b -= diff
	s = str(diff)
	s += ' ' + str(a // 2 + b // 2)
	return s
pos = neg = 0
for _ in range(1):
	(a, b) = map(int, input().split())
	st += str(func(a, b)) + '\n'
print(st)


a = list(map(int, input().split()))
print(str(min(a)) + ' ' + str((max(a) - min(a)) // 2))


inp = input()
(a, b) = map(int, inp.split())
i = 0
j = 0
while a > 0 and b > 0:
	a -= 1
	b -= 1
	i += 1
r = max(a, b)
while r > 1:
	r -= 2
	j += 1
print(i, j)


l = input().split()
a = int(l[0])
b = int(l[1])
if a > b:
	max = a
	min = b
else:
	max = b
	min = a
max = max - min
max = max // 2
print(str(min) + ' ' + str(max))


import math
(a, b) = map(int, input().split())
dh = min(a, b)
dnh = abs(a - b) // 2
print(dh, dnh)


f = 0
d = 0
l = [int(num) for num in input().split()]
while l[0] > 0 and l[1] > 0:
	l[0] -= 1
	l[1] -= 1
	d += 1
if l[0] > 0:
	while l[0] > 1:
		l[0] -= 2
		f += 1
if l[1] > 0:
	while l[1] > 1:
		l[1] -= 2
		f += 1
print(d, f)


l = sorted([int(x) for x in input().split()])
print(l[0], (l[1] - l[0]) // 2)


(red, blue) = [int(i) for i in input().split()]
print(min(red, blue), (max(red, blue) - min(red, blue)) // 2)


import math

def solution(*args):
	(red, blue) = args
	print(min(red, blue), math.floor(abs(red - blue) / 2))
solution(*map(lambda x: int(x), input().split()))


(a, b) = input().split()
a = int(a)
b = int(b)
ans = abs(a - b)
ans //= 2
print(min(a, b), ans)


(n, m) = [int(s) for s in input().split(' ')]
maxnumber = max(n, m)
minnumber = min(n, m)
print(str(minnumber) + ' ' + str(round((maxnumber - minnumber) / 2 // 1)))


from math import *
(s, d) = input().split()
s = int(s)
d = int(d)
f = (max(s, d) - min(s, d)) // 2
c = min(s, d)
print(c, f)


n = input()
n = n.split()
a = int(n[0])
b = int(n[1])
c = 0
d = 0
if a > b:
	c = a - b
	d = a - c
	print(d, end=' ')
	print(c // 2)
elif b > c:
	c = b - a
	d = b - c
	print(d, end=' ')
	print(c // 2)


n = list(map(int, input().split()))
if n[0] >= n[1]:
	diff = n[1]
else:
	diff = n[0]
same = int(abs(n[0] - n[1]) / 2)
print(diff, same)


import math
(a, b) = [int(x) for x in input().split()]
n = abs(a - b)
c = int(n / 2)
print(min(a, b), int(n / 2))


(a, b) = input().split()
a = int(a)
b = int(b)
if a != b:
	min_m = min(a, b)
	max_m = max(a, b)
	print(min_m, int((max_m - min_m) / 2))
else:
	print(a, 0)


import math
(a, b) = map(int, input().split())
x = min(a, b)
y = max(a, b)
z = (y - x) / 2
z = math.floor(z)
print(x, z)


x = list(map(int, input().split()))
diff = 0
same = 0
s = 0
i = 0
while x[0] != 0 and x[1] != 0:
	if x[0] != 0 and x[1] != 0:
		diff += 1
		x[0] -= 1
		x[1] -= 1
s = x[0] + x[1]
s = s // 2
same = s
print(diff, s)


numSocksInputArray = input().split()
numRedSocks = int(numSocksInputArray[0])
numBlueSocks = int(numSocksInputArray[1])
maxValue = 0
numMixedDays = 0
numRemainingDays = 0
if numRedSocks > numBlueSocks:
	numMixedDays = numBlueSocks
	maxValue = numRedSocks
	print(str(int(numMixedDays)) + ' ' + str(int((maxValue - numMixedDays) / 2)))
elif numBlueSocks > numRedSocks:
	numMixedDays = numRedSocks
	maxValue = numBlueSocks
	print(str(int(numMixedDays)) + ' ' + str(int((maxValue - numMixedDays) / 2)))
elif numBlueSocks == numRedSocks:
	print(str(int(numBlueSocks)) + ' ' + str(int(0)))


(a, b) = map(int, input().split())
f = min(a, b)
print(f, (a + b) // 2 - f)


from math import *

def main():
	(redSocks, blueSocks) = input().split()
	blueSocks = int(blueSocks)
	redSocks = int(redSocks)
	extraSocks = 0
	if redSocks > blueSocks:
		print(blueSocks, end=' ')
		redSocks -= blueSocks
		extraSocks = redSocks
	else:
		print(redSocks, end=' ')
		blueSocks -= redSocks
		extraSocks = blueSocks
	extraPairs = floor(extraSocks / 2)
	print(extraPairs)
	return ()
main()


(a, b) = map(int, input().split())
count = 0
e = 0
while a > 0 and b > 0:
	a -= 1
	b -= 1
	count += 1
e += a // 2
e += b // 2
print(count, e)


raw = input().split()
(red, blue) = (int(raw[0]), int(raw[1]))
if red > blue:
	big = red
	small = blue
else:
	big = blue
	small = red
print('{} {}'.format(small, (big - small) // 2))


s = input()
t = s.index(' ')
o = int(s[0:t])
p = int(s[t + 1:len(s)])
print(min(o, p), ' ', int(int(max(o, p) - min(o, p)) / 2))


ab = list(map(int, input().split()))
print(min(ab), (max(ab) - min(ab)) // 2)


(a, b) = map(int, input().split())
dh = min(a, b)
d = (max(a, b) - min(a, b)) // 2
print(dh, d)


(a, b) = (int(i) for i in input().split(' '))
dif = min(a, b)
a -= dif
b -= dif
same = a // 2 + b // 2
print(dif, same)


import math
(a, b) = [int(i) for i in input().split()]
A = []
A.append(str(min(a, b)))
A.append(' ')
A.append(str(math.floor((max(a, b) - min(a, b)) / 2)))
print(''.join(A))


(n, k) = map(int, input().split())
if k > n:
	(n, k) = (k, n)
a = int((n - k) / 2)
print(k, a)


l = list(map(int, input().split(' ')))
a = l[0]
b = l[1]
if a >= b:
	diff = b
	b = 0
	a = a - diff
	same = int(a / 2)
else:
	diff = a
	a = 0
	b = b - diff
	same = int(b / 2)
print(diff, same)


(b, r) = list(map(int, input().split()))
if b > r:
	print('{0} {1}'.format(r, (b - r) // 2))
elif r > b:
	print('{0} {1}'.format(b, (r - b) // 2))
else:
	print('{0} {1}'.format(b, 0))


(a, b) = map(int, input().split(' '))
i = int(0)
j = int(0)
while (a > 0) & (b > 0):
	a = a - 1
	b = b - 1
	i = i + 1
while a > 1 or b > 1:
	a = a - 2
	b = b - 2
	j = j + 1
print(i, '', j)


maxi = [int(x) for x in input().split()]
import math
print(str(min(maxi)) + ' ' + str(math.floor(abs(maxi[0] - maxi[1]) / 2)))


l = list(map(int, input().split()))
a = max(l)
b = min(l)
a -= b
print(b, a // 2, sep=' ')


from __future__ import division
s = input().split(' ')
r = int(s[0])
b = int(s[1])
print(min(r, b), (max(r, b) - min(r, b)) // 2)


import math
(x, y) = input().split()
x = int(x)
y = int(y)
f = min(x, y)
w = math.floor(abs(x - y) / 2)
print(f, w)


str = input()
l = list(str.split())
l[0] = int(l[0])
l[1] = int(l[1])
if l[0] > l[1]:
	val1 = l[1]
	val2 = int((l[0] - l[1]) / 2)
else:
	val1 = l[0]
	val2 = int((l[1] - l[0]) / 2)
print(val1, val2, end='')


(a, b) = input().split()
a = int(a)
b = int(b)
temp = max(a, b) - min(a, b)
print(min(a, b), temp // 2)


(a, b) = input().split(' ')
a = int(a)
b = int(b)
days = 0
while a >= 1 and b >= 1:
	days = days + 1
	a = a - 1
	b = b - 1
remaining_socks = a + b
available = 0
while remaining_socks >= 2:
	available = available + 1
	remaining_socks = remaining_socks - 2
days = str(days)
available = str(available)
print(days + ' ' + available)


(a, b) = map(int, input().split())
e = []
e.append(a)
e.append(b)
r = max(e) - min(e)
k = r // 2
print(min(e), k)


(a, b) = map(int, input().split())
x = max(a, b) - min(a, b)
if x < 2:
	y = 0
elif x >= 2 and x % 2 == 0:
	y = x / 2
else:
	y = (x - 1) / 2
print(min(a, b), int(y))


(a, b) = map(int, input().split())
if a > b:
	ver = b
	nver = a - b
elif a < b:
	ver = a
	nver = b - a
elif a == b:
	ver = a = b
	nver = 0
dayt = ver
dayn = nver // 2
print(dayt, dayn)


(a, b) = map(int, input().split())
if a < b:
	(a, b) = (b, a)
d1 = b
remainder = a - b
d2 = remainder // 2
print(d1, d2)


go = input()
go = go.split(' ')
a = int(go[0])
b = int(go[1])
c = a + b
c2 = c
count = 0
if a == b:
	print(str(a) + ' 0')
elif a > b:
	while b != 0:
		a -= 1
		b -= 1
		count += 1
	a = a / 2
	a = str(a)
	a = a.split('.')
	print(str(count) + ' ' + a[0])
elif b > a:
	while a != 0:
		a -= 1
		b -= 1
		count += 1
	b = b / 2
	b = str(b)
	b = b.split('.')
	print(str(count) + ' ' + b[0])


list = [int(x) for x in input().split(' ')]
a = list[0]
b = list[1]
pairSingle = min(a, b)
pairDouble = int((max(a, b) - min(a, b)) / 2)
print(pairSingle, pairDouble)


(a, b) = list(map(int, input(' ').split()))
r = 0
while a != 0 and b != 0:
	a -= 1
	b -= 1
	r += 1
if a != 0:
	e = a // 2 if a % 2 == 0 else (a - 1) // 2
else:
	e = b // 2 if b % 2 == 0 else (b - 1) // 2
print(r, e)


(a, b) = map(int, input().split())
if a < b:
	z = a
	q = int((b - a) / 2)
else:
	z = b
	q = int((a - b) / 2)
print(str(z) + ' ' + str(q))


import math
a = input()
a = a.split(' ')
a[0] = int(a[0])
a[1] = int(a[1])
print(min(a[0], a[1]), abs(a[0] - a[1]) // 2)


input1 = [int(i) for i in input().split()]
a = input1[0]
b = input1[1]
count = 0
while a != 0 and b != 0:
	a = a - 1
	b = b - 1
	count = count + 1
if a == 0:
	second = b // 2
elif b == 0:
	second = a // 2
print(count, second)


n = list(map(int, input().split()))
n.sort()
print(n[0], (n[1] - n[0]) // 2)


n = input().split()
a = int(n[0])
b = int(n[1])
print(min(a, b), int(abs(a - b) / 2))


(x, y) = [int(x) for x in input().split(' ')]
d1 = min(x, y)
d2 = int((max(x, y) - min(x, y)) / 2)
print(str(d1) + ' ' + str(d2))


(a, b) = input().split()
(a, b) = (int(a), int(b))
print(str(min(a, b)) + ' ' + str((max(a, b) - min(a, b)) // 2))


(a, b) = [int(i) for i in input().split()]
hipster = min(a, b)
normal = 0
if a > b:
	a -= b
	normal += int(a / 2)
elif b > a:
	b -= a
	normal += int(b / 2)
print(hipster, normal)


(x, y) = input().split()
(x, y) = (max(int(x), int(y)), min(int(x), int(y)))
print(y, int((x - y) / 2))


(a, b) = map(int, input().split())
acount = 0
bcount = 0
if (a + b) % 2 == 0:
	x = (a + b) / 2
else:
	x = (a + b - 1) / 2
for i in range(int(x)):
	if a >= 1 and b >= 1:
		acount += 1
		a -= 1
		b -= 1
	elif a >= 2 or b >= 2:
		bcount += 1
		if a == 0:
			b -= 1
		else:
			a -= 1
print(acount, bcount)


(a, b) = map(int, input().split())
c = min(a, b)
d = a - c
e = b - c
f = max(a, b)
g = (f - c) // 2
print(c, g)


n = list(map(int, input().strip().split()))[:2]
a = n[0]
b = n[1]
if a < b:
	print(a, end=' ')
else:
	print(b, end=' ')
print(int(abs(a - b) / 2))


socks = list(map(int, input().split()))
a = socks[0]
b = socks[1]
count_fash = min(a, b)
count_notfash = (a - min(a, b) + b - min(a, b)) / 2
print(count_fash, int(count_notfash))


(a, b) = map(int, input().split())
diff_socks = 0
same_socks = 0
if a == b:
	diff_socks = a
else:
	while a != 0 and b != 0:
		diff_socks = diff_socks + 1
		a = a - 1
		b = b - 1
	while a == 0 and b >= 2:
		same_socks = same_socks + 1
		b = b - 2
	while b == 0 and a >= 2:
		same_socks = same_socks + 1
		a = a - 2
print(diff_socks, same_socks)


r_b = input().split()
r = int(r_b[0])
b = int(r_b[1])
diff_days = 0
same_days = 0
while r > 0 and b > 0:
	r -= 1
	b -= 1
	diff_days += 1
while True:
	if r >= 2 and b >= 2:
		r -= 2
		b -= 2
		same_days += 2
	if 0 <= r <= 1 and b >= 2:
		b -= 2
		same_days += 1
	if 0 <= b <= 1 and r >= 2:
		r -= 2
		same_days += 1
	if 0 <= r <= 1 and 0 <= b <= 1:
		break
print(diff_days, same_days)


(a, b) = map(int, input().split())
fashion_days = min(a, b)
tmp = max(a, b) - min(a, b)
same_days = tmp // 2
print(fashion_days, same_days)


(a, b) = input().split()
a = int(a)
b = int(b)
if a > b:
	ans = b
	c = a - b
else:
	ans = a
	c = b - a
print(ans, end=' ')
c = c // 2
print(c)


(n, m) = map(int, input().split())
print(min(n, m), end=' ')
p = max(n, m) - min(n, m)
print(int(p / 2))


import sys
local_launch = False
try:
	open('LOCAL').read()
	local_launch = True
except:
	pass
input_data = open('INPUT.txt').read() if local_launch else sys.stdin.read()
done = {'i': 0}
tokens = input_data.split()

def next_token():
	result = tokens[done['i']]
	done['i'] += 1
	return result

def next_int():
	return int(next_token())

def next_str():
	return next_token()
a = next_int()
b = next_int()
z = min(a, b)
x = abs(b - a) // 2
c = x + z
print(z)
print(x)


(a, b) = [int(i) for i in input().split()]
m = min(a, b)
ma = max(a, b) - m
print(m, ma // 2, sep=' ')


(a, b) = list(map(int, input().split()))
if a == b:
	print(a, 0)
elif a > b or b > a:
	remaning = a - b
	if remaning % 2 == 0:
		ans = remaning / 2
		print(min(a, b), int(abs(ans)))
	elif remaning == 1:
		print(min(a, b), 0)
	elif remaning != 1 and remaning % 2 != 0:
		ans1 = remaning / 2
		print(min(a, b), int(abs(ans1)))


from collections import Counter
import string
import math
import sys

def array_int():
	return [int(i) for i in sys.stdin.readline().split()]

def vary(number_of_variables):
	if number_of_variables == 1:
		return int(sys.stdin.readline())
	if number_of_variables >= 2:
		return map(int, sys.stdin.readline().split())

def makedict(var):
	return dict(Counter(var))
mod = 100000007
(r, b) = vary(2)
ans = 0
ans = min(r, b)
print(ans, end=' ')
ans = (max(r, b) - ans) // 2
print(ans)


(r, b) = map(int, input().split(' '))
fun = 0
ordi = 0
while r > 0 and b > 0:
	fun += 1
	r -= 1
	b -= 1
ordi = r // 2 + b // 2
print(fun, ordi)


x = [int(i) for i in input().split(' ')]
print(min(x[0], x[1]), int(abs(x[0] - x[1]) / 2), sep=' ')


n = list(map(int, input().split()))
(a, b) = (n[0], n[1])
bothdays = min(a, b)
singledays = max((a - min(a, b)) // 2, (b - min(a, b)) // 2)
print(bothdays, singledays)


a = [int(i) for i in input().split(' ', 2)]
amax = max(a)
amin = min(a)
ans1 = amin
ans2 = int((amax - amin) / 2)
print('%d %d' % (ans1, ans2))


(red, blue) = map(int, input().split())
fas = min(blue, red)
print(fas, (red + blue - 2 * fas) // 2)


(red, blue) = map(int, input().split())
dif = min(red, blue)
if dif == red:
	blue = blue - dif
	eq = blue // 2
else:
	red = red - dif
	eq = red // 2
print(dif, eq)


(a, b) = list(map(int, input().split()))
if a > b:
	max_day = b
	max_same = (a - b) // 2
elif a < b:
	max_day = a
	max_same = (b - a) // 2
else:
	max_day = a
	max_same = 0
print(max_day, max_same)


(a, b) = list(map(int, input().split()))
res = abs(a - b)
mod_days = int((a + b - res) / 2)
if res > 1:
	days = res // 2
else:
	days = 0
print('{} {}'.format(mod_days, days))


(red, blue) = [int(i) for i in input().split()]
print(min(red, blue), end=' ')
print(abs(red - blue) // 2)


import sys
(a, b) = map(int, sys.stdin.readline().split())
if a >= b:
	print(b, (a - b) // 2)
else:
	print(a, (b - a) // 2)


(a, b) = input('').split()
verdi = int(a) - int(b)
budi = int(b) - int(a)
c = int(verdi) / 2
d = int(budi) / 2
if int(a) < int(b):
	print(a, int(d))
else:
	print(b, int(c))


(a, b) = map(int, input().split())
if a > b:
	print(b)
	dif = a - b
else:
	print(a)
	dif = b - a
print(dif // 2)


a = list(map(int, input().split()))
l = list()
x = min(a)
y = max(a)
l.append(x)
l.append((y - x) // 2)
print(*l)


(a, b) = input().split(' ')
a = int(a)
b = int(b)
if a <= b:
	mode = a
	remainder = b - a
elif b <= a:
	mode = b
	remainder = a - b
counter = 0
while remainder > 1:
	remainder -= 2
	counter += 1
print(str(mode) + ' ' + str(counter))


(R, B) = map(int, input().split())
diff = 0
same = 0
while R != 0 and B != 0:
	diff += 1
	R -= 1
	B -= 1
if B > R:
	same = same + B // 2
elif B < R:
	same = same + R // 2
print(diff, same, end=' ')


l = list(input().split())
a = int(l[0])
b = int(l[1])
if a == b:
	print(a, '0')
elif a > b:
	a = a - b
	print(b, a // 2)
else:
	b = b - a
	print(a, b // 2)


(red, blue) = tuple(map(int, input().strip(' ').split(' ')))
hip = min([red, blue])
rst = abs(red - blue) // 2 if abs(red - blue) > 1 else 0
print(hip, rst)


(a, b) = map(int, input().split())
odd_days = min(a, b)
a -= odd_days
b -= odd_days
remainder = (a + b) // 2
print(odd_days, remainder)


(a, b) = list(map(int, input().split()))
if a > b:
	print(b, (a - b) // 2, sep=' ')
else:
	print(a, (b - a) // 2, sep=' ')


(a, b) = map(int, input().split())
if a < b:
	raznue = a
else:
	raznue = b
if a < b:
	para = (b - a) // 2
else:
	para = (a - b) // 2
print(f'{raznue} {para}')


entrada = str(input())
entrada = entrada.split()
a = int(entrada[0])
b = int(entrada[1])
fashionable_days = min(a, b)
other_ones = int((max(a, b) - fashionable_days) / 2)
string = str(fashionable_days) + ' ' + str(other_ones)
print(string)


(a, b) = map(int, input().split())
a1 = min(a, b)
c = max(a, b)
c -= a1
a2 = c // 2
print(a1, a2)


data = input().split()
red = int(data[0])
blue = int(data[1])
cont = 0
while red != 0 and blue != 0:
	red -= 1
	blue -= 1
	cont += 1
if red == 0:
	print(cont, blue // 2)
else:
	print(cont, red // 2)


(a, b) = map(int, input().split())
minimum = min(a, b)
maximum = max(a, b)
print(minimum, (maximum - minimum) // 2)


def read_ints():
	return list(map(int, input().split()))
(a, b) = read_ints()
differentSocks = min(a, b)
sameSocks = (max(a, b) - differentSocks) // 2
print('{} {}'.format(differentSocks, sameSocks))


(r, y) = map(int, input().split())
print(str(min(r, y)) + ' ' + str(int(abs(r - y) / 2)))


(a, b) = [int(i) for i in input().split()]
e = max(a, b) - min(a, b)
print(min(a, b), e // 2 if e >= 2 else 0)


socks = input().split(' ')
print(f'{min(int(socks[0]), int(socks[1]))} {abs(int(socks[0]) - int(socks[1])) // 2}')


import math
(a, b) = (int(x) for x in input().split())
c = max(a, b) - min(a, b)
print(min(a, b), math.floor(c / 2))


(a, b) = input().split()
(a, b) = (int(a), int(b))
diff = min(a, b)
more = int((max(a, b) - diff) // 2)
print(diff, int(more))


(blue, red) = map(int, input().split())
a1 = min(blue, red)
a2 = (blue - a1) // 2 + (red - a1) // 2
print('{} {}'.format(a1, a2))


(a, b) = map(int, input().split())
first = min(a, b)
second = max((a - first) // 2, (b - first) // 2)
print(first, second)


(a, b) = map(int, input().split())
e = a
c = b
while True:
	if e >= c:
		e -= c
		e = e // 2
		d = e
		break
	if e <= c:
		c -= e
		c = c // 2
		d = c
		break
print(min(a, b), d)


(a, b) = map(int, input().split(' '))
count = 0
if a < b:
	count += a
	b -= a
	print(count, end=' ')
	count = 0
	count += b // 2
	print(count)
else:
	count += b
	a -= b
	print(count, end=' ')
	count = 0
	count += a // 2
	print(count)


x = list(map(int, input().split(' ')))
y = max(x) - abs(x[0] - x[1])
z = abs(x[0] - x[1]) // 2
print(y, z)


(red, blue) = map(int, input().split())
p = min(red, blue)
q = max(red, blue)
if q - p >= 2:
	same_sock = (q - p) // 2
else:
	same_sock = 0
print(p, same_sock)


(a, b) = list(map(int, input().split()))
if a > b:
	c = a - b
	f = b
if a < b:
	c = b - a
	f = a
if a == b:
	c = 0
	f = a
if c % 2 == 0:
	c = c // 2
else:
	c = (c - 1) // 2
print(f, c)


(a, b) = (int(x) for x in input().split())
l = []
x = min(a, b)
y = max(a, b)
l.append(x)
l.append((y - x) // 2)
print(*l)


import math
x = [int(x) for x in input().split()]
x.sort(reverse=True)
print(f'{x[1]} {int((x[0] - x[1]) / 2)}')


(a, b) = map(int, input().split())
d = min(a, b)
print(d, (a + b - 2 * d) // 2)


(a, b) = input().split()
a = int(a)
b = int(b)
count = 0
count1 = 0
if a > b:
	while b > 0:
		count += 1
		a = a - 1
		b = b - 1
	while a > 1:
		count1 += 1
		a = a - 2
elif b > a:
	while a > 0:
		count += 1
		a = a - 1
		b = b - 1
	while b > 1:
		count1 += 1
		b = b - 2
else:
	count = (a + b) // 2
print(count, count1)


(a, b) = map(int, input().split())
f = min(a, b)
n = (a + b - f * 2) // 2
print(str(f) + ' ' + str(n))


(n, m) = map(int, input().split())
x = min(n, m)
y = max(n, m) - min(n, m)
x = min(n, m)
y = max(n, m) - x
if y % 2 != 0:
	y = y - 1
print(x, y // 2)


import math

def main():
	(a, b) = [int(x) for x in input().split()]
	if a > b:
		max = a
		min = b
	elif a < b:
		max = b
		min = a
	else:
		print(a, '0')
		exit()
	sub = max - min
	day = math.floor(sub / 2)
	print(min, end=' ')
	print(day)
main()


from math import *

def socks():
	while True:
		try:
			(a, b) = sorted(map(int, input().split()))
			assert 1 <= a and b <= 100
		except ValueError as error:
			print('ValueError :' + str(error))
			print('try again')
		except AssertionError:
			print('Please give a value ranging from 1 to 100. ')
		else:
			different_socks = a
			if b - a == 1:
				same_socks = 0
			else:
				same_socks = floor((b - a) / 2)
			print(different_socks, same_socks)
			break
socks()


import itertools as ittls
from collections import Counter
from pprint import pprint as pprint
import re
import math
from fractions import gcd

def sqr(x):
	return x * x

def inputarray(func=int):
	return map(func, input().split())
(x, y) = sorted(inputarray())
print(x, (y - x) // 2)


(a, b) = map(lambda x: int(x), input().split())
l = []
if a >= b:
	n = b
	m = (a - b) // 2
else:
	n = a
	m = (b - a) // 2
l.append(n)
l.append(m)
for i in l:
	print(i, end=' ')


TN = 1

def solution():
	(a, b) = map(int, input().split())
	print(min(a, b), (max(a, b) - min(a, b)) // 2)
while TN != 0:
	solution()
	TN -= 1


(a, b) = map(int, input().split())
b1 = max(a, b) - abs(a - b)
b2 = abs(a - b) // 2
print(b1, b2)


(a, b) = map(int, input().split())
diff = 0
same = 0
while a + b >= 2 and a > 0 and (b > 0):
	a -= 1
	b -= 1
	diff += 1
if b > 0 or a > 0:
	same = a // 2 + b // 2
print(diff, same)


import time

def calculateDaysSocks(redSocks, blueSocks):
	daysPerSocks = 0
	(fashionDays, socksLeft) = calculateFashionSocks(redSocks, blueSocks)
	daysPerSocks = fashionDays + socksLeft // 2
	print(fashionDays, socksLeft // 2)
	return

def calculateFashionSocks(redSocks, blueSocks):
	fashionDD = 0
	socksLeft = 0
	fashionDD = min(redSocks, blueSocks)
	socksLeft = abs(redSocks - blueSocks)
	return (fashionDD, socksLeft)

def solve():
	(redS, blueS) = [int(x) for x in input().split()]
	calculateDaysSocks(redS, blueS)
solve()


numbers = input()
space = numbers.find(' ')
redsock = int(numbers[0:space])
bluesock = int(numbers[space:len(numbers)])
days = 0
afterdays = 0
counter = 0
while counter == 0:
	if redsock >= 1 and bluesock >= 1:
		days = days + 1
		redsock = redsock - 1
		bluesock = bluesock - 1
	else:
		if redsock == 0:
			afterdays = bluesock // 2
		if bluesock == 0:
			afterdays = redsock // 2
		counter = 1
print(str(days) + ' ' + str(afterdays))


(x, y) = map(int, input().split())
(same_socks, days) = (0, 0)
if x <= y:
	print(x)
	same_socks = y - x
else:
	print(y)
	same_socks = x - y
socks = same_socks // 2
print(socks)


(a, b) = map(int, input().split())
day1 = min(a, b)
day2 = max(a - day1, b - day1)
day2 = day2 // 2
print(day1, day2)


values = input()
(a, b) = values.split()
a = int(a)
b = int(b)
print(min(a, b), (max(a, b) - min(a, b)) // 2)


ab = [int(i) for i in input('').split(' ')]
a = ab[0]
b = ab[1]
x = max(a, b)
n = min(a, b)
print(n, (x - n) // 2)


vr = ''
q = 0
it = 0
s = input()
s = s + ' '
while it < 2:
	while s[q] != ' ':
		vr = vr + s[q]
		q = q + 1
	else:
		q = q + 1
		it = it + 1
		if it == 1:
			a = int(vr)
		if it == 2:
			b = int(vr)
		vr = ''
if a > b:
	vintx = str(b)
	vinty = str(int((a - b) // 2))
	v = vintx + ' ' + vinty
else:
	vintx = str(a)
	vinty = str(int((b - a) // 2))
	v = vintx + ' ' + vinty
print(v)


from sys import exit as sys_ret
(red, blue) = map(int, input().split())
hipfulness = min(red, blue)
hipfoulloss = (max(red, blue) - min(red, blue)) // 2
print(hipfulness, hipfoulloss)


line = input().split()
a = int(line[0])
b = int(line[1])
c = min(a, b)
d = (a + b - 2 * c) // 2
print(c, d)


(a, b) = map(int, input().split())
t1 = min(a, b)
t2 = max(a, b) - t1
t3 = t2 // 2
print(t1, t3)


(a, b) = map(int, input().split())
minm = min(a, b)
diff = max(a, b) - minm
print(minm, diff // 2)


line = input()
lis = line.split()
a = int(lis[0])
b = int(lis[1])
t = 0
while a != 0 and b != 0:
	t += 1
	a -= 1
	b -= 1
print(t)
s = a + b
if s % 2 == 0:
	q = int(s / 2)
	print(q)
else:
	q = int((s - 1) / 2)
	print(q)


(red, blu) = list(map(int, input().split()))
print(min(red, blu), end=' ')
print((max(red, blu) - min(red, blu)) // 2)


n = input()
(a, b) = n.split()
if eval(a) > eval(b):
	c = b
	b = (eval(a) - eval(b)) // 2
	print(c + ' ' + str(b))
else:
	c = a
	a = (eval(b) - eval(a)) // 2
	print(c + ' ' + str(a))


n = input()
x = n.split()
answer1 = 0
answer2 = 0
if int(x[0]) > int(x[1]):
	answer1 = int(x[1])
	answer2 = int((int(x[0]) - int(x[1])) / 2)
else:
	answer1 = int(x[0])
	answer2 = int((int(x[1]) - int(x[0])) / 2)
print(str(answer1) + ' ' + str(answer2))


q = lambda : map(int, input().split())
qs = lambda : input().split()
(x, y) = q()
print(min(x, y), (max(x, y) - min(x, y)) // 2)


(a, b) = map(int, input().split())
f = min(a, b)
s = a + b
uf = int((s - 2 * f) / 2)
print(f, uf)


(r, b) = map(int, input().split())
mi = min(r, b)
if mi == r:
	print(mi, (b - mi) // 2)
elif mi == b:
	print(mi, (r - mi) // 2)


(a, b) = map(int, input().split())
c = 0
d = 0
hola = 0
for i in range(100):
	if a and b > 0:
		c += 1
		a -= 1
		b -= 1
	if a == 0 or b == 0:
		hola = a + b
		d = hola // 2
print(c, d)


import math
(a, b) = map(int, input().split())
(min, max) = (min(a, b), max(a, b))
n = math.ceil((max - min) // 2)
print(min, n)


(r, b) = map(int, input().split())
op2 = 0
op1 = min(r, b)
r -= op1
b -= op1
op2 += r // 2 + b // 2
print(op1, op2)


A = [int(k) for k in input().split()]
B = [min(A[0], A[1]), (max(A[0], A[1]) - min(A[0], A[1])) // 2]
for i in range(2):
	B[i] = str(B[i])
print(' '.join(B))


import sys
import math
import random
input = sys.stdin.readline

def inp():
	return int(input())

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
(a, b) = invr()
ans = min(a, b)
a -= ans
b -= ans
ans1 = a // 2 + b // 2
print(str(ans) + ' ' + str(ans1))


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

def solve(red, blue):
	return (min(red, blue), (max(red, blue) - min(red, blue)) // 2)
(i, j) = solve(a, b)
print(i, j)


(a, b) = map(int, input().split())
ans1 = min(a, b)
ans2 = a + b - ans1 * 2
if ans2 % 2:
	ans2 = (ans2 - 1) // 2
else:
	ans2 = ans2 // 2
print(str(ans1) + ' ' + str(ans2))


(z, s) = map(int, input().split())
dazadas = min(z, s)
vienadas = (max(z, s) - dazadas) // 2
print(dazadas, vienadas)


(n, m) = map(int, input().split())
l = min(n, m)
n -= l
m -= l
l2 = max(n, m)
l3 = l2 // 2
print(l, l3)


(a, b) = map(int, input().split())
p = min(a, b)
print(p, ([a, b][p == a] - p) // 2, sep=' ')


import sys

def solve():
	(a, b) = rv()
	awesome = min(a, b)
	a -= awesome
	b -= awesome
	ok = (a + b) // 2
	print(awesome, ok)

def prt(l):
	return print(' '.join(l))

def rs():
	return map(str, input().split())

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

def rl(n):
	return [list(map(int, input().split())) for _ in range(n)]
if sys.hexversion == 50594544:
	sys.stdin = open('test.txt')
solve()


(a, b) = map(int, input().split(' '))
counter1 = 0
while a > 0 and b > 0:
	counter1 += 1
	b -= 1
	a -= 1
counter2 = 0
while a > 1:
	(a, counter2) = (a - 2, counter2 + 1)
while b > 1:
	(b, counter2) = (b - 2, counter2 + 1)
print(counter1, counter2)


(a, b) = str(input()).split()
a = int(a)
b = int(b)
print(str(min(a, b)) + ' ' + str(int(abs(a - b) / 2)))


[red, blue] = [int(x) for x in input().split()]
fashion = 0
reg = 0
while red > 0 and blue > 0:
	fashion += 1
	red -= 1
	blue -= 1
while red > 1:
	red -= 2
	reg += 1
while blue > 1:
	blue -= 2
	reg += 1
print(str(fashion) + ' ' + str(reg))


n = input().split()
red = int(n[0])
blue = int(n[1])
day1 = min(red, blue)
red -= day1
blue -= day1
day2 = int(max(red, blue) / 2)
print(day1, day2)


n = input().split()
a = int(n[0])
b = int(n[1])
c = min(a, b)
print(c, end=' ')
d = max(a, b)
e = (d - c) // 2
print(e)


(k, i) = map(int, input().split())
print(min(k, i), (max(k, i) - min(k, i)) // 2)


inp = input().split()
for i in range(len(inp)):
	inp[i] = int(inp[i])
Min = min(inp[0], inp[1])
Max = max(inp[0], inp[1])
print(Min, (Max - Min) // 2, sep=' ')


(red, blue) = [int(x) for x in input().split()]
if red > blue:
	print(blue, int((red - blue) / 2))
else:
	print(red, int((blue - red) / 2))


(a, b) = map(int, input().split())
rbpair = 0
pair = 0
rbpair = min(a, b)
a = a - rbpair
b = b - rbpair
pair = int(max(a, b) / 2)
print(rbpair, pair)


(a, b) = list(map(int, input().split()))
x = (a, b)
y = str()
z = sorted(x)
if (z[-1] - z[0]) // 2 > 0:
	y = (z[-1] - z[0]) // 2
else:
	y = 0
print(z[0], y)


(a, b) = map(int, input().split())
if a >= b:
	x = a
	s = b
elif a < b:
	x = b
	s = a
c = s
d = (x - s) // 2
print(c, d)


(a, b) = list(map(int, input().split(' ')))
dif = 0
if a <= b:
	dif = a
else:
	dif = b
same = 0
if a > b and a - b >= 2:
	same = (a - b) / 2
elif a < b and b - a >= 2:
	same = (b - a) / 2
else:
	same = 0
print(dif, int(same))


l = list(map(int, input().split()))
mn = min(l)
mx = max(l)
s = str(mn) + ' '
s += str((mx - mn) // 2)
print(s)


import math
line = input()
(A, B) = line.split()
a = int(A)
b = int(B)
x1 = min(a, b)
x2 = max((a - b) // 2, (b - a) // 2)
print(x1, x2)


(a, b) = map(int, input().strip().split())
diffs = min(a, b)
a -= diffs
b -= diffs
sames = 0
if a != 0:
	if a % 2 == 0:
		sames += a // 2
	else:
		sames += (a - 1) // 2
if b != 0:
	if b % 2 == 0:
		sames += b // 2
	else:
		sames += (b - 1) // 2
print(diffs, sames)


a = input().split()
if int(a[0]) <= int(a[1]):
	print(int(a[0]), int((int(a[1]) - int(a[0])) / 2))
else:
	print(int(a[1]), int((int(a[0]) - int(a[1])) / 2))


(a, b) = map(int, input().split())
l = []
if a >= b:
	l.append(b)
	l.append((a - b) // 2)
else:
	l.append(a)
	l.append((b - a) // 2)
print(*l)


socks = input()
socks = socks.split()
socks = [int(s) for s in socks]
dif = min(socks)
sam = (max(socks) - dif) // 2
print(dif, sam)


(a, b) = map(int, input().split(' '))
if a < b:
	(a, b) = (b, a)
print(b, max(0, (a - b) // 2))


def fun(ls):
	mn = min(ls)
	ls[0] = ls[0] - mn
	ls[1] = ls[1] - mn
	rem = max(ls) // 2
	print(mn, rem)
ls = list(map(int, input().split()))
fun(ls)


l = [i for i in input().split()]
l = [int(i) for i in l]
r = max(l)
b = min(l)
s = []
s.append(b)
s.append((r - b) // 2)
s = [str(i) for i in s]
print(' '.join(s))


(n1, n2) = map(int, input().strip().split(' '))
if n1 != n2:
	mx = max(n1, n2)
	mn = min(n1, n2)
	dc = mn
	rem = mx - mn
	if rem > 1:
		sc = int(rem / 2)
	else:
		sc = 0
else:
	dc = n1
	sc = 0
print(dc, sc)


s = list(map(int, input().strip().split()))
minimum = min(s)
s.remove(minimum)
print(minimum, (s[0] - minimum) // 2)


(a, b) = map(int, input().split())
k = min(a, b)
c = a + b
d = c // 2
print(k, d - k)


from sys import stdin
_input = stdin.readline
(_abs, _max, _int) = (abs, max, int)

def solution():
	(r, b) = [_int(i) for i in _input().split()]
	d = _abs(r - b)
	print(_max(r, b) - d, end=' ')
	print(d // 2)
solution()


m = map(int, input().split())
l = []
for i in m:
	l.append(i)
x = str(min(l))
a = l[0]
b = l[1]
y = str(int(abs(a - b) // 2))
print(x + ' ' + y)


(a, b) = map(int, input().split())
different_sock = min(a, b)
remain_sock = max(a, b) - min(a, b)
same_sock = remain_sock // 2
print(different_sock, same_sock)


(a, b) = map(int, input().split())
mi = min(a, b)
same = abs(a - b)
if same > 1 and same % 2 == 0:
	print(mi, int(same / 2))
else:
	print(mi, int(same / 2))


(red, blue) = [int(i) for i in input().split(' ')]
maximumSocks = max(red, blue)
differentSocksDays = min(red, blue)
sameSocksDays = (maximumSocks - differentSocksDays) // 2
if sameSocksDays < 0:
	sameSocksDays = 0
print(f'{differentSocksDays} {sameSocksDays}')


(a, b) = map(int, input().split())
days = min(a, b)
print(days)
print((a + b) // 2 - days)


n = input()
lst = n.split()
r = int(lst[0])
b = int(lst[1])
dif = 0
if r >= b:
	dif = b
	greater = r
else:
	dif = r
	greater = b
same_colour = 0
if greater - dif > 1:
	same_colour = (greater - dif) // 2
print(dif, same_colour)


(a, b) = map(int, input().split())
if a < b:
	left_answer = a
else:
	left_answer = b
c = (a + b) // 2
right_answer = c - left_answer
print(left_answer, right_answer)


import math
(a, b) = map(int, input().split())
print(a if a < b else b, math.floor(abs(a - b) / 2))


(r, b) = map(int, input().split())
d = 0
m = 0
s = 0
d = abs(r - b)
if r > b:
	m = r - d
else:
	m = b - d
s = int(d / 2)
print(m, '', s)


n = list(map(int, input().split()))
x = min(n)
y = max(n)
c = y - x
print(x, end=' ')
if c // 2 > 0:
	print(c // 2)
else:
	print('0')


import math
(a, b) = map(int, input().split())
c = min(a, b)
d = math.floor((max(a, b) - c) / 2)
print(c, d)


import math
(r, b) = map(int, input().split())
x = min(r, b)
y = max(r, b)
oc = (y - x) // 2
print(x, oc)


(a, s) = map(int, input().split())
if a >= s:
	d = a - s
	d = d // 2
	print(s, ' ', d)
else:
	d = s - a
	d = d // 2
	print(a, ' ', d)


num = input()
num = num.split(' ')
red = int(num[0])
blue = int(num[1])
right_pair = 0
if red < blue:
	print(red, end=' ')
	right_pair = (blue - red) / 2
else:
	print(blue, end=' ')
	right_pair = (red - blue) / 2
right_pair = int(right_pair)
print(right_pair)


inp = list(map(int, input().rstrip().split()))
b = inp[0]
a = inp[1]
if b > a:
	temp = b
	b = a
	a = temp
print(b, (a - b) // 2)


(x, y) = map(int, input().split())
if x >= y:
	z = y
	x = x - y
	d = int(x / 2)
else:
	z = x
	y = y - x
	d = int(y / 2)
print(z, d)


(a, b) = input().split()
c = max(int(a), int(b))
d = min(int(a), int(b))
e = c - d
f = e // 2
print('{} {}'.format(d, f))


(red, blue) = map(int, input().split())
if red > blue:
	d_day = blue
else:
	d_day = red
if red > blue:
	s_day = int((red - blue) / 2)
else:
	s_day = int((blue - red) / 2)
print(d_day, s_day)


(a, b) = [int(i) for i in input().split()]
if a > b:
	(a, b) = (b, a)
x = (b - a) // 2
print(a, x)


(a, b) = map(int, input().split())
f = abs(a - b)
n = int((a + b - f) / 2)
m = f // 2
print(n, m)


(a, b) = map(int, input().split())
output = str(min(a, b)) + ' ' + str((max(a, b) - min(a, b)) // 2)
print(output)


(a, b) = (int(k) for k in input().split())
s = [0] * 2
s[0] = min(a, b)
s[1] = abs(a - b) // 2
s = map(str, s)
print(' '.join(s))


(a, b) = [int(i) for i in input().split()]
if a >= b:
	style = b
	same = int((a - b) / 2)
else:
	style = a
	same = int((b - a) / 2)
print(style, same)


def Vasya_the_Hipster(a, b):
	x = min(a, b)
	y = max(a, b)
	rem = y - x
	y = rem // 2
	return (x, y)
(a, b) = map(int, input().split())
(x, y) = Vasya_the_Hipster(a, b)
print(x, '', y)


(a, b) = map(int, input().split())
a1 = min(a, b)
b2 = (max(a, b) - a1) // 2
print(a1, b2)


(a, b) = map(int, input().split())
c1 = min(a, b)
c2 = (max(a, b) - min(a, b)) // 2
print(c1, c2)


s1 = input()
x = s1.split()
r = int(x[0])
b = int(x[1])
if r > b:
	fashion = b
	remains = r - b
	non_fashion = int(remains / 2)
	print(fashion, non_fashion)
elif b > r:
	fashion = r
	remains = b - r
	non_fashion = int(remains / 2)
	print(fashion, non_fashion)
else:
	fashion = r
	non_fashion = 0
	print(fashion, non_fashion)


def mm(l, r):
	if l > r:
		(l, r) = (r, l)
	return (l, r)

def sk(l, r):
	(l, r) = mm(l, r)
	return (l, (r - l) // 2)
(l, r) = [int(x) for x in input().split()]
print(*sk(l, r))


s = input().split()
a = int(s[0])
b = int(s[1])
(x, y) = (0, 0)
while a * b > 0:
	x += 1
	(a, b) = (a - 1, b - 1)
y = int(max(a, b) / 2)
print(str(x) + ' ' + str(y))


num = input()
arr = []
count = 0
for i in range(0, len(num)):
	if num[i] == ' ':
		arr.append(int(num[count:i]))
		count = i + 1
	elif i == len(num) - 1:
		arr.append(int(num[count:len(num)]))
counting = 0
while arr[0] > 0 and arr[1] > 0:
	arr[0] -= 1
	arr[1] -= 1
	counting += 1
n = 0
if arr[0] == 0:
	n = int(arr[1] / 2)
else:
	n = int(arr[0] / 2)
print(str(counting) + ' ' + str(n))


(a, b) = map(int, input().split())
fas = 0
same = 0
while a > 0 and b > 0:
	a -= 1
	b -= 1
	fas += 1
if a == 0:
	same += b // 2
elif b == 0:
	same += a // 2
print(fas, same)


(a, b) = map(int, input().split())
p = min(a, b)
d = max(a, b) - p
if d >= 2:
	d = d // 2
else:
	d = 0
print(p, d)


(r, b) = input().split()
r = int(r)
b = int(b)
c = 0
while r != 0 and b != 0:
	r -= 1
	b -= 1
	c += 1
if r > b:
	z = (r - b) / 2
elif b > r:
	z = (b - r) / 2
else:
	z = 0
print(c, int(z))


s = input().split()
(a_whole, b_whole) = (int(s[0]), int(s[1]))
if a_whole == b_whole:
	print(a_whole, 0)
elif a_whole > b_whole:
	print(b_whole, (a_whole - b_whole) // 2)
else:
	print(a_whole, (b_whole - a_whole) // 2)


sok = input().split()
x = int(sok[0])
y = int(sok[1])
d1 = min(x, y)
d2 = max(x, y) - d1
if d2 % 2 == 0:
	print(d1, '', int(d2 / 2))
else:
	print(d1, '', int(d2 / 2 - 0.5))


def solve(f):
	a = f[0]
	b = f[1]
	m = min(a, b)
	z = max(a, b)
	z -= m
	z = z // 2
	print('{} {}'.format(m, z))

def main():
	solve([int(x) for x in input().split()])
main()


s = input().split()
a = int(s[0])
b = int(s[1])
c = min(a, b)
print(c)
d = max(a, b)
f = (d - c) // 2
print(f)


(a, b) = map(int, input().split())
li = []
temp1 = 0
temp2 = 0
if a > b:
	temp1 = a - b
	li.append(b)
	if temp1 % 2 == 0:
		li.append(temp1 // 2)
	elif temp1 < 2:
		li.append(0)
	else:
		new1 = temp1 // 2
		li.append(new1)
else:
	temp2 = b - a
	li.append(a)
	if temp2 % 2 == 0:
		li.append(temp2 // 2)
	elif temp2 < 2:
		li.append(0)
	else:
		new2 = temp2 // 2
		li.append(new2)
for i in li:
	print(i, end=' ')


(a, b) = map(int, input().split())
differ = min(a, b)
a -= differ
b -= differ
print(differ, a // 2 + b // 2)


(n, m) = [int(x) for x in input().split()]
a1 = min(n, m)
a2 = (n + m) // 2 - a1
print(str(a1) + ' ' + str(a2))


l = list(map(int, input().strip().split()))
print(min(l))
print((max(l) - min(l)) // 2, end=' ')


(n, k) = [int(i) for i in input().split()]
print(str(min(n, k)) + ' ' + str((max(n, k) - min(n, k)) // 2))


(a, b) = map(int, input().split())
x = min(a, b)
y = (max(a, b) - min(a, b)) // 2
print('{0} {1}'.format(x, y))


(a, b) = map(int, input().split())
cnt = 0
cnt = min(a, b)
a = a - cnt
b = b - cnt
print(cnt, end=' ')
cnt = int(a / 2 + b / 2)
print(cnt)


(n, p) = map(int, input().split())
print(min(n, p), (max(n, p) - min(n, p)) // 2)


s = sorted(map(int, input().split()))
print(s[0], (s[1] - s[0]) // 2)


(a, b) = input().split()
(a, b) = (int(a), int(b))
if a >= b:
	a = a - b
	a = a / 2
	print('%d %d' % (b, a))
else:
	b = b - a
	b = b / 2
	print('%d %d' % (a, b))


(R, B) = list(map(int, input().split()))
diff = min(R, B)
same = (max(R, B) - diff) // 2
print(diff, same)


(a, b) = map(int, input().strip().split(' '))
answer = []
number = 0
if a < b:
	number = int((b - a) / 2)
	answer.append(a)
	answer.append(number)
elif a == b:
	answer.append(a)
	answer.append(number)
else:
	answer.append(b)
	answer.append(int((a - b) / 2))
print(answer[0], answer[1])


(a, b) = [int(i) for i in input().split()]
if a % 2 == 0 and b % 2 != 0 and (b > a):
	print(a, (b - a) // 2)
elif a % 2 == 0 and b % 2 != 0 and (b < a):
	print(b, (a - b) // 2)
elif a % 2 != 0 and b % 2 == 0 and (b < a):
	print(b, (a - b) // 2)
elif a % 2 != 0 and b % 2 == 0 and (b > a):
	print(a, (b - a) // 2)
elif a == b and a % 2 == 0 or (a % 2 != 0 and a == b):
	print(a, 0)
elif a % 2 != 0 and b % 2 != 0 and (a < b):
	print(a, (b - a) // 2)
elif a % 2 != 0 and b % 2 != 0 and (a > b):
	print(b, (a - b) // 2)
elif a % 2 == 0 and b % 2 == 0 and (a < b):
	print(a, (b - a) // 2)
elif a % 2 == 0 and b % 2 == 0 and (a > b):
	print(b, (a - b) // 2)


(ANR, BNB) = input().split()
ANR = int(ANR)
BNB = int(BNB)
if ANR > BNB:
	PR = ANR - BNB
	LV = PR // 2
	print(BNB, LV)
else:
	PR = BNB - ANR
	LV = PR // 2
	print(ANR, LV)


s = input().split()
l = [int(s[0]), int(s[1])]
raz = min(l)
ist = (max(l) - raz) // 2
print(raz, ist)


(m, n) = list(map(int, input().split()))
a = min(m, n)
b = (m - a + n - a) // 2
print(f'{a} {b}')


(a, b) = map(int, input().split())
no = []
if a > b:
	no.append(b)
	a = a - b
	b = b - b
elif a < b:
	no.append(a)
	b = b - a
	a = a - a
elif a == b:
	no.append(a)
	no.append(0)
if a != 0 and a != b:
	if a / 2 < 1:
		no.append(0)
	else:
		no.append(int(a / 2))
if b != 0 and b != a:
	if b / 2 < 1:
		no.append(0)
	else:
		no.append(int(b / 2))
for i in no:
	print(i, end=' ')


(red_socks, blue_socks) = [int(i) for i in input().split()]
print(min(red_socks, blue_socks), (max(red_socks, blue_socks) - min(red_socks, blue_socks)) // 2)


(a, b) = map(int, input().split())
hipster = min(a, b)
a = a - hipster
b = b - hipster
if b == 0:
	days = a // 2
elif a == 0:
	days = b // 2
print(str(hipster) + ' ' + str(days))


(a, b) = map(int, input().split())
c = 0
d = 0
e = 0
if a > b:
	e = b
else:
	e = a
for i in range(0, e):
	c += 1
	a -= 1
	b -= 1
if a > b:
	while a > 1:
		a -= 2
		d += 1
elif b > a:
	while b > 1:
		b -= 2
		d += 1
else:
	d = 0
print(c, d)


n = [int(i) for i in input().split()]
r = n[0]
b = n[1]
print(min(r, b), end=' ')
print(int(max((r - min(r, b)) / 2, (b - min(r, b)) / 2)))


import math
(a, b) = input().split()
a = int(a)
b = int(b)
minimum = min(a, b)
leftover = math.floor((a + b) / 2) - minimum
print(f'{minimum} {leftover}')


ls = input().split(' ')
a = int(ls[0])
b = int(ls[1])
print('%d %d' % (min(a, b), abs(a - b) // 2))


def get_value():
	(a, b) = [int(val) for val in input().split()]
	(min_num, max_num) = (min([a, b]), max([a, b]))
	return str(min_num) + ' ' + str((max_num - min_num) // 2)
print(get_value())


(red, blue) = map(int, input().split())
print(min(red, blue), end=' ')
if red == blue:
	print(0)
elif red > blue:
	print((red - blue) // 2)
else:
	print((blue - red) // 2)


def map_input(type=1):
	if type == 1:
		return map(int, input().split())
	elif type == 2:
		return map(float, input().split())
	elif type == 3:
		return map(str, input().split())
	return None

def list_input(type=1):
	return list(map_input(type))

def give_excel_column_name(r: int):
	l = 1
	r -= 1
	ans: str = ''
	while 26 ** l <= r:
		r -= 26 ** l
		l += 1
	while l > 0:
		ans += chr(ord('A') + r // 26 ** (l - 1) % 26)
		l -= 1
	return ans

def give_excel_column_number(name: str):
	p = 1
	ans: int = 0
	for j in range(len(name)):
		ans = ans + p * (ord(name[j]) - ord('A') + 1)
		p = p * 26
	return ans

def sorted_indices(s):
	li = []
	for i in range(len(s)):
		li.append([s[i], i])
	li.sort()
	return [x[1] for x in li]

def floorSearch(arr, x, low=-1, high=-1):
	if low == -1:
		low = 0
	if high == -1:
		high == len(arr) - 1
	if low > high:
		return -1
	if x >= arr[high]:
		return high
	mid = int((low + high) / 2)
	if arr[mid] == x:
		return mid
	if mid > 0 and arr[mid - 1] <= x and (x < arr[mid]):
		return mid - 1
	if x < arr[mid]:
		return floorSearch(arr, low, mid - 1, x)
	return floorSearch(arr, mid + 1, high, x)

def find_index(arr, x):
	low = 0
	high = len(arr) - 1
	mid = 0
	while low <= high:
		mid = (high + low) // 2
		if arr[mid] < x:
			low = mid + 1
		elif arr[mid] > x:
			high = mid - 1
		else:
			return mid
	return -1

def floyd_warshell(g):
	n = len(g)
	d = g.copy()
	for k in range(n):
		for i in range(n):
			for j in range(n):
				d[i][j] = min(d[i][j], d[i][k] + d[k][j])
	return d

def int_input(type=1):
	if type == 1:
		return int(input())
	elif type == 2:
		return float(int(input()))

def range_input():
	return range(int_input())

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def main():
	(a, b) = map_input()
	ans1 = min(a, b)
	ans2 = abs(a - b) // 2
	print(ans1, ans2)
try:
	main()
except:
	pass


get = lambda : list(map(int, input().split()))
(a, b) = get()
(a, b) = (max(a, b), min(a, b))
print(b, (a - b) // 2)


import math
(a, b) = map(int, input().split())
s = 0
k = 0
while a > 0 and b > 0:
	a = a - 1
	b = b - 1
	k = k + 1
s = math.floor((a + b) / 2)
print(k, s)


(a, b) = map(int, input().split())
n = min(a, b)
print(n, end=' ')
print((max(a, b) - n) // 2)


(r1, b1) = input().split()
r = int(r1)
b = int(b1)
rem = abs(r - b)
print(min(r, b), rem // 2)


vstup = input()
seznam = vstup.split()
a = min(int(seznam[0]), int(seznam[1]))
b = max(int(seznam[0]), int(seznam[1]))
if a % 2 == b % 2:
	print(a, int((b - a) / 2))
else:
	print(a, int((b - a) / 2))


(r, b) = input().split()
r = int(r)
b = int(b)
param = min(b, r)
paran = max(b, r)
o = (paran - param) // 2
print(min(b, r))
print(o)


(a, b) = map(int, input().split())
ans1 = None
ans2 = None
if a > b:
	ans1 = a - (a - b)
	a -= ans1
	ans2 = a // 2
else:
	ans1 = b - (b - a)
	b -= ans1
	ans2 = b // 2
print(ans1, ans2)
exit(0)


a = [int(i) for i in input().split(' ')]
h = min(a)
s = (a[0] + a[1] - 2 * h) // 2
print(str(h) + ' ' + str(s))


(a, b) = list(map(int, input().split()))
if a > b:
	different_socks = b
	same_socks = (a - b) // 2
elif a < b:
	different_socks = a
	same_socks = (b - a) // 2
else:
	different_socks = a
	same_socks = 0
print(f'{different_socks} {same_socks}')


a = [int(x) for x in input().split()]
(r, b) = a
if r > b:
	h = r - min(a)
elif r < b:
	h = b - min(a)
elif r == b:
	h = 0
print(min(a), h // 2)


(a, b) = map(int, input().split())
(d, s) = (0, 0)
while a > 0 and b > 0:
	a -= 1
	b -= 1
	d += 1
if a > 0:
	(a1, a2) = (a // 2, a - a // 2)
	while a1 > 0 and a2 > 0:
		a1 -= 1
		a2 -= 1
		s += 1
if b > 0:
	(b1, b2) = (b // 2, b - b // 2)
	while b1 > 0 and b2 > 0:
		b1 -= 1
		b2 -= 1
		s += 1
print(d, s)


(a, b) = list(map(int, input().split()))
fashionable = min(a, b)
remaining = (max(a, b) - fashionable) // 2
print(fashionable, remaining)


(r, b) = [int(x) for x in input().split()]
day = 0
same = 0
for i in range(max(r, b) + 1):
	if r >= 1 and b >= 1:
		day += 1
		r -= 1
		b -= 1
	elif r >= 2 or b >= 2:
		same += 1
		if r >= 2:
			r -= 2
		else:
			b -= 2
	elif r <= 1 and b <= 1:
		print(day, same)
		exit()


(a, b) = map(int, input().split())
(s, f) = (0, 0)
while a > 0 and b > 0:
	(a, b) = (a - 1, b - 1)
	f += 1
while a >= 2 or b >= 2:
	(a, b) = (a - 2, b - 2)
	s += 1
print(f, s, sep=' ')


(a, b) = [int(x) for x in input().split()]
d1 = min(a, b)
a -= d1
b -= d1
d2 = max(a, b) // 2
print(d1, d2)


import sys
(n, m) = [int(i) for i in input().split()]
first = min(n, m)
second = (max(n, m) - first) // 2
print(first, second)


(a, b) = map(int, input().split())
p = 0
q = 0
if a > b:
	p = b
	q = (a - b) // 2
else:
	p = a
	q = (b - a) // 2
print(p, q)


l1 = list(map(int, input().split()))
ma = max(l1)
mi = min(l1)
print(mi, (ma - mi) // 2)


abStr = input()
a = int(abStr.split()[0])
b = int(abStr.split()[1])
sockMax = max(a, b)
sockMin = min(a, b)
ans1 = 0
ans2 = 0
ans1 = ans1 + sockMin
sock = sockMax - sockMin
ans2 = ans2 + sock // 2
print(ans1, ans2)


red = input()
red = red.split()
blue = int(red[1])
red = int(red[0])
firstanswer = min(red, blue)
secondanswer = (red + blue - 2 * firstanswer) // 2
print(str(firstanswer) + ' ' + str(secondanswer))


import sys
(x, y) = map(int, sys.stdin.readline().split())
if x >= y:
	print(y, ' ', (x - y) // 2)
else:
	print(x, ' ', (y - x) // 2)


(a, b) = map(int, input().split())
if a > b:
	c = a - b
	print(b, c // 2)
if a < b:
	c = b - a
	print(a, c // 2)
if a == b:
	print(a, 0)


(ai, bi) = input().split()
a = int(ai)
b = int(bi)
if a > b:
	print(b, end=' ')
	a -= b
	b -= b
	print(a // 2)
else:
	print(a, end=' ')
	b -= a
	a -= a
	print(b // 2)


x = input().split()
emon = []
for i in x:
	c = int(i)
	emon.append(c)
emon.sort()
a = emon[0]
b = emon[1]
sum = a
n = b - a
m = n // 2
print(f'{sum} {m}')


import math
(n, m) = map(int, input().split())
if n > m:
	print(m, int((n - m) / 2))
elif m > n:
	print(n, int((m - n) / 2))
else:
	print(n, 0)


(a, b) = list(map(int, input().split()))
d1 = 0
d2 = 0
while a > 0 and b > 0:
	a -= 1
	b -= 1
	d1 += 1
d2 += a // 2
d2 += b // 2
print(d1, d2)


(a, b) = list(map(int, input().split()))
d = min(a, b)
j = max(a, b) - min(a, b)
t = j // 2
print(d, t)


arr = list(map(int, input().split(' ')))
arr.sort()
print(str(arr[0]) + ' ' + str((arr[1] - arr[0]) // 2))


(k, s) = map(int, input().split())
x = min(k, s)
y = abs(k - s) // 2
print(x, y)


import math
(a, b) = input().split()
a = int(a)
b = int(b)
result = []
result.append(a)
result.append(b)
x = min(result)
k = math.floor((sum(result) - min(result) * 2) / 2)
print(x, k)


s = input().split()
print(min(int(s[0]), int(s[1])), abs(int(s[0]) - int(s[1])) // 2)


(a, b) = map(int, input().split())
while True:
	min = a
	if b < min:
		min = b
		x = a - min
		print(min, x // 2)
		break
	else:
		x = b - min
		print(min, x // 2)
		break


import sys
import math
import bisect

def main():
	ans = [0] * 2
	(a, b) = map(int, input().split())
	while a and b:
		ans[0] += 1
		a -= 1
		b -= 1
	while a >= 2:
		ans[1] += 1
		a -= 2
	while b >= 2:
		ans[1] += 1
		b -= 2
	print(str(ans[0]) + ' ' + str(ans[1]))
main()


from math import *
(siniy, krasnui) = input().split()
siniy = int(siniy)
krasnui = int(krasnui)
a = (max(siniy, krasnui) - min(siniy, krasnui)) // 2
b = min(siniy, krasnui)
print(b, a)


nums = input().split()
a = int(nums[0])
b = int(nums[1])
pairs = []
diff = a - b
if diff == 0:
	pairs.append(a)
	pairs.append(0)
else:
	if diff < 0:
		pairs.append(a)
	else:
		pairs.append(b)
	pairs.append(abs(diff) // 2)
print(*pairs, sep=' ')


s = 0
(p, q) = map(int, input().split())
if p < q:
	s = q - p
	if s >= 2:
		print(p, s // 2)
	else:
		print(p, 0)
if p > q:
	s = p - q
	if s >= 2:
		print(q, s // 2)
	else:
		print(q, 0)
if p == q:
	print(p, 0)


(red, blue) = map(int, input().split())
dual_color = min(red, blue)
one_colored = abs(red - blue) // 2
print(dual_color, one_colored)


(r, h) = map(int, input().split())
if r >= h:
	r = r - h
	r //= 2
	print(h, r)
else:
	h = h - r
	h //= 2
	print(r, h)


(a, b) = list(map(int, input().split()))
c = min(a, b)
a -= c
b -= c
f = a // 2 + b // 2
print(c, f)


(a, b) = [int(j) for j in input().split()]
if b > a:
	(a, b) = (b, a)
print(b, int((a - b) / 2))


a = list(map(int, input().split()))
print(f'{min(a)} {abs(a[0] - a[1]) // 2}')


l = [int(i) for i in input().split()]
l.sort()
print(l[0], (l[1] - l[0]) // 2)


(a, b) = map(int, input().split())
col = a + b
c = abs(a - b)
d = (col - c) // 2
print(d, c // 2)


(a, b) = map(int, input().split())
o = abs(a - b) // 2
r = (a + b) // 2 - o
print(r, o)


(r, b) = map(int, input().split())
import math
if r >= b:
	fa = b
	sa = math.floor((r - b) / 2)
if r < b:
	fa = r
	sa = math.floor((b - r) / 2)
print(fa, sa)


(a, b) = input().split()
a = int(a)
b = int(b)
if a > b:
	maxx = a
	minn = b
if b >= a:
	maxx = b
	minn = a
print(minn, int((maxx - minn) / 2))