Alice and Bob play ping-pong with simplified rules.

During the game, the player serving the ball commences a play. The server strikes the ball then the receiver makes a return by hitting the ball back. Thereafter, the server and receiver must alternately make a return until one of them doesn't make a return.

The one who doesn't make a return loses this play. The winner of the play commences the next play. Alice starts the first play.

Alice has $x$ stamina and Bob has $y$. To hit the ball (while serving or returning) each player spends $1$ stamina, so if they don't have any stamina, they can't return the ball (and lose the play) or can't serve the ball (in this case, the other player serves the ball instead). If both players run out of stamina, the game is over.

Sometimes, it's strategically optimal not to return the ball, lose the current play, but save the stamina. On the contrary, when the server commences a play, they have to hit the ball, if they have some stamina left.

Both Alice and Bob play optimally and want to, firstly, maximize their number of wins and, secondly, minimize the number of wins of their opponent.

Calculate the resulting number of Alice's and Bob's wins.


-----Input-----

The first line contains a single integer $t$ ($1 \le t \le 10^4$) — the number of test cases.

The first and only line of each test case contains two integers $x$ and $y$ ($1 \le x, y \le 10^6$) — Alice's and Bob's initial stamina.


-----Output-----

For each test case, print two integers — the resulting number of Alice's and Bob's wins, if both of them play optimally.


-----Examples-----

Input
3
1 1
2 1
1 7
Output
0 1
1 1
0 7


-----Note-----

In the first test case, Alice serves the ball and spends $1$ stamina. Then Bob returns the ball and also spends $1$ stamina. Alice can't return the ball since she has no stamina left and loses the play. Both of them ran out of stamina, so the game is over with $0$ Alice's wins and $1$ Bob's wins.

In the second test case, Alice serves the ball and spends $1$ stamina. Bob decides not to return the ball — he loses the play but saves stamina. Alice, as the winner of the last play, serves the ball in the next play and spends $1$ more stamina. This time, Bob returns the ball and spends $1$ stamina. Alice doesn't have any stamina left, so she can't return the ball and loses the play. Both of them ran out of stamina, so the game is over with $1$ Alice's and $1$ Bob's win.

In the third test case, Alice serves the ball and spends $1$ stamina. Bob returns the ball and spends $1$ stamina. Alice ran out of stamina, so she can't return the ball and loses the play. Bob, as a winner, serves the ball in the next $6$ plays. Each time Alice can't return the ball and loses each play. The game is over with $0$ Alice's and $7$ Bob's wins.

Difficulty: EASY

Solutions:
t = int(input())
for i in range(t):
	(a, b) = [int(x) for x in input().split(' ')]
	if a == 1:
		print('0', b)
	else:
		print(a - 1, b)


for _ in range(int(input())):
	(alice, bob) = map(int, input().strip().split())
	if alice == bob:
		print(alice - 1, bob)
	elif alice > bob:
		print(alice - 1, bob)
	else:
		print(alice - 1, bob)


t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	print(n - 1, m)


mod = 10 ** 9 + 7

def solve():
	(x, y) = map(int, input().split())
	print(x - 1, y)
t = 1
t = int(input())
while t > 0:
	solve()
	t -= 1


def pingPong(a, b):
	print(a - 1, end=' ')
	print(b)
testcases = int(input())
while testcases:
	testcases -= 1
	(A, B) = tuple(map(int, input().split()))
	pingPong(A, B)


t = int(input())
for i in range(t):
	(a, b) = (int(i) for i in input().split())
	print(a - 1, b)


import sys
a = 0
b = 0
t = int(sys.stdin.readline().split()[0])
for i in range(t):
	line = sys.stdin.readline().split()
	a = int(line[0])
	b = int(line[1])
	print(a - 1, b)


t = int(input())
for i in range(t):
	(x, y) = map(int, input().split(' '))
	print(x - 1, y)


a = int(input())
st = [0 for i in range(a)]
for i in range(a):
	st[i] = input().split()
	st[i][0] = int(st[i][0])
	st[i][1] = int(st[i][1])
for i in range(a):
	print(st[i][0] - 1, end=' ')
	print(st[i][1])


from sys import stdin, stdout
ans = []

def main():
	(x, y) = list(map(int, stdin.readline().split()))
	ans.append(str(x - 1) + ' ' + str(y))
for _ in range(int(stdin.readline())):
	main()
stdout.write('\n'.join(ans))


t = int(input())
for _ in range(t):
	(x, y) = input().split()
	(x, y) = (int(x), int(y))
	ansx = 0
	ansy = 0
	if x == 0 or y == 0:
		if x == 0:
			ansy = y
		if y == 0:
			ansx = x
	elif x == 1 and y == 1:
		ansy = 1
	else:
		ansx = x - 1
		ansy = y
	print(ansx, end=' ')
	print(ansy)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a == 1:
		print(0, b)
	elif a == b:
		print(a - 1, b)
	else:
		print(a - 1, b)


t = int(input())
for q in range(t):
	(x, y) = map(int, input().split())
	print(max(x - 1, 0), y)


T = int(input())
ans = ''
for _ in range(T):
	xy = [int(i) for i in input().split()]
	x = xy[0]
	y = xy[1]
	ans += str(x - 1) + ' ' + str(y) + '\n'
print(ans)


import bisect
import collections
import copy
import functools
import heapq
import itertools
import math
import random
import re
import sys
import time
import string
from typing import List
sys.setrecursionlimit(99999)

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

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

def SI():
	return sys.stdin.readline().strip()
for _ in [0] * II():
	(x, y) = IIs()
	print(x - 1, y)


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__

def gift():
	for _ in range(t):
		(n, m) = list(map(int, input().split()))
		yield '{} {}'.format(n - 1, m)
t = int(input())
ans = gift()
print(*ans, sep='\n')


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	print(n - 1, k)


def pingPong(a, b):
	return [a - 1, b]
t = int(input())
final = []
for _ in range(t):
	(a, b) = map(int, input().split())
	final.append(pingPong(a, b))
for _ in range(t):
	print(final[_][0], final[_][1])


def main():
	rounds = int(input())
	results = []
	for _ in range(rounds):
		(a, b) = [int(item) for item in input().split()]
		results.append(' '.join((str(a - 1), str(b))))
	for item in results:
		print(item)
main()


for i in range(int(input())):
	x = list(map(int, input().split()))
	print(x[0] - 1, x[1])


T = int(input())
r = 1

def getnext(x, y):
	if x == 0:
		return [0, y + 1]
	if y == 0:
		return [x, 0]
	[me1, you1] = getnext(x, y - 1)
	you1 += 1
	if x > 0:
		[you2, me2] = getnext(y, x - 1)
	if me1 > me2:
		return [me1, you1]
	elif me1 < me2:
		return [me2, you2]
	if you1 < you2:
		return [me1, you1]
	elif you1 > you2:
		return [me2, you2]
	print('ERROR!', x, y)
while r <= T:
	(m, n) = map(int, input().split())
	print(m - 1, n)
	r += 1


a = int(input())
for i in range(a):
	(z, x) = [int(i) for i in input().split()]
	print(z - 1, x)


t = int(input())
for _ in range(t):
	(x, y) = map(int, input().split())
	if x == 1:
		print(0, y)
	elif y == 1:
		print(x - 1, 1)
	elif y >= x:
		print(x - 1, y)
	else:
		x -= 1
		print(x, y)


for s in [*open(0)][1:]:
	(a, b) = map(int, s.split())
	print(a - 1, b)


t = int(input())
for q in range(t):
	arr = list(map(int, input().split(' ')))
	(x, y) = (arr[0], arr[1])
	bob = y
	alice = x - 1
	print(alice, end=' ')
	print(bob)


t = int(input())
rj = []
for i in range(t):
	(x, y) = map(int, input().split())
	rj.append(x - 1)
	rj.append(y)
for i in range(0, len(rj), 2):
	print(rj[i], rj[i + 1])


a = int(input())
for x in range(a):
	(b, c) = map(int, input().split())
	print(b - 1, c)


T = int(input())
for __ in range(T):
	(x, y) = map(int, input().split())
	print(x - 1, y)


import sys
import functools
input = sys.stdin.readlines()
for i in range(1, len(input)):
	input[i] = input[i].split()
	(x, y) = input[i]
	(x, y) = (int(x), int(y))
	print(x - 1, y)


t = int(input())
for tc in range(t):
	(a, b) = list(map(int, input().split()))
	print(a - 1, b)


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

def li():
	return [int(i) for i in input().split()]
for t in range(ii()):
	(x, y) = li()
	print(x - 1, y)


import math
import sys
import bisect
from heapq import heapify, heappop, heappush
from itertools import *
from collections import deque, OrderedDict
sys.setrecursionlimit(10 ** 6)
II = lambda : sys.stdin.readline()
inp = lambda : int(II())
inpm = lambda : map(int, II().split())
inpl = lambda : list(inpm())
arr_mn = lambda _n, _m: [[0 for __ in range(_m)] for _ in range(_n)]
arr_nn = lambda _n: arr_mn(_n, _n)
EPS = 1e-09
INF = int(1e+18)
MOD = int(1000000000.0) + 7
N = 2000009

def solve():
	(a, b) = inpm()
	print(a - 1, b)

def main():
	t = inp()
	for i in range(t):
		solve()
main()


import time, math as mt, bisect as bs, sys
from sys import stdin, stdout
from collections import deque
from fractions import Fraction
from collections import Counter
from collections import OrderedDict
pi = 3.141592653589793

def II():
	return int(stdin.readline())

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

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

def P(x):
	return stdout.write(str(x) + '\n')

def PI(x, y):
	return stdout.write(str(x) + ' ' + str(y) + '\n')

def lcm(a, b):
	return a * b // gcd(a, b)

def gcd(a, b):
	if a == 0:
		return b
	elif b == 0:
		return a
	if a > b:
		return gcd(a % b, b)
	else:
		return gcd(a, b % a)

def bfs(adj, v):
	visited = [False] * (v + 1)
	q = deque()
	while q:
		pass

def setBit(n):
	count = 0
	while n != 0:
		n = n & n - 1
		count += 1
	return count
mx = 10 ** 7
spf = [mx] * (mx + 1)

def readTree(n, e):
	adj = [set() for i in range(n + 1)]
	for i in range(e):
		(u1, u2) = IP()
		adj[u1].add(u2)
	return adj

def sieve():
	li = [True] * (10 ** 3 + 5)
	(li[0], li[1]) = (False, False)
	for i in range(2, len(li), 1):
		if li[i] == True:
			for j in range(i * i, len(li), i):
				li[j] = False
	(prime, cur) = ([0] * 200, 0)
	for i in range(10 ** 3 + 5):
		if li[i] == True:
			prime[cur] = i
			cur += 1
	return prime

def SPF():
	mx = 10 ** 6 + 1
	spf[1] = 1
	for i in range(2, mx):
		if spf[i] == 1000000000.0:
			spf[i] = i
			for j in range(i * i, mx, i):
				if i < spf[j]:
					spf[j] = i
	return

def prime(n, d):
	prm = set()
	while n != 1:
		prm.add(spf[n])
		n = n // spf[n]
	for ele in prm:
		d[ele] = d.get(ele, 0) + 1
	return
mod = 998244353

def solve():
	(x, y) = IP()
	print(x - 1, y)
	return
t = II()
for i in range(t):
	solve()


import sys, math
sys.setrecursionlimit(10 ** 8)
t = int(input())
for _ in range(t):
	(x, y) = map(int, input().split())
	print(x - 1, y)


T = int(input())
for _ in range(T):
	(A, B) = map(int, input().split())
	print(A - 1, B)


def Solve():
	for t in range(int(input())):
		(x, y) = map(int, input().split())
		(xa, ya) = (0, 0)
		xa += x - 1
		ya += y
		print(xa, ya)
Solve()


n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	print(a - 1, b)


import sys, io, os, time
from collections import defaultdict
from collections import Counter
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect, math, heapq
alphabet = 'abcdefghijklmnopqrstuvwxyz'
input = sys.stdin.readline
for ii in range(int(input())):
	(x, y) = map(int, input().split())
	print(x - 1, y)


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	print(x - 1, y)


t = int(input())
for _ in range(t):
	data = list(map(int, input().split()))
	x = data[0] - 1
	y = data[1]
	print(x, y)


import sys
import math
from collections import defaultdict as dd
mod = 1000000007
T = 1
T = int(sys.stdin.readline())
for _ in range(T):
	(x, y) = map(int, input().split())
	print(x - 1, y)


import sys
input = lambda : sys.stdin.readline().strip()
t = int(input())
while t:
	t -= 1
	(x, y) = map(int, input().split())
	print(x - 1, y)


import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7

def resolve():
	t = int(input())
	for _ in range(t):
		(x, y) = map(int, input().split())
		(a, b) = (0, 0)
		if x == 1:
			if y == 0:
				a = 1
				b = 0
			else:
				a = 0
				b = y
		elif y == 0:
			a = x
			b = 0
		else:
			a = x - 1
			b = y
		print(a, b)
resolve()


import sys
import math
from bisect import bisect_left
from collections import defaultdict

def get_lcp(s, suffix_array):
	s = s + '$'
	n = len(s)
	lcp = [0] * n
	pos = [0] * n
	for i in range(n - 1):
		pos[suffix_array[i]] = i
	k = 0
	for i in range(n - 1):
		if k > 0:
			k -= 1
		if pos[i] == n - 1:
			lcp[n - 1] = -1
			k = 0
			continue
		else:
			j = suffix_array[pos[i] + 1]
			while max([i + k, j + k]) < n and s[i + k] == s[j + k]:
				k += 1
			lcp[pos[i]] = k
	return lcp

def get_suffix_array(word):
	suffix_array = [('', len(word))]
	for position in range(len(word)):
		sliced = word[len(word) - position - 1:]
		suffix_array.append((sliced, len(word) - position - 1))
	suffix_array.sort(key=lambda x: x[0])
	return [item[1] for item in suffix_array]

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

def bin_search(collection, element):
	i = bisect_left(collection, element)
	if i != len(collection) and collection[i] == element:
		return i
	else:
		return -1

def main():
	t = int(input())
	for _ in range(t):
		(x, y) = map(int, input().split())
		if x == 1:
			print(0, y)
		elif y == 1:
			print(x - 1, 1)
		else:
			print(x - 1, y)
main()


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	print(n - 1, m)


t = int(input())
all = []
for i in range(t):
	x = input()
	a = [int(i) for i in x.split()]
	all.append(a)
for item in all:
	(x, y) = (item[0], item[1])
	print(x - 1, y)


def func(x, y):
	print(x - 1, y)
t = int(input())
for _ in range(t):
	(x, y) = [int(i) for i in input().split()]
	func(x, y)


for j in range(0, int(input())):
	(a, b) = map(int, input().split())
	print(a - 1, b)


t = int(input())
for i in range(0, t):
	(m, n) = map(int, input().split())
	l = []
	l.append(m - 1)
	l.append(n)
	print(*l, sep=' ')


answer = ''
t = int(input())
for x in range(t):
	(a, b) = map(int, input().split())
	if a == 1:
		answer += str(0) + ' ' + str(b) + '\n'
	elif b == 0:
		answer += str(a) + ' ' + '0' + '\n'
	else:
		answer += str(a - 1) + ' ' + str(b) + '\n'
print(answer)


t = int(input())
x = [list(map(int, input().split())) for i in range(t)]
for p in x:
	if p[0] == 0:
		print(f'0 {p[1]}')
		continue
	if p[1] == 0:
		print(f'{p[0]} 0')
		continue
	alice = p[0] - 1
	bob = p[1]
	print(f'{alice} {bob}')


t = int(input())
while t:
	(a, b) = map(int, input().split())
	print(a - 1, b)
	t -= 1


rounds = int(input())
scores = []
for _ in range(rounds):
	(alice_power, bob_power) = list(map(int, input().split()))
	scores.append((alice_power - 1, bob_power))
for score in scores:
	print(score[0], score[1])


for i in range(int(input())):
	(alice, bob) = map(int, input().split())
	alice_wins = alice - 1
	print(alice_wins, bob)


import sys
import math
from collections import defaultdict, deque
input = sys.stdin.readline

def inar():
	return [int(el) for el in input().split()]

def main():
	t = int(input())
	for _ in range(t):
		(alice, bob) = inar()
		print(alice - 1, bob)
main()


from collections import Counter
import math
import sys
import heapq
from bisect import bisect, bisect_left, bisect_right

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

def INT():
	return int(input())

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

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def mod():
	return 10 ** 9 + 7
for i in range(INT()):
	s = input()
	val = s.split(' ')
	x = int(val[0])
	y = int(val[1])
	print(x - 1, y)


T = int(input())
for t in range(T):
	(a, b) = map(int, input().split())
	print(a - 1, b)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(n, m) = [int(x) for x in input().split()]
	print(n - 1, m)


import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left, bisect_right
import time
from types import GeneratorType
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import defaultdict as dd, deque as dq, Counter as dc
import math, string
start_time = time.time()

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

def getMat(n):
	return [getInts() for _ in range(n)]
MOD = 998244353

def solve():
	(X, Y) = getInts()
	print(X - 1, Y)
	return
for _ in range(getInt()):
	solve()


BUFSIZE = 8192
import os
import sys
import math
from io import BytesIO, IOBase
from bisect import bisect_left
from bisect import bisect_right

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	print(x - 1, y)


import sys
t = int(input())
for i in range(t):
	line = sys.stdin.readline().split()
	x = int(line[0])
	y = int(line[1])
	if x == 0 and y == 0:
		print(0, 0)
	elif x == 1 and y == 0:
		print(1, 0)
	elif x == 0 and y == 1:
		print(0, 1)
	else:
		print(x - 1, y)


import sys

def answer(x, y):
	print(x - 1, y)
	return

def main():
	t = int(input())
	while t:
		(x, y) = [int(i) for i in sys.stdin.readline().split()]
		answer(x, y)
		t -= 1
	return
main()


import sys, math

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

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

def lmii():
	return list(mii())

def dtob(n):
	return bin(n).replace('0b', '')

def main():
	for _ in range(ii()):
		(x, y) = mii()
		print(x - 1, y)
main()


numberOfTestCases = int(input())
for _ in range(0, numberOfTestCases):
	string = input().split()
	(n, m) = map(int, string)
	print(n - 1, m)


def work():
	(x, y) = map(int, input().split())
	print(x - 1, y, end='\n')
T = int(input())
for Case in range(T):
	work()


import sys
import math

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()
for _ in range(int(input())):
	(x, y) = get_ints()
	print(x - 1, y)


I = input
for _ in range(int(I())):
	(a, b) = map(int, I().split())
	print(a - 1, b)


from sys import stdin
cas = int(stdin.readline().strip())
ans = 0

def sm(x):
	return x * (x + 1) // 2
for ca in range(cas):
	(n, m) = map(int, stdin.readline().strip().split())
	print(n - 1, m)


def solve(x, y):
	ans1 = x - 1
	ans2 = y
	print(ans1, ans2)
for i in range(int(input())):
	(x, y) = list(map(int, input().split()))
	solve(x, y)


t = int(input())

def solve():
	(a, b) = map(int, input().split())
	print(a if b == 0 else a - 1, b)
for _ in range(t):
	solve()


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

def it():
	return int(input())
for _ in range(it()):
	(x, y) = mp()
	if x == 1:
		print(0, y)
	else:
		print(x - 1, y)


x = int(input())
for _ in range(x):
	l = [int(i) for i in input().split()]
	l[0] = l[0] - 1
	print(*l)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	print(a - 1, b)


import sys
input = sys.stdin.readline

def solve():
	(x, y) = map(int, input().split())
	return [x - 1, y]
for _ in range(int(input())):
	print(*solve())


import os
from math import factorial
import sys
from io import BytesIO, IOBase

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

def IIX():
	return (int(x) for x in sys.stdin.readline().split())

def II():
	return int(inp())

def LI():
	return list(map(int, inp().split()))

def LS():
	return list(map(str, inp().split()))

def L(x):
	return list(x)

def out(var):
	return sys.stdout.write(str(var))

class GraphAL:

	def __init__(self, Nodes, isDirected=False):
		self.nodes = [x for x in range(1, Nodes + 1)]
		self.adj_list = {}
		self.isDirected = isDirected
		for node in self.nodes:
			self.adj_list[node] = []

	def add_edge(self, x, y):
		self.adj_list[x].append(y)
		if self.isDirected == False:
			self.adj_list[y].append(x)

	def return_graph(self):
		return self.adj_list

class GraphAM:

	def __init__(self, Nodes, isDirected=False):
		self.adj_matrix = [[0] * (Nodes + 1) for x in range(Nodes + 2)]
		self.isDirected = isDirected

	def add_edge(self, x, y):
		if self.isDirected:
			self.adj_matrix[x][y] = 1
		elif self.isDirected == False:
			self.adj_matrix[x][y] = 1
			self.adj_matrix[y][x] = 1

	def delete_edge(self, x, y):
		if self.isDirected:
			self.adj_matrix[x][y] = 0
		if self.isDirected == False:
			self.adj_matrix[x][y] = 0
			self.adj_matrix[y][x] = 0

	def degree(self, x):
		l = self.adj_matrix[x]
		return l.count(1)

	def return_graph(self):
		return self.adj_matrix

def solve():
	(x, y) = IIX()
	print(x - 1, y)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
try:
	t = II()
	for _ in range(t):
		solve()
except EOFError as e:
	out('')
except RuntimeError as r:
	out('')


try:
	for t in range(int(input())):
		(x, y) = map(int, input().split())
		print(x - 1, y)
except:
	pass


t = int(input())
z = 0
scores = []
while z < t:
	z += 1
	(a_sta, b_sta) = input().split()
	a_sta = int(a_sta)
	b_sta = int(b_sta)
	if a_sta < b_sta:
		if a_sta == 1:
			a_scr = 0
			b_scr = b_sta
			scores.append([a_scr, b_scr])
		elif a_sta < b_sta and a_sta != 0:
			a_scr = a_sta - 1
			b_scr = b_sta
			scores.append([a_scr, b_scr])
	elif a_sta == b_sta:
		scores.append([a_sta - 1, b_sta])
	else:
		b_scr = b_sta
		a_scr = a_sta - 1
		scores.append([a_scr, b_scr])
for score in scores:
	print(*score)


import sys, os
from math import sqrt, gcd, ceil, log, floor
from bisect import bisect, bisect_left
from collections import defaultdict, Counter, deque
from heapq import heapify, heappush, heappop
from itertools import permutations
input = sys.stdin.readline
read = lambda : list(map(int, input().strip().split()))
MOD = 10 ** 9 + 7

def main():
	for _ in range(int(input())):
		(a, b) = read()
		print(a - 1, b)
main()


inn = lambda : int(input())
inm = lambda : map(int, input().split())
ins = lambda : str(input())
ina = lambda : list(map(int, input().split()))

def solve():
	(x, y) = inm()
	print(x - 1, y)

def main():
	t = 1
	t = int(input())
	for _ in range(t):
		solve()
main()


import sys

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

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

def get_list_string():
	return list(map(str, sys.stdin.readline().strip().split()))

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

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

def get_print_int(x):
	sys.stdout.write(str(x) + '\n')

def get_print(x):
	sys.stdout.write(x + '\n')
from sys import maxsize

def solve():
	for _ in range(get_int()):
		(x, y) = get_ints()
		get_print(str(x - 1) + ' ' + str(y))
solve()


import math
import sys
from collections import defaultdict, Counter
from functools import lru_cache
t = int(input())
for _ in range(t):
	(a, b) = [int(i) for i in input().split()]
	print(a - 1, b)


a = int(input())
for i in range(a):
	(m, n) = map(int, input().split())
	x = m - 1
	y = n
	print(x, y)


a = int(input())
for i in range(0, a):
	(s1, s2) = map(int, input().split())
	if s2 > s1:
		print(s1 - 1, s2)
	elif s1 > s2:
		print(s1 - 1, s2)
	else:
		print(s1 - 1, s2)


def call():
	(x, y) = [int(x) for x in input().split()]
	print(f'{x - 1} {y}')
t = int(input())
for i in range(t):
	call()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	if n == 1:
		print('0', k)
	elif n >= k:
		print(n - 1, k)
	elif n < k:
		print(n - 1, k)


def ping():
	(x, y) = map(int, input().split())
	print(x - 1, end=' ')
	print(y)
t = int(input())
for i in range(t):
	ping()


n = int(input())
alice = []
bob = []
a_score = []
b_score = []
for x in range(n):
	stam = list(map(int, input().split()))
	alice.append(stam[0])
	bob.append(stam[1])
for stam in range(n):
	alice[stam] -= 1
	remove = alice[stam] - bob[stam]
	print(f'{alice[stam]} {bob[stam]}')


t = int(input())
for _ in range(0, t):
	inputs = [int(num) for num in input().split()]
	x = inputs[0]
	y = inputs[1]
	print(f'{x - 1} {y}')


from collections import *
from heapq import *
from itertools import *
from functools import *
from random import *
import sys
INF = float('Inf')

def genTokens(lines):
	for line in lines:
		for token in line.split():
			yield token

def nextFn(fn):
	return lambda it: fn(it.__next__())
nint = nextFn(int)

def genCases():
	it = genTokens(sys.stdin)
	T = nint(it)
	for _ in range(T):
		X = nint(it)
		Y = nint(it)
		yield (X, Y)

def main():
	for case in genCases():
		solve(case)

def solve(case):
	(X, Y) = case
	print(X - 1, Y)
main()


t = int(input())
while t > 0:
	t -= 1
	(x, y) = map(int, input().split(' '))
	print(x - 1, y)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	print(x - 1, y)


t = int(input())
X = []
Y = []
for i in range(t):
	(x, y) = map(int, input().split())
	X.append(x)
	Y.append(y)
for i in range(t):
	print(X[i] - 1, Y[i])


games = int(input())
for i in range(games):
	(Alice, Bob) = input().split(' ')
	Alice = int(Alice)
	Bob = int(Bob)
	if Alice > 0:
		if Bob != 0:
			print(Alice - 1, Bob)
		else:
			print(Alice, Bob)
	else:
		print(Alice, Bob)


from sys import stdin, stdout
import math
from itertools import permutations, combinations
from collections import defaultdict
from collections import Counter
from bisect import bisect_left
import sys
from queue import PriorityQueue
import operator as op
from functools import reduce
mod = 1000000007

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

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

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

def printIn(ob):
	return stdout.write(str(ob) + '\n')

def powerLL(n, p):
	result = 1
	while p:
		if p & 1:
			result = result * n % mod
		p = int(p / 2)
		n = n * n % mod
	return result

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def SieveOfEratosthenes(n):
	prime_list = []
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			prime_list.append(p)
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime_list

def get_divisors(n):
	for i in range(1, int(n / 2) + 1):
		if n % i == 0:
			yield i
	yield n

def myCode():
	(x, y) = In()
	print(x - 1, y)

def main():
	for t in range(I()):
		myCode()
main()


for _ in 'A' * int(input()):
	(n, m) = map(int, input().split())
	print(n - 1, m)


import sys
input = iter(sys.stdin.read().splitlines()).__next__
TC = int(input())
for tc in range(TC):
	(x, y) = map(int, input().split())
	print('%d %d' % (x - 1, y))


t = int(input())
while t > 0:
	(a, b) = map(int, input().split())
	if a == 0:
		print(a, b)
	print(a - 1, b)
	t = t - 1


for case in range(int(input())):
	(x, y) = [int(x) for x in input().split()]
	k = min(x // 2, y)
	print(x - 1, y)


T = int(input())
for _ in range(T):
	(X, Y) = map(int, input().split())
	print(X - 1, Y)


import math
for i in range(0, int(input())):
	(x, y) = map(int, input().split())
	print(x - 1, y)


t = int(input())
ans = ''
for i in range(t):
	(x, y) = input().split()
	(x, y) = (int(x), int(y))
	res = str(x - 1) + ' ' + str(y)
	ans += res + '\n'
print(ans)


n = int(input())
for i in range(n):
	(x, y) = map(int, input().strip().split())
	print(x - 1, y)


o = int(input())
for j in range(o):
	(h, l) = map(int, input().split())
	print(h - 1, l)


x = int(input())
for m in range(x):
	(y, z) = map(int, input().split())
	print(y - 1, z)


def program():
	(a, b) = [int(x) for x in input().split()]
	print(a - 1, b)
test = 1
test = int(input())
for i in range(test):
	program()