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.

Difficulty: interview

Starter code:

Solutions:
import sys


#sys.stdin = open('input.txt')
#sys.stdout = open('output.txt', 'w')

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

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

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

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

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


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

a1 = min(a, b)
c = max(a, b)
c -= a1
a2 = c // 2
print(a1, a2)

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

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


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

m = min(a,b)


x = max(a,b)

r = (x - m)//2

print(m,r)


n,m = [int(x) for x in input().split()]
a1 = min(n,m)
a2 = (n+m) //2 - a1
print(str(a1)+" "+str(a2))

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import time

#   = input()
#   = int(input())

#() = (i for i in input().split())
#   = [i for i in input().split()]

(a, b) = (int(i) for i in input().split())
#   = [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()
#print(finish - start)


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


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

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


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

__author__ = 'dwliv_000'
(a,b) = (int(i) for i in input().split())
print(min(a,b),(max(a,b)-min(a,b))//2)

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

r1 = min(a,b)
r2 = (max(a,b) - min(a,b)) // 2

print(r1,r2)


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

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

m,n = input().split()
n=int(n)
m=int(m)
if n>m:
    n,m=m,n
print(n,int((m-n)//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()

import math
a,b= list(map(int,input().split()))
print(min(a,b), int(math.floor(abs((a-b))/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))