Petya and Vasya decided to play a little. They found n red cubes and m blue cubes. The game goes like that: the players take turns to choose a cube of some color (red or blue) and put it in a line from left to right (overall the line will have n + m cubes). Petya moves first. Petya's task is to get as many pairs of neighbouring cubes of the same color as possible. Vasya's task is to get as many pairs of neighbouring cubes of different colors as possible. 

The number of Petya's points in the game is the number of pairs of neighboring cubes of the same color in the line, the number of Vasya's points in the game is the number of neighbouring cubes of the different color in the line. Your task is to calculate the score at the end of the game (Petya's and Vasya's points, correspondingly), if both boys are playing optimally well. To "play optimally well" first of all means to maximize the number of one's points, and second — to minimize the number of the opponent's points.


-----Input-----

The only line contains two space-separated integers n and m (1 ≤ n, m ≤ 10^5) — the number of red and blue cubes, correspondingly.


-----Output-----

On a single line print two space-separated integers — the number of Petya's and Vasya's points correspondingly provided that both players play optimally well.


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

Output
2 1

Input
2 4

Output
3 2



-----Note-----

In the first test sample the optimal strategy for Petya is to put the blue cube in the line. After that there will be only red cubes left, so by the end of the game the line of cubes from left to right will look as [blue, red, red, red]. So, Petya gets 2 points and Vasya gets 1 point. 

If Petya would choose the red cube during his first move, then, provided that both boys play optimally well, Petya would get 1 point and Vasya would get 2 points.

Difficulty: interview

Starter code:

Solutions:
import re
import itertools
from collections import Counter

class Task:
    n, m = 0, 0
    petyaScore = 0
    vasyaScore = 0
	
    def getData(self):
        self.n, self.m = [int(x) for x in input().split(" ")]
	
    def solve(self):
        n = self.n
        m = self.m

        if n != m:
            self.vasyaScore = min(n, m)
        else:
            self.vasyaScore = min(n, m)
        self.petyaScore = self.n + self.m - 1 - self.vasyaScore 

    def printAnswer(self):
        print(self.petyaScore, self.vasyaScore)

task = Task();
task.getData();
task.solve();
task.printAnswer();


3

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

def solve(start, r, b):
    i = 0
    while r and b:
        i += 1
        if i % 2 == 0:
            #if start[-1] == 'r' and r > 0 or start[-1] == 'b' and b == 0:
            if (start[-1] == 'r'):
                start.append('r')
                r -= 1
            else:
                start.append('b')
                b -= 1
        else:
            #if start[-1] == 'r' and b > 0 or start[-1] == 'b' and r == 0:
            if (start[-1] == 'r'):
                start.append('b')
                b -= 1
            else:
                start.append('r')
                r -= 1
    if r: start.extend(['r'] * r)
    if b: start.extend(['b'] * b)
    return (len([1 for f, s in zip(start[:-1], start[1:]) if f == s]), len([1 for f, s in zip(start[:-1], start[1:]) if f != s]))

print(*max(solve(['r'], n - 1, m), solve(['b'], n, m - 1)))


a, b = map(int, input().split())
c = min(a, b)
print(a + b - 1 - c, c)

def t(b, pr):
    i, p = 1, [0, 0]
    while b[0] or b[1]:
        if i == 0:
            c = pr if b[pr] else 1 - pr
        else:
            c = 1 - pr if b[1 - pr] else pr
        p[c != pr] += 1
        b[c] -= 1
        i, pr = 1 - i, c
    return p

n, m = list(map(int, input().split()))
v1, v2 = t([n - 1, m], 0), t([n, m - 1], 1)
print(' '.join(map(str, v1 if v1[0] >= v2[0] else v2)))


a, b = map(int, input().split())
print(a + b - 1 - min(a, b), min(a, b))

p,q=input().split()
p=int(p)
q=int(q)
high=max(p,q)
low=min(p,q)
print("%d %d"%(p+q-1-low,low))

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

n, m = list(map(int, input().split()))
n1, m1, n2, m2 = n - 1, m, n, m - 1
s1, s2 = "R", "B"
turn = 2
for i in range(n + m - 1):
	if turn == 1:
		if s1[-1] == "R" and n1 >= 1:
			n1 -= 1
			s1 += "R"
		elif m1 >= 1:
			m1 -= 1
			s1 += "B"
		else:
			n1 -= 1
			s1 += "R"

		if s2[-1] == "R" and n2 >= 1:
			n2 -= 1
			s2 += "R"
		elif m2 >= 1:
			m2 -= 1
			s2 += "B"
		else:
			n2 -= 1
			s2 += "R"
	else:
		if s1[-1] == "R" and m1 >= 1:
			m1 -= 1
			s1 += "B"
		elif n1 >= 1:
			n1 -= 1
			s1 += "R"
		else:
			m1 -= 1
			s1 += "B"
			
		if s2[-1] == "R" and m2 >= 1:
			m2 -= 1
			s2 += "B"
		elif n2 >= 1:
			n2 -= 1
			s2 += "R"
		else:
			m2 -= 1
			s2 += "B"
	turn = 3 - turn
ans1 = sum([1 for i in range(n + m - 1) if s1[i] == s1[i + 1]])
ans2 = sum([1 for i in range(n + m - 1) if s2[i] == s2[i + 1]])
ans = max(ans1, ans2)
print(ans, n + m - 1 - ans)


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


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


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


a,b=sorted(map(int,input().split()))
print(b-1,a)
##


# your code goes here
arr = input().split()
a = int(arr[0])
b = int(arr[1])
#print('a = ' + str(a) + 'b = ' + str(b))

if a%2 == 1 and b%2 == 1:
	if a < b:
#		print('a')
		a -= 1
		flag = 1
	else:
#		print('b')
		b -= 1
		flag = 2
elif a%2 == 1:
	a -= 1
	flag = 1
elif b%2 == 1:
	b -= 1
	flag = 2
else:
	if a > b:
		a -= 1
		flag = 1
	else:
		b -= 1
		flag = 2
if flag == 1:
	s = 'a'
else:
	s = 'b'
play = 2
while a > 0 and b > 0:
	if flag == 1:
		if play == 2:
			s += 'b'
			b -= 1
			play = 1
			flag = 2
		else:
			s += 'a'
			a -= 1
			play = 2
			
	else:
		if play == 2:
			s += 'a'
			a -= 1
			play = 1
			flag = 1
		else:
			s += 'b'
			b -= 1
			play = 2
		
while a > 0:
	s += 'a'
	a -= 1
while b > 0:
	s += 'b'
	b -= 1
s = list(s)
prev = s[0]
n = len(s)
a = 0
b = 0
for i in range(1,n):
	if s[i] == prev:
		a += 1
	else:
		b += 1
	prev = s[i]
print(str(a) + ' ' + str(b))

def main(n, m):
    if n == m:
        return (n - 1, m)
    if n > m:
        temp = n
        n = m
        m = temp
    return (m - 1, n)


print("{} {}".format(*main(*list(map(int, input().split(' '))))))


def test(begin, r, b):
    bl = b
    rl = r
    if begin == 'b':
        bl -= 1
    else:
        rl -= 1
    last = begin
    pt = 0
    for i in range(r+b-1):
        if i%2 == 0:
            if last == 'b':
                if rl > 0:
                    rl -= 1
                    last = 'c'
                else:
                    bl -= 1
                    pt += 1
            else:
                if bl > 0:
                    bl -= 1
                    last = 'b'
                else:
                    rl -= 1
                    pt += 1
        else:
            if last == 'b':
                if bl > 0:
                    bl -= 1
                    pt += 1
                else:
                    rl -= 1
                    last = 'c'
            else:
                if rl > 0:
                    rl -= 1
                    pt += 1
                else:
                    bl -= 1
                    last = 'b'
    return pt
    
inp = input().split(' ')
r = int(inp[0])
b = int(inp[1])

best = max(test('b', r, b), test('r', r, b))
print(best, r+b-best-1)

                


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


n,m=map(int,input().split())
print(n+m-1-min(n,m),min(n,m))

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

from sys import stdin
import functools
import math

def read(): return list(map(int, stdin.readline().split()))

n, m = read()

b = min(n,m)
a = n+m-1-b
print( "{0} {1}".format(a,b) )


n, m = list(map(int, input().split()))
print(max(n,m) - 1, min(n,m))



from sys import stdin
n, m = map(int, stdin.readline().split() )
print(max(n,m) - 1, min(n,m))

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

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