In Omkar's last class of math, he learned about the least common multiple, or $LCM$. $LCM(a, b)$ is the smallest positive integer $x$ which is divisible by both $a$ and $b$.

Omkar, having a laudably curious mind, immediately thought of a problem involving the $LCM$ operation: given an integer $n$, find positive integers $a$ and $b$ such that $a + b = n$ and $LCM(a, b)$ is the minimum value possible.

Can you help Omkar solve his ludicrously challenging math problem?


-----Input-----

Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \leq t \leq 10$). Description of the test cases follows.

Each test case consists of a single integer $n$ ($2 \leq n \leq 10^{9}$).


-----Output-----

For each test case, output two positive integers $a$ and $b$, such that $a + b = n$ and $LCM(a, b)$ is the minimum possible.


-----Example-----
Input
3
4
6
9

Output
2 2
3 3
3 6



-----Note-----

For the first test case, the numbers we can choose are $1, 3$ or $2, 2$. $LCM(1, 3) = 3$ and $LCM(2, 2) = 2$, so we output $2 \ 2$.

For the second test case, the numbers we can choose are $1, 5$, $2, 4$, or $3, 3$. $LCM(1, 5) = 5$, $LCM(2, 4) = 4$, and $LCM(3, 3) = 3$, so we output $3 \ 3$.

For the third test case, $LCM(3, 6) = 6$. It can be shown that there are no other pairs of numbers which sum to $9$ that have a lower $LCM$.

Source: codeforces | Difficulty: EASY
Tags: Number theory

Mathematics

Greedy algorithms


Solutions:
from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

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

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

def solve():
	n = ri()
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		sq = int(n ** 0.5) + 2
		for i in range(3, sq):
			if n % i == 0:
				print(n // i, n - n // i)
				return
		print(1, n - 1)
		return
mode = 'T'
if mode == 'T':
	t = ri()
	for i in range(t):
		solve()
else:
	solve()


import math
t = int(input())
answers = []
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		answers.append([n / 2, n / 2])
	else:
		factor = 1
		for j in range(2, int(math.sqrt(n)) + 1):
			if n % j == 0:
				factor = n / j
				break
		answers.append([factor, n - factor])
for i in range(t):
	for j in range(2):
		print(int(answers[i][j]), end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		a = b = n // 2
		print(a, b)
	else:
		max_a = 1
		for i in range(3, int(n ** (1 / 2)) + 1, 2):
			if n % i == 0:
				a = n // i
				max_a = max(a, max_a)
		print(max_a, n - max_a)


from math import sqrt

def f(x):
	for i in range(3, int(sqrt(x + 2)) + 2, 2):
		if x % i == 0:
			return i
	return x
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		q = f(n)
		if q != n:
			p = n // q
			print(p, n - p)
		else:
			print(1, n - 1)


case = int(input())
for _ in range(case):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
		continue
	d = 3
	ans = False
	while d <= n ** 0.5:
		if n % d == 0:
			ans = True
			break
		d += 1
	if ans == True:
		print(n // d, n - n // d)
	else:
		print(1, n - 1)


def solve1():
	n = int(input())
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			print(n - n // i, n // i)
			break
	else:
		print(n - 1, 1)
for _ in range(int(input())):
	solve1()


from math import *
t = int(input())
while t:
	t = t - 1
	n = int(input())
	cop = n
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		flag = 0
		out = 1
		for i in range(2, int(sqrt(cop)) + 1):
			if n % i == 0:
				out = i
				n //= i
				flag = 1
				break
		m = max(out, n)
		if flag:
			print(m, cop - m)
		else:
			print(1, cop - 1)


import sys
from math import sqrt
input = sys.stdin.readline
LI = lambda : list(map(int, input().split()))
MI = lambda : map(int, input().split())
m = int(100000.0)
isPrime = [True] * m
for i in range(2, m):
	for j in range(i + i, m, i):
		isPrime[j] = False
isPrime[0] = isPrime[1] = False
primes = []
for (i, v) in enumerate(isPrime):
	if v:
		primes.append(i)
for _ in range(int(input())):
	n = int(input())
	ans = 0
	m = sqrt(n)
	for i in primes:
		if i > m:
			break
		if n % i == 0:
			ans = i
			break
	if ans:
		print(n // ans, n - n // ans)
	else:
		print(1, n - 1)


from math import sqrt

def is_prime(x):
	if x == 2 or x == 3:
		return True
	else:
		for i in range(2, int(sqrt(x)) + 1):
			if x % i == 0:
				return False
		return True
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		ans = ()
		for i in range(2, int(sqrt(n)) + 1):
			if n % i == 0 and is_prime(i):
				ans = (n // i, n - n // i)
				break
		if not ans:
			print(1, n - 1)
		else:
			print(*ans)


def check_factor(n):
	li = []
	for i in range(int(n ** (1 / 2)), 1, -1):
		if n % i == 0:
			li.append(n - i)
			li.append(n - n // i)
	if len(li) != 0:
		return min(li)
	return 0
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		an = check_factor(n)
		if an:
			print(an, n - an)
		else:
			print(1, n - 1)


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop
import math
from collections import *
from functools import reduce, cmp_to_key, lru_cache
import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
M = mod = 10 ** 9 + 7

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip().split()]

def st():
	return str(input().rstrip())[2:-1]

def val():
	return int(input().rstrip())

def li2():
	return [str(i)[2:-1] for i in input().rstrip().split()]

def li3():
	return [int(i) for i in st()]
for _ in range(val()):
	n = val()
	l = factors(n)
	ans = 10 ** 18
	for i in l[:-1]:
		lcm = i * (n - i) // math.gcd(i, n - i)
		if lcm < ans:
			ans = lcm
			(a, b) = (i, n - i)
	print(a, b)


import math
for _ in range(int(input())):
	n = int(input())
	mi = [n - 1, 1, n - 1]
	for i in range(2, int(math.sqrt(n) + 1.1)):
		if n % i == 0:
			mi = min(mi, [i * (n - i) // math.gcd(i, n - i), i, n - i])
			mi = min(mi, [n // i * (n - n // i) // math.gcd(n // i, n - n // i), n // i, n - n // i])
	print(mi[1], mi[2])


import math
t = int(input())
cases = []
for i in range(t):
	cases.append(int(input()))

def solve(case):
	if case % 2 == 0:
		print(case // 2, case // 2)
		return
	for fpf in range(3, int(case ** (1 / 2)) + 1, 2):
		if case % fpf == 0:
			print(case // fpf, case - case // fpf)
			return
	print(1, case - 1)
for case in cases:
	solve(case)


for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		idel = 1
		ans = n - 1
		for i in range(3, int(n ** 0.5) + 2):
			if n % i == 0:
				idel = n // i
				ans = min(ans, n - n // i)
		print(ans, n - ans)


from math import gcd

def div(n):
	x = 1
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			x = i
			break
	if x == 1:
		return (x, n - x)
	return (n // x, n - n // x)
for _ in range(int(input())):
	n = int(input())
	(x, y) = div(n)
	print(x, y)


for i in range(int(input())):
	n = int(input())
	a = 1
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			a = n // i
			break
	print(a, n - a)


import math
for _ in range(int(input())):
	n = int(input())
	f = 0
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			d = n // i
			print('{} {}'.format(d, n - d))
			f = 1
			break
	if f == 0:
		print(1, n - 1)


import math

def lcm(a, b):
	return int(a * b / math.gcd(a, b))
t = int(input())
for _ in range(t):
	n = int(input())
	ans = n - 1
	for g in range(1, int(math.sqrt(n)) + 1):
		if n % g == 0:
			ans = min(ans, n - g)
			if g > 1:
				ans = min(ans, n - n / g)
	print(int(n - ans), int(ans))


for test in range(int(input())):
	n = int(input())
	for x in range(2, int(n ** 0.5) + 1):
		t = n // x
		if (n - t) % t == 0:
			print(t, n - t)
			break
	else:
		print(1, n - 1)


from sys import stdin, stdout
import sys
from math import *

def c(n):
	f = [1]
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			if n % (n // i) == 0:
				f.append(n // i)
			f.append(i)
	f = list(set(f))
	f.sort()
	return f

def lcm(a, b):
	return a * b // gcd(a, b)
for __ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		f = c(n)
		ans = inf
		a = 1
		b = n - 1
		for i in range(len(f)):
			if ans > lcm(f[i], n - f[i]):
				ans = lcm(f[i], n - f[i])
				a = f[i]
				b = n - f[i]
		print(min(a, b), max(a, b))


import math
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		x = n
		m = 0
		for i in range(2, int(math.sqrt(n)) + 1):
			if x % i == 0:
				m = x // i
				break
		a = m
		b = n - m
		if a == 0:
			a = 1
			b = b - 1
		print(a, b)


from math import sqrt
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(f'{n // 2} {n // 2}')
		continue
	h = int(sqrt(n) + 3)
	ans = 0
	for i in range(3, h, 2):
		if n % i == 0:
			ans = i
			break
	if ans == 0:
		ans = n
	print(f'{n // ans} {n - n // ans}')


for _ in range(int(input())):
	n = int(input())
	if n > 3:
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				break
		if n % i == 0:
			print(n // i, n - n // i)
		else:
			print(1, n - 1)
	else:
		print(1, n - 1)


pri = {}
pl = []

def Sieve():
	n = 100000
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = False
	prime[1] = False
	for p in range(n + 1):
		if prime[p]:
			pri[p] = 1
			pl.append(p)
Sieve()
for _ in range(int(input())):
	n = int(input())
	ans = 1
	if n in pri:
		print(1, n - 1)
		continue
	for p in pl:
		if p > n:
			break
		if n % p == 0:
			ans = n // p
			break
	print(n - ans, ans)


for t in range(int(input())):
	n = int(input())
	p = -1
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			p = i
			break
	if p == -1:
		k = 1
	else:
		k = n // p
	print(k, n - k)


t = input('')
t = int(t)
test = 1
while test <= t:
	n = input('')
	n = int(n)
	i = 2
	e = 0
	while i * i <= n:
		if n % i == 0:
			print(int(n / i), int(n * (i - 1) / i))
			e = 1
			break
		i = i + 1
	if e == 0:
		print('1', n - 1)
	test = test + 1


import math

def lcm(a, b):
	return a * b // math.gcd(a, b)
for s in [*open(0)][1:]:
	n = int(s)
	mn = 10 ** 9
	largest_div = 1
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			largest_div = max(largest_div, n // i)
	print(largest_div, n - largest_div)


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 dict(a):
	d = {}
	for x in a:
		if d.get(x, -1) != -1:
			d[x] += 1
		else:
			d[x] = 1
	return d

def main():
	try:
		n = I()
		fact = 1
		temp = int(n ** 0.5)
		for i in range(2, temp + 1, 1):
			if n % i == 0:
				fact = n // i
				break
		print(fact, n - fact)
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(I()):
	main()


def prime_factors(N):
	ret = []
	middle = int(N ** (1 / 2))
	tmp = N
	for i in range(2, middle + 1):
		if tmp % i == 0:
			while tmp % i == 0:
				tmp //= i
			ret.append(i)
	if tmp != 1:
		ret.append(tmp)
	return ret

def solve(n):
	if n == 2:
		return [1, 1]
	p = sorted(prime_factors(n))[0]
	return [n // p, n // p * (p - 1)]

def main():
	T = int(input())
	N = [int(input()) for _ in range(T)]
	ANS = [' '.join(map(str, solve(n))) for n in N]
	print('\n'.join(ANS))
main()


for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		m = int(n ** (1 / 2)) + 1
		x = 1
		while m > 1:
			if n % m == 0:
				x = max(m, n // m)
			m -= 1
		print(x, n - x)


import math
for _ in range(int(input())):
	n = int(input())
	divisores = set()
	for aux in range(1, int(math.sqrt(n)) + 1):
		if n % aux == 0:
			divisores.add(aux)
			if n / aux != n:
				divisores.add(n // aux)
	penultimo_divisor = max(list(divisores))
	print(str(penultimo_divisor) + ' ' + str(n - penultimo_divisor))


def give(n):
	flag = 'no'
	for i in range(3, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			flag = 'yes'
			break
	if flag == 'no':
		return (1, n - 1)
	else:
		x = n // i
		y = x * (i - 1)
		return (x, y)
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif n == 1:
		print(1, 1)
	else:
		ans = give(n)
		print(ans[0], ans[1])


t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print('{} {}'.format(n // 2, n - n // 2))
	else:
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				a = n // i
				b = n - a
				print('{} {}'.format(a, b))
				break
		else:
			print('1 {}'.format(n - 1))


def check(n):
	mfactor = 1
	for i in range(2, int(n ** (1 / 2)) + 1):
		if n % i == 0:
			mfactor = max(mfactor, i)
			mfactor = max(mfactor, n / i)
	return mfactor
for _ in range(int(input())):
	n = int(input())
	print(int(check(n)), int(n - check(n)))


count = int(input())

def SmallestDivisor(n: int) -> int:
	i = 2
	while i ** 2 <= n:
		if n % i == 0:
			return i
		i += 1
	return n
for i in range(count):
	sum = int(input())
	a = sum // SmallestDivisor(sum)
	b = sum - a
	print(f'{a} {b}')


import math
for _ in range(int(input())):
	n = int(input())
	(lo, a, b) = (0, 0, 0)
	if not n & 1:
		print(n // 2, n // 2)
	elif n % 3 == 0:
		print(n // 3, n - n // 3)
	else:
		for i in range(2, 100000):
			if n % i == 0:
				a = i
				break
		if a == 0:
			a = n
		a = n // a
		b = n - a
		print(min(a, b), max(a, b))


t = int(input())

def q(n):
	m = int(n ** (1 / 2)) + 2
	for i in range(2, m):
		if n % i == 0:
			v = n // i
			v1 = v
			v2 = v * (i - 1)
			return str(v1) + ' ' + str(v2)
	return '1 ' + str(n - 1)
for i in range(t):
	n = int(input())
	print(q(n))


def lcm(n):
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		for i in range(2, int(n ** (1 / 2)) + 1):
			if n % i == 0:
				if (n - n // i) % (n // i) == 0:
					print(n // i, n - n // i)
					return
		print(1, n - 1)
t = int(input())
l = []
for i in range(t):
	s = int(input())
	l.append(s)
for j in l:
	lcm(j)


import math
t = int(input())
for i in range(t):
	n = int(input())
	num = 1
	for j in range(2, int(math.sqrt(n)) + 1):
		if n % j == 0:
			num = n // j
			break
	print(num, n - num)


t = int(input())
for i in range(0, t):
	n = int(input())
	if n % 2 == 0:
		L = [n // 2, n // 2]
		print(*L)
	else:
		z = n ** 0.5
		if z == int(z):
			print(*[int(z), n - int(z)])
		else:
			N = []
			for i in range(1, int(z) + 1, 2):
				if n % i == 0:
					N.append(i)
					N.append(n // i)
			N.sort()
			print(*[N[-2], n - N[-2]])


import math
t = int(input())
for j in range(t):
	n = int(input())
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			a = n // i
			b = n - a
			break
	else:
		a = n - 1
		b = 1
	print(a, b)


for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		sol = [n // 2, n // 2]
	else:
		end = False
		for p in range(3, int(pow(n, 0.5)) + 2, 2):
			if not n % p:
				sol = [n // p, n // p * (p - 1)]
				end = True
				break
		if not end:
			sol = [1, n - 1]
	print(' '.join([str(i) for i in sol]))


t = int(input())
while t:
	t -= 1
	n = int(input())
	l = [1]
	for i in range(int(n ** 0.5), 1, -1):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	l.sort(reverse=True)
	mi = 10000000000000
	for i in range(len(l)):
		if (n - l[i]) % l[i] == 0:
			if max(l[i], n - l[i]) < mi:
				a1 = l[i]
				a2 = n - l[i]
				mi = max(a1, a2)
	print(a1, a2)


import sys
input = sys.stdin.readline
import math
T = int(input())
for t in range(T):
	N = int(input())
	lim = int(math.sqrt(N))
	for i in range(2, lim + 1):
		if N % i == 0:
			print(N // i, N - N // i)
			break
	else:
		print(1, N - 1)


import sys
import math
from functools import reduce
import bisect

def getN():
	return int(input())

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

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

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

def index(a, x):
	i = bisect.bisect_left(a, x)
	if i != len(a) and a[i] == x:
		return i
	return False
for _ in range(int(input())):
	n = int(input())
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			print(n // i, n - n // i)
			break
	else:
		print(1, n - 1)


import math
T = int(input())

def get_least_prime_factor(x):
	if x % 2 == 0:
		return 2
	for i in range(3, int(math.sqrt(x)) + 1, 2):
		if x % i == 0:
			return i
	return x
for _ in range(T):
	n = int(input())
	lpf = get_least_prime_factor(n)
	a = n // lpf
	b = n - a
	print(a, b)


from math import sqrt

def primes(n):
	arr = []
	flag = 0
	while n % 2 == 0:
		if flag == 0:
			arr.append(2)
			flag = 1
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		flag = 0
		while n % i == 0:
			if flag == 0:
				arr.append(i)
				flag = 1
			n = n // i
	if n > 2:
		arr.append(n)
	return arr
t = int(input())
for x in range(t):
	n = int(input())
	primesarr = primes(n)
	print(n // primesarr[0], n - n // primesarr[0])


import sys
import collections

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

def split_input():
	return [int(i) for i in input().split()]
tests = int(input())
for _ in range(tests):
	n = int(input())
	for i in range(2, int(n ** 0.5) + 2):
		if n % i == 0:
			print((i - 1) * (n // i), n // i)
			break
	else:
		print(1, n - 1)


import math
for _ in range(int(input())):
	n = int(input())
	flag = 0
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			print(n // i, n - n // i)
			flag = 1
			break
	if flag != 1:
		print(n - 1, 1)


t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		left = 1
		right = n - 1
		i = 2
		while i * i <= n:
			if n % i == 0:
				left = int(n / i)
				right = n - left
				break
			i += 1
		print(left, right)


t = int(input())

def smallestDiv(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		x = n // smallestDiv(n)
		y = n - x
		print(x, y)


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 dict(a):
	d = {}
	for x in a:
		if d.get(x, -1) != -1:
			d[x] += 1
		else:
			d[x] = 1
	return d

def find_le(a, x):
	i = bi.bisect_right(a, x)
	if i:
		return i - 1
	else:
		return -1

def primeFactors(n):
	ans = []
	while n % 2 == 0:
		ans.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			ans.append(i)
			n = n // i
	if n > 2:
		ans.append(n)
	return ans

def main():
	try:
		n = I()
		if n % 2 == 0:
			print(n // 2, n // 2)
		else:
			temp = primeFactors(n)
			if len(temp):
				p = min(temp)
				k = n // p
				print(k, n - k)
			else:
				print(1, n - 1)
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(I()):
	main()


def driver():
	t = int(input())
	for i in range(t):
		solution()

def solution():
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		for i in range(3, int(n ** 0.5) + 1, 2):
			if n % i == 0:
				i = max(i, n // i)
				print(i, i * (n // i - 1))
				break
		else:
			print(1, n - 1)
driver()


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	flag = 0
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			print(n // i, (i - 1) * n // i)
			flag = 1
			break
	if flag == 0:
		print(n - 1, 1)


t = int(input())
from math import gcd as __gcd

def findTwoNumbers(sum, gcd):
	print(min(gcd, sum - gcd), sum - min(gcd, sum - gcd))
for i in range(t):
	import math
	n = int(input())
	div = []
	for i in range(1, int(math.sqrt(n)) + 1):
		if n % i == 0:
			if n / i == 0:
				div.append(i)
			else:
				div.append(i)
				div.append(n // i)
	div.sort()
	a = 0
	b = len(div) - 1
	gc = 0
	for i in range(len(div)):
		for j in range(len(div)):
			if i != j:
				x = math.gcd(div[i], div[j])
				if x > gc:
					gc = x
	findTwoNumbers(n, gc)


from math import sqrt

def is_prime(n):
	if n % 2 == 0:
		return 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		if n % i == 0:
			return i
	return n
y = int(input())
ans = []
for i in range(y):
	n = int(input())
	t = is_prime(n)
	print(int(n / t), int((t - 1) * (n / t)))


import math
T = int(input().rstrip())

def solve(n):
	if n % 2 == 0:
		ans = int(n / 2)
		print(f'{ans} {ans}')
		return
	counter = 3
	max_counter = int(math.sqrt(n))
	while n % counter != 0 and counter <= max_counter:
		counter += 2
	if n % counter == 0:
		ans1 = int(n / counter)
		ans2 = ans1 * (counter - 1)
		print(f'{ans1} {ans2}')
	else:
		print(f'{1} {n - 1}')
for test in range(T):
	n = int(input().rstrip())
	solve(n)


import math
T = int(input())
for i in range(T):
	n = int(input())
	ans = [1e+30, 1e+30]
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			cand = sorted([i, n - i])
			if cand[1] < ans[1]:
				ans = cand
			cand = sorted([n // i, n - n // i])
			if cand[1] < ans[1]:
				ans = cand
	print(*ans)


from math import sqrt

def solve(n):
	i = 2
	ans = -1
	while i <= sqrt(n):
		if n % i == 0:
			ans = max(ans, i)
			if n // i <= n // 2:
				ans = max(ans, n // i)
		i += 1
	return ans if ans != -1 else None
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		p = solve(n)
		if p is None:
			print(1, n - 1)
		else:
			print(p, n - p)


from math import sqrt

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def fun(n):
	if n % 2 == 0:
		return (n // 2, n // 2)
	elif isPrime(n):
		return (1, n - 1)
	else:
		for i in range(2, n // 2):
			if isPrime(i) and n % i == 0:
				return (n // i, n - n // i)
for _ in range(int(input())):
	n = int(input())
	print(*fun(n))


import math
for _ in range(int(input())):
	n = int(input())
	k = 1000000000.0
	for i in range(1, int(math.sqrt(n)) + 1):
		if n % i == 0:
			d = n / i
			k = min(k, d - 1)
			if i == 1:
				continue
			k = min(k, n / d - 1)
	x = n / (k + 1)
	print('{} {}'.format(int(x), int(x * k)))


t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		f = 0
		for i in range(2, int(n ** (1 / 2)) + 1):
			if n % i == 0:
				c = n // i
				f = 1
				print(c, n - c)
				break
		if f == 0:
			print(1, n - 1)


t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		a = n // 2
		b = n // 2
		print(a, b)
	else:
		r = int(n ** (1 / 2))
		x = 0
		a = 0
		b = 0
		for i in range(1, r):
			if n % (i + 1) == 0:
				a = n // (i + 1)
				b = i * a
				break
		if a != 0 and b != 0:
			print(a, b)
		else:
			print(1, n - 1)


import math

def result(n):
	res = []
	m = int(math.sqrt(n))
	for i in range(1, m + 1):
		if n % i == 0:
			if i <= n / 2:
				res.append(i)
			if n // i <= n / 2:
				res.append(n // i)
	return (max(res), n - max(res))
t = int(input())
for i in range(t):
	n = int(input())
	(a, b) = result(n)
	print(str(a) + ' ' + str(b))


import math
for _ in range(int(input())):
	n = int(input())
	x = int(math.sqrt(n))
	o = 1
	for i in range(2, x + 1):
		if n % i == 0:
			o = i
			break
	if o == 1:
		print(1, n - 1)
	else:
		print(n // o, n - n // o)


t = int(input())
for _ in range(t):
	n = int(input())
	p = 0
	for m in range(2, 100001):
		if n % m == 0:
			p = m
			break
		if p == 0:
			p = n
	s = '{} {}'.format(int(n / p), int(n - n / p))
	print(s)


import math
for x in range(int(input())):
	n = int(input())
	p = 10000000000
	for x1 in range(int(math.sqrt(n)), 0, -1):
		if (n - x1) % x1 == 0:
			k = n // x1
			if max(x1, n - x1) < p:
				ans = x1
				ans1 = n - x1
				p = max(ans, ans1)
			if (n - k) % k == 0:
				if max(k, n - k) < p:
					ans = k
					ans1 = n - k
					p = max(ans, ans1)
	print(ans, ans1)


import math

def factors(x):
	result = []
	i = 1
	while i * i <= x:
		if x % i == 0:
			result.append(i)
			if x // i != i:
				result.append(x // i)
		i += 1
	return result

def lcm(a, b):
	return a * b // math.gcd(a, b)
for _ in range(int(input())):
	n = int(input())
	factor = factors(n)
	factor.sort()
	ans = 1e+18
	aans = 1
	bans = 1
	for i in factor:
		if i == n:
			break
		a = i
		b = n - i
		tmp = lcm(a, b)
		if min(ans, tmp) == tmp:
			aans = a
			bans = b
			ans = min(ans, tmp)
	print(aans, bans)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
		continue
	found = False
	for i in range(2, int(n ** 0.5 + 1)):
		if n % i == 0:
			print(n // i, n - n // i)
			found = True
			break
	if not found:
		print(1, n - 1)


import os
import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from io import BytesIO, IOBase
from itertools import accumulate, combinations, combinations_with_replacement, groupby, permutations, product
from math import acos, asin, atan, ceil, cos, degrees, factorial, hypot, log2, pi, radians, sin, sqrt, tan
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

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

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

def instr():
	s = input()
	return list(s[:len(s)])

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

def prime_factors(n):
	limit = int(sqrt(n)) + 1
	for i in range(2, limit):
		if n % i == 0:
			return n // i
	return n

def main():
	t = inp()
	for _ in range(t):
		n = inp()
		f = prime_factors(n)
		if f == n:
			print(f - 1, 1)
		else:
			c = n // f
			if c % 2 == 0:
				print(f * (c // 2), f * (c // 2))
			else:
				print(f, f * (c - 1))
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.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))

def input():
	return sys.stdin.readline().rstrip('\r\n')
main()


from math import sqrt
t = int(input())
nums = []
for i in range(t):
	nums.append(int(input()))
for i in range(t):
	n = nums[i]
	if n and 1:
		maximum = 0
		for i in range(1, int(sqrt(n) + 1)):
			if n % i == 0:
				maximum = max(maximum, i)
				if i != 1:
					maximum = max(maximum, n / i)
		print(int(n - maximum), int(maximum))
	else:
		print(int(n / 2), int(n / 2))


import math
import bisect
import copy
import time
from collections import Counter

def printDivisors(n):
	l = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n / i)
		i = i + 1
	return l
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
		continue
	if n % 3 == 0:
		print(n // 3, n // 3 * 2)
		continue
	l = printDivisors(n)
	l.sort()
	l = l[:-1]
	ans = 0
	for i in range(len(l) - 1, -1, -1):
		if (n - l[i]) % l[i] == 0:
			ans = l[i]
			break
	print(int(n - ans), int(l[i]))


for _ in range(int(input())):
	n = int(input())
	p = 0
	for i in range(2, 100000):
		if n % i == 0:
			p = i
			break
	else:
		if p == 0:
			p = n
	print(n // p, n - n // p)


t = int(input())
import math

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

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
for k in range(t):
	n = int(input())
	if n % 2 == 0:
		print(f'{n // 2} {n // 2}')
	elif isPrime(n):
		print(f'{1} {n - 1}')
	else:
		x = math.inf
		for i in range(3, int(math.sqrt(n)) + 1, 1):
			if n % i == 0:
				x = min(x, i)
		ansX = n // x
		print(f'{ansX} {n - ansX}')


import sys
input = sys.stdin.readline
(inp, ip) = (lambda : int(input()), lambda : [int(w) for w in input().split()])
from math import sqrt
for _ in range(inp()):
	n = inp()
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif n % 3 == 0:
		print(n // 3, 2 * n // 3)
	else:
		x = []
		for i in range(int(sqrt(n)), 1, -1):
			if n % i == 0:
				x.append(i)
				x.append(n // i)
		x.sort(reverse=True)
		x.append(1)
		for i in x:
			if (n - i) % i == 0:
				print(i, n - i)
				break


n = int(input())
from math import sqrt
for _ in range(n):
	x = int(input())
	for i in range(2, int(sqrt(x)) + 1):
		if not x % i:
			print(x // i, x - x // i)
			break
	else:
		print(1, x - 1)


import math

def primes(n):
	arr = []
	while n % 2 == 0:
		arr.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			arr.append(i)
			n = n // i
	if n > 2:
		arr.append(n)
	return sorted(arr)
for _ in range(int(input())):
	n = int(input())
	arr = primes(n)
	arr = sorted(arr, reverse=True)
	k = 1
	for m in range(len(arr) - 1):
		k *= arr[m]
	print(k, n - k)


import math

def isPrime(n):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True
t = int(input())
while t:
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif isPrime(n):
		print(1, n - 1)
	else:
		larg = 0
		for i in range(2, int(math.sqrt(n)) + 1):
			if n % i == 0:
				larg = i
				break
		print(n // larg, n - n // larg)
	t -= 1


def divisor(n):
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(int(n / 2), int(n / 2))
	else:
		val = int(n / divisor(n))
		print(val, n - val)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	ans = n
	for i in range(2, math.ceil(math.sqrt(n)) + 1):
		if n % i == 0:
			ans = i
			break
	print(n // ans, n // ans * (ans - 1))


import math
t = int(input())

def smallestDivisor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n

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

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

def maxPrimeFactor(n):
	while n % 2 == 0:
		max_Prime = 2
		n /= 1
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			max_Prime = i
			n = n / i
	if n > 2:
		max_Prime = n
	return int(max_Prime)

def opt_pair(n):
	if n % 2 == 0:
		return (int(n / 2), int(n / 2))
	else:
		smallest_prime = smallestDivisor(n)
		rest = int(n / smallest_prime)
		return (rest, rest * (smallest_prime - 1))
for i in range(t):
	n = int(input())
	(a, b) = opt_pair(n)
	print(str(a) + ' ' + str(b))


import time

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	a = []
	for p in range(2, n):
		if prime[p]:
			a.append(p)
	return a
c = SieveOfEratosthenes(1000000)
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		cnt = 0
		for i in c:
			if i > n:
				break
			if n % i == 0:
				print(n // i, n - n // i)
				cnt = 1
				break
		if cnt == 0:
			print(1, n - 1)


ii = lambda : int(input())
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
import math
for _ in range(ii()):
	n = ii()
	c = 0
	p = 0
	dn = 0
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		for i in range(2, int(math.sqrt(n)) + 1):
			if n % i == 0 and dn == 0:
				ans = n // i
				c = c + 1
				dn = dn + 1
		if c == 0 or n == 2:
			print(n - 1, 1)
			p = p + 1
		elif int(math.sqrt(n)) != math.sqrt(n) and p == 0:
			print(ans, n - ans)
			p = p + 1
		elif c < 2 and p == 0:
			print(int(math.sqrt(n)), int(n - math.sqrt(n)))
			p = p + 1
		elif p == 0:
			for i in range(0, n // 3 + 1):
				if 3 * i == n:
					print(i, 2 * i)
					p = p + 1
					break


import math
t = int(input())
for _ in range(t):
	n = int(input())
	divisor = -1
	root = math.sqrt(n)
	if math.floor(root) == math.ceil(root):
		upper = math.floor(root) + 1
	else:
		upper = math.ceil(root)
	for i in range(2, upper):
		if n % i == 0:
			divisor = i
			break
	if divisor == -1:
		(x, y) = (1, n - 1)
	else:
		(x, y) = (1, divisor - 1)
	g = n // (x + y)
	print(g * x, g * y)


def mgcd(n):
	i = 2
	f = 1
	first = -1
	dn = n
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n = n // i
			if first == -1:
				first = i
			f *= i
	if n > 1:
		if dn == n:
			return 1
		f *= n
	return f // first
for _ in range(int(input())):
	n = int(input())
	if n & 1:
		x = mgcd(n)
		print(x, n - x)
	else:
		print(n // 2, n // 2)


import math

def answer(n):
	copy = n
	if n % 2 == 0:
		return [n // 2, n // 2]
	else:
		for i in range(3, int(math.sqrt(n)) + 1):
			if n % i == 0:
				return [n // i, n - n // i]
		return [1, n - 1]
t = int(input())
for i in range(t):
	n = int(input())
	print(*answer(n))


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
import bisect
from heapq import *
from math import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
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.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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

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

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

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

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

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

def power(a, b):
	ans = 1
	while b > 0:
		if b % 2 == 1:
			ans *= a
		a *= a
		b //= 2
	return ans

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def solve():
	n = int(inp())
	val = [1, n - 1]
	l = n - 1
	for i in range(2, floor(n ** 0.5) + 1):
		if n % i == 0:
			if lcm(i, n - i) < l:
				val = [i, n - i]
				l = lcm(i, n - i)
			if lcm(n // i, n - n // i) < l:
				val = [n // i, n - n // i]
				l = lcm(n // i, n - n // i)
	print(*val)
testcase(int(inp()))


t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		m = int(n ** (1 / 2)) + 1
		x = 1
		while m > 1:
			if n % m == 0:
				x = max(m, n // m)
			m -= 1
		print(x, n - x)


import bisect
import os
import gc
import sys
from io import BytesIO, IOBase
from collections import Counter
from collections import deque
import heapq
import math
import statistics

def sin():
	return input()

def ain():
	return list(map(int, sin().split()))

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

def iin():
	return int(sin())
MAX = float('inf')
MIN = float('-inf')
MOD = 1000000007

def readTree(n, m):
	adj = [deque([]) for _ in range(n + 1)]
	for _ in range(m):
		(u, v) = ain()
		adj[u].append(v)
		adj[v].append(u)
	return adj

def main():
	for _ in range(iin()):
		n = iin()
		if n & 1 == 0:
			print(n // 2, end=' ')
			print(n // 2)
		else:
			i = 3
			ans = -1
			while i * i <= n:
				if n % i == 0:
					ans = i
					break
				i += 2
			if ans == -1:
				print(1, n - 1)
			else:
				print(n // i, n - n // i)
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.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')
main()


from sys import stdin
import math
inp = lambda : stdin.readline().strip()
t = int(inp())

def printDivisors(n):
	divisors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if i != n and n / i == i:
				divisors.append(i)
			else:
				if i != n:
					divisors.append(i)
				if n // i != n:
					divisors.append(n // i)
		i = i + 1
	return divisors
for _ in range(t):
	n = int(inp())
	x = max(printDivisors(n))
	print(x, n - x)


a = input()
for x in range(int(a)):
	b = int(input())
	if b % 2 == 0:
		print(b // 2, b // 2)
	else:
		tag = int(b ** 0.5) + 1
		ans = 1
		ans1 = b - 1
		for i in range(1, tag):
			if b % i == 0 and max(ans, ans1) > max(b // i, b - b // i):
				ans = b // i
				ans1 = b - b // i
		print(ans, ans1)


for t in range(int(input())):
	n = int(input())
	mf = 1
	i = 1
	i += 1
	while i * i <= n:
		if n % i == 0:
			mf = i
			break
		i += 1
	if mf == 1:
		print(1, n - 1)
	else:
		print(int(n / mf), int(n - n / mf))


import math

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

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

def bs(arr, l, r, x):
	while l <= r:
		mid = l + (r - l) // 2
		if arr[mid] == x:
			return arr[mid]
		elif arr[mid] < x:
			l = mid + 1
		else:
			r = mid - 1
	return -1

def swap(list, pos1, pos2):
	(list[pos1], list[pos2]) = (list[pos2], list[pos1])
	return list
t = int(input())
for _ in range(t):
	n = int(input())
	d = []
	for i in range(1, int(math.sqrt(n)) + 1):
		if n % i == 0:
			if n % i == i:
				d.append(i)
			else:
				d.append(i)
				d.append(n / i)
	minn = 1000000000
	for i in d:
		y = lcm(i, n - i)
		if y < minn and i != 0 and (n - i != 0):
			minn = y
			a = i
			b = n - i
	print(int(a), int(b))


t = int(input())
s = []
for j in range(t):
	n = int(input())
	if n % 2 == 0:
		x = int(n / 2)
		y = int(n / 2)
	else:
		m = n
		i = 2
		while i * i <= n:
			if n % i == 0:
				m = i
				break
			i += 1
		x = int(n / m)
		y = n - x
	s.append([x, y])
for k in range(len(s)):
	print(*s[k])


from math import ceil, sqrt
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		for i in range(3, ceil(sqrt(n)) + 1):
			if n % i == 0:
				print(n // i, n - n // i)
				break
		else:
			print(1, n - 1)


import math
for _ in range(int(input())):
	n = int(input())
	i = 2
	while i * i <= n and n % i:
		i += 1
	if i * i < n + 1:
		print(n // i, n - n // i)
	else:
		print(1, n - 1)


from sys import stdin, stdout
from math import *
from heapq import *
from collections import *

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

def find(n):
	if n <= 3:
		return (1, n - 1)
	p = n
	for i in range(2, trunc(sqrt(n) + 1)):
		if n % i == 0:
			p = i
			break
	if p == n:
		l = lcm(1, p - 1)
		besta = 1
		for i in range(1, floor(1 + sqrt(n))):
			lc = lcm(i, n - i)
			if l > lc:
				l = lc
				besta = i
		return (besta, n - besta)
	k = n // p
	(a, b) = find(p)
	return (k * a, k * b)

def main():
	ntest = int(stdin.readline())
	for testcase in range(ntest):
		n = int(stdin.readline())
		(a, b) = find(n)
		stdout.write('%d %d\n' % (a, b))
	return 0
main()


def isprime(P):
	root = int(P ** 0.5) + 1
	for i in range(3, root, 2):
		if P % i == 0:
			return 0
	return 1
T = int(input())
for _ in range(T):
	N = int(input())
	X = 1
	ans = 1
	if N % 2 == 0:
		print(N // 2, N // 2)
	elif isprime(N):
		print(N - 1, 1)
	else:
		root = int(N ** 0.5) + 1
		A = []
		for i in range(3, root, 2):
			if N % i == 0:
				break
		ans = N // i
		print(ans, N - ans)


import math
casos = int(input())
for p in range(casos):
	saida = ''
	n = int(input())
	t = 0
	supo = math.sqrt(n + 0.1)
	for f in range(2, int(supo) + 1):
		if n % f == 0:
			t = 1
			t1 = f
			if n / f > t:
				t = n / f
				saida += str(int(t)) + ' ' + str(int(n - t))
				print(saida)
				break
	if t == 0:
		saida += '1 ' + str(int(n - 1))
		print(saida)


def factors(n):
	i = 2
	blanck = []
	while i ** 2 <= n:
		if n % i == 0:
			blanck.append(i)
			n //= i
		else:
			i += 1
	if blanck != []:
		blanck.append(n)
	return blanck

def lcm(a, b):
	greater = max(a, b)
	ans = 0
	while True:
		if greater % a == 0 and greater % b == 0:
			ans = greater
			break
		else:
			greater += 1
	return ans

def returner(n):
	if n % 2 == 0:
		print(n // 2, n // 2)
		return ''
	x = factors(n)[::-1]
	base = 1
	blanck = []
	for i in x:
		base *= i
		if n - base != 0:
			temp = lcm(base, n - base)
			if temp == n - base:
				blanck.append((base, n - base, temp))
	if blanck == []:
		print(n - 1, 1)
		return ''
	else:
		print(blanck[-1][0], blanck[-1][1])
		return ''
t = int(input())
for i in range(t):
	print(returner(int(input())))


for _ in range(int(input())):
	x = int(input())
	if x % 2 == 0:
		print(x // 2, x // 2)
	else:
		f = False
		for j in range(2, int(x ** 0.5) + 1):
			if x % j == 0:
				print(x // j, x - x // j)
				f = True
				break
		if f == False:
			print(1, x - 1)


from math import sqrt
test = int(input())
for t in range(test):
	n = int(input())
	if n % 2 == 0:
		ans = n // 2
		print(ans, ans)
	else:
		prime = True
		p = 0
		for i in range(3, int(sqrt(n)) + 1, 2):
			if n % i == 0:
				p = i
				prime = False
				break
		if prime == False:
			print(n // p, n - n // p)
		else:
			print(1, n - 1)


import math
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	flag = -1
	i = 2
	while i * i <= n:
		if n % i == 0:
			flag = i
			break
		i += 1
	if flag == -1:
		print(n - 1, 1)
		continue
	x = n // flag
	print(x * (flag - 1), x)


t = int(input().split()[0])
for case in range(t):
	n = int(input().split()[0])
	(a, b) = (1, n - 1)
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			a = n // i
			b = n - a
			break
	print(str(a) + ' ' + str(b))


from math import sqrt
from collections import defaultdict as dd
import sys
input = sys.stdin.readline
t = int(input())
while t:
	n = int(input())
	nn = n
	mx = 1
	mi = n
	for i in range(1, int(sqrt(n)) + 1):
		if n % i == 0:
			mi = min(mi, max(i, n - i))
			if n // i != i:
				mi = min(mi, max(n // i, n - n // i))
	print(mi, nn - mi)
	t -= 1


import sys
input = sys.stdin.readline
t = int(input())
for tests in range(t):
	n = int(input())
	for i in range(2, 10 ** 5):
		if n % i == 0:
			print(n // i, n - n // i)
			break
	else:
		print(1, n - 1)


import os, sys, time, collections, math, pprint, itertools as it, operator as op, bisect as bs, functools as fn
(maxx, localsys, mod) = (1 << 60, 0, int(1000000000.0 + 7))
nCr = lambda n, r: reduce(mul, range(n - r + 1, n + 1), 1) // factorial(r)
ceil = lambda n, x: (n + x - 1) // x
(osi, oso) = ('/home/priyanshu/Documents/cp/input.txt', '/home/priyanshu/Documents/cp/output.txt')
if os.path.exists(osi):
	sys.stdin = open(osi, 'r')
	sys.stdout = open(oso, 'w')
input = sys.stdin.readline
from functools import reduce

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

def is_prime(n):
	if n < 5 or n & 1 == 0 or n % 3 == 0:
		return 2 <= n <= 3
	s = (n - 1 & 1 - n).bit_length() - 1
	d = n >> s
	for a in [2, 325, 9375, 28178, 450775, 9780504, 1795265022]:
		p = pow(a, d, n)
		if p == 1 or p == n - 1 or a % n == 0:
			continue
		for _ in range(s):
			p = p * p % n
			if p == n - 1:
				break
		else:
			return False
	return True

def divs(n):
	se = set()
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			se.add(n // i)
			se.add(i)
	if n in se:
		se.remove(n)
	return max(se)
gcd = math.gcd
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		se = divs(n)
		print(se, abs(n - se))


for w in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	if n % 2 != 0:
		l = n - 1
		a = 1
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				if n - i < n - n // i:
					a = i
				else:
					a = n // i
				l = min(n - i, n - n // i)
				break
		print(a, n - a)


t = int(input())
for i in range(t):
	f = lambda : map(int, input().split(' '))
	n = int(input())
	i = 2
	while i * i <= n and n % i:
		i += 1
	a = n % i > 0 or n // i
	print(+a, n - a)


import sys

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

def iinput():
	return int(input())

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

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
mod = int(1000000000.0) + 7
for _ in range(iinput()):
	n = iinput()
	flag = False
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		i = 3
		while i * i <= n:
			if n % i == 0:
				print(n // i, n - n // i)
				flag = True
			i += 2
			if flag == True:
				break
		if flag == False:
			print(1, n - 1)


N = int(input())
for _ in range(N):
	n = int(input())
	d = 2
	found = False
	while d * d <= n:
		if n % d == 0:
			k = int(n / d)
			print(k, n - k)
			found = True
			break
		d += 1
	if not found:
		print(1, n - 1)
	print()


import math
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		a = 1
		b = n - 1
		for x in range(2, math.floor(math.sqrt(n)) + 3):
			if n % x == 0:
				a = n // x
				b = n - n // x
				break
		print(a, b)


cases = eval(input())
for _ in range(cases):
	n = eval(input())
	for i in range(2, 10 ** 5):
		if n % i == 0:
			print(n // i, n - n // i)
			break
	else:
		print(1, n - 1)


T = int(input())
for t in range(T):
	n = int(input())
	if n == 2:
		print(1, 1)
		continue
	max_f = 1
	for i in range(1, int(n ** 0.5) + 2):
		if n % i == 0:
			max_f = max(max_f, i)
			if n // i < n:
				max_f = max(max_f, n // i)
	print(max_f, n - max_f)


t = int(input())
for _ in range(t):
	n = int(input())
	for i in range(2, int(n ** 0.5) + 1):
		if not n % i:
			print(n // i, n - n // i)
			break
	else:
		print(1, n - 1)


import math

def lcmsum(n):
	flag = 0
	for i in range(2, math.ceil(math.sqrt(n)) + 1):
		if n % i == 0:
			print(str(n // i) + ' ' + str(n - n // i))
			flag = 1
			break
	if flag == 0:
		print('1' + ' ' + str(n - 1))
testcases = int(input())
for i in range(testcases):
	n = int(input())
	lcmsum(n)


from math import sqrt

def ans(a):
	if a % 2 == 0:
		print(a // 2, a // 2)
	else:
		for i in range(2, int(sqrt(a) + 1)):
			if a % i == 0:
				print(a // i, a - a // i)
				return
		print(1, a - 1)
for _ in range(int(input())):
	a = int(input())
	ans(a)


import math
for t in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		m = 10 ** 9 + 1
		temp = n
		for i in range(3, int(math.sqrt(n)) + 1, 2):
			if temp % i == 0:
				temp //= i
				m = min(m, i)
		if temp == n:
			print(1, n - 1)
		else:
			print(n // m, (m - 1) * n // m)


from collections import Counter
import sys
import math
from math import gcd
for _ in range(int(input())):
	n = int(input())
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			print(n // i, n - n // i)
			break
	else:
		print(1, n - 1)


def getfctrllist(n):
	A = [1]
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			if n // i == i:
				A.append(i)
			else:
				A.append(n // i)
				A.append(i)
	A.sort()
	return A

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

def Lcm(a, b):
	return a * b // gcd(a, b)
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		A = getfctrllist(n)
		a = 1
		f_ans = int(10000000000.0)
		for i in range(len(A)):
			ans = Lcm(A[i], n - A[i])
			if ans < f_ans:
				f_ans = ans
				a = A[i]
		print(a, n - a)


def largest_factor(n):
	if n % 3 == 0:
		return n // 3
	i = 5
	while i ** 2 <= n:
		if n % i == 0:
			return n // i
		if n % (i + 2) == 0:
			return n // (i + 2)
		i += 6
	return 1

def answer(n):
	if n % 2 == 0:
		return [n // 2, n // 2]
	lf = largest_factor(n)
	return [lf, n - lf]
	return

def main():
	t = int(input())
	while t:
		n = int(input())
		print(' '.join(map(str, answer(n))))
		t -= 1
	return
main()


import math

def lcm(a, b):
	return a * b / math.gcd(a, b)
t = int(input())
(a, b) = (0, 0)
for _ in range(t):
	n = int(input())
	mini = 10 ** 9 + 7
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			lcm1 = lcm(i, n - i)
			if lcm1 < mini:
				mini = lcm1
				(a, b) = (i, n - i)
			if n // i != n:
				lcm2 = lcm(n // i, n - n // i)
				if lcm2 < mini:
					mini = lcm2
					(a, b) = (n // i, n - n // i)
	print(a, b)


import math

def prime(n):
	if n % 2 == 0:
		return 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		if n % i == 0:
			return i
	if n > 2:
		return n
t = int(input())
for i in range(t):
	n = int(input())
	a = prime(n)
	if n != a:
		print(int(n / a), n - int(n / a))
	else:
		print(1, n - 1)


def examA():
	T = I()
	ans = []
	for _ in range(T):
		N = I()
		cur = [1 for _ in range(N)]
		ans.append(cur)
	for v in ans:
		print(' '.join(map(str, v)))
	return

def examB():

	def factorization(n):
		arr = defaultdict(int)
		temp = n
		for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
			if temp % i == 0:
				cnt = 0
				while temp % i == 0:
					cnt += 1
					temp //= i
				arr[i] = cnt
		if temp != 1:
			arr[temp] = 1
		if arr == []:
			arr[n] = 1
		return arr

	def make_divisors(n):
		divisors = []
		for i in range(1, int(n ** 0.5) + 1):
			if n % i == 0:
				divisors.append(i)
				if i != n // i:
					divisors.append(n // i)
		return divisors
	T = I()
	ans = []
	for _ in range(T):
		N = I()
		f = make_divisors(N)
		if len(f) <= 2:
			cur = [1, N - 1]
		else:
			cur = [N // f[2], N - N // f[2]]
		ans.append(cur)
	for v in ans:
		print(' '.join(map(str, v)))
	return

def examC():
	T = I()
	ans = []
	for _ in range(T):
		N = I()
		cur = 0
		ans.append(cur)
	for v in ans:
		print(v)
	return

def examD():
	ans = 0
	print(ans)
	return

def examE():
	ans = 0
	print(ans)
	return

def examF():
	ans = 0
	print(ans)
	return
from decimal import getcontext, Decimal as dec
import sys, bisect, heapq
from copy import deepcopy
from heapq import heappop, heappush, heapify
from collections import Counter, defaultdict, deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def I():
	return int(input())

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

def DI():
	return dec(input())

def LDI():
	return list(map(dec, sys.stdin.readline().split()))

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

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

def SI():
	return sys.stdin.readline().strip()
global mod, mod2, inf, alphabet, _ep
mod = 10 ** 9 + 7
mod2 = 998244353
inf = 10 ** 18
_ep = dec('0.000000000001')
alphabet = [chr(ord('a') + i) for i in range(26)]
alphabet_convert = {chr(ord('a') + i): i for i in range(26)}
getcontext().prec = 28
sys.setrecursionlimit(2 * 10 ** 5)
examB()


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

def solve(n):
	if is_prime(n):
		print(1, n - 1)
		return
	for i in range(2, n):
		if is_prime(i):
			if n % i == 0:
				print(n // i, n - n // i)
				return
t = int(input())
for j in range(t):
	n = int(input())
	solve(n)


import os
import sys
from io import BytesIO, IOBase
profile = 0
pypy = 1

def iin():
	return int(input())

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

def main():
	T = iin()
	while T:
		T -= 1
		n = iin()
		fc = 1
		i = 2
		ans = n - 1
		sol = [1, n - 1]
		while i * i <= n:
			if n % i == 0:
				ch = n // i
				if ans > ch * (i - 1):
					sol = [ch, (i - 1) * ch]
					ans = ch * (i - 1)
			i += 1
		print(*sol)
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.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')
if pypy:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
	input = lambda : sys.stdin.readline().rstrip('\r\n')
if profile:
	import cProfile
	cProfile.run('main()')
else:
	main()


z = input
mod = 10 ** 9 + 7
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

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)
for _ in range(int(z())):
	x = int(z())
	if x % 2 == 0:
		print(x // 2, x // 2)
		continue
	n = ceil(x ** 0.5) + 1
	c = 0
	for i in range(2, n):
		if x % i == 0:
			c += 1
			break
	if c != 0:
		print(x // i, x - x // i)
	if c == 0:
		print(1, x - 1)


import math

def primeFactors(n):
	ans = []
	while n % 2 == 0:
		ans.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			ans.append(i)
			n = n // i
	if n > 2:
		ans.append(n)
	return ans
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		l = primeFactors(n)
		if len(l) == 1:
			print(1, n - 1)
		else:
			total = 1
			for i in range(1, len(l)):
				total *= l[i]
			print(total, n - total)


t = int(input())
for you in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		l = [1]
		i = 2
		while i * i <= n:
			if n % i == 0:
				l.append(i)
				if i != n // i:
					l.append(n // i)
			i += 1
		z = max(l)
		print(n - z, z)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	x = int(math.sqrt(n))
	b = []
	for i in range(x, 0, -1):
		if n % i == 0:
			b.append(i)
			b.append(n // i)
	b.sort()
	ans = b[len(b) - 2]
	print(ans, n - ans)


from math import *
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
		continue
	else:
		k = sqrt(n)
		a = floor(k)
		a = a + 1
		for i in range(3, a + 1, 2):
			if n % i == 0:
				b = i
				ans = n // b
				print(ans, n - ans)
				break
		else:
			ans = n - 1
			print(ans, 1)


import math
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(int(n / 2), int(n / 2))
	else:
		j = n
		for i in range(2, int(math.sqrt(n)) + 1):
			if n % i == 0:
				j = max(i, int(n / i))
				break
		if j == n:
			print(1, n - 1)
		else:
			print(j, n - j)


from math import gcd

def isPrime(n):
	i = 1
	ans = 0
	while i * i <= n:
		if n % i == 0:
			if gcd(i, n - i) > ans:
				(a, b) = (i, n - i)
				ans = gcd(a, b)
			if gcd(n // i, n - n // i) > ans and n - n // i != 0:
				(a, b) = (n // i, n - n // i)
				ans = gcd(a, b)
		i += 1
	return (a, b)
t = int(input())
for i in range(t):
	n = int(input())
	if n / 2 == n // 2:
		print(n // 2, n // 2)
	else:
		ans = isPrime(n)
		print(ans[0], ans[1])


import math

def printDivisors(n):
	list = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				list.append(n // i)
			else:
				list.append(i)
				list.append(int(n / i))
	return list

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

def lcm(a, b):
	return a * b / gcd(a, b)
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		l = printDivisors(n)
		ans = n
		(x, y) = (0, 0)
		for i in l:
			(a, b) = (i, n - i)
			if a > 0 and b > 0:
				lc = lcm(a, b)
				if lc <= ans:
					(x, y) = (a, b)
					ans = lc
		print(x, y)


import math

def gcd(a, b):
	while b != 0:
		(a, b) = (b, a % b)
	return a
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		flag = 0
		mina = -1
		i = 1
		z = n ** 0.5
		while i <= z:
			x = i
			y = n - i
			if x != 0 and y != 0:
				lcm = x * y // gcd(x, y)
				if mina == -1:
					mina = lcm
					a = x
					b = y
				elif lcm < mina:
					mina = lcm
					a = x
					b = y
				x = n // i
				y = n - x
				if x != 0 and y != 0:
					lcm = x * y // gcd(x, y)
					if mina == -1:
						mina = lcm
						a = x
						b = y
					elif lcm < mina:
						mina = lcm
						a = x
						b = y
			i += 1
		print(a, b)


import math

def primeFactors(n, l):
	while n % 2 == 0:
		l.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n // i
	if n > 2:
		l.append(n)
	return l
for _ in range(int(input())):
	n = int(input())
	l = []
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		p = primeFactors(n, l)
		p.sort(reverse=True)
		if len(p) == 1:
			print(1, n - 1)
		else:
			c = 1
			for j in range(len(p) - 1):
				c *= p[j]
			print(c, n - c)


from sys import stdin, stdout
import sys
INF = 100000000000.0
import bisect

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

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

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

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

def op(c):
	return stdout.write(c)
from collections import defaultdict
import math

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

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
for _ in range(int(stdin.readline())):
	n = get_int()
	v = set()
	for i in range(1, int(math.sqrt(n)) + 1):
		if n % i == 0:
			v.add(i)
			v.add(n // i)
	(a, b) = (1, n)
	mx = INF
	v = list(v)
	v.sort()
	for i in v:
		if i >= n:
			break
		lc = lcm(i, n - i)
		if lc < mx:
			mx = lc
			(a, b) = (i, n - i)
	print(a, b)


import math

def fact(x):
	ans = []
	for i in range(1, int(math.sqrt(x)) + 1):
		if x % i == 0:
			ans.append(i)
			ans.append(x // i)
	ans = list(set(ans))
	return ans

def lcm(x, y):
	return x * y // math.gcd(x, y)
a = int(input())
for i in range(a):
	s = int(input())
	if s % 2 == 0:
		print(s // 2, s // 2)
	else:
		m = fact(s)
		mini = math.inf
		for i in range(len(m)):
			if min(m[i], s - m[i]):
				if lcm(m[i], s - m[i]) < mini:
					x1 = m[i]
					mini = lcm(m[i], s - m[i])
		print(x1, s - x1)


tt = int(input())
for loop in range(tt):
	n = int(input())
	x = 2
	while x ** 2 <= n:
		if n % x == 0:
			break
		x += 1
	else:
		print(1, n - 1)
		continue
	print(n // x, n - n // x)


for _ in range(int(input())):
	n = int(input())
	k = int(n ** 0.5)
	flag = 1
	for i in range(2, k + 1):
		if n % i == 0:
			print(n // i, n - n // i)
			flag = 0
			break
	if flag:
		print(1, n - 1)


import math

def find_all_divisors_of_a_number(x):
	result = []
	for i in range(1, int(math.sqrt(x)) + 1):
		if x % i == 0:
			result.append(i)
			if i * i != x:
				result.append(x // i)
	return result

def gcd(a, b):
	mod = a % b
	while mod > 0:
		a = b
		b = mod
		mod = a % b
	return b

def lcm(a, b):
	return a * b // gcd(a, b)
for _ in range(int(input())):
	n = int(input())
	divisors = find_all_divisors_of_a_number(n)
	(a, b) = (0, 0)
	min_value = 1e+20
	for x in divisors:
		if x == n:
			continue
		now = lcm(x, n - x)
		if now < min_value:
			(a, b) = (x, n - x)
			min_value = now
	print(a, b)


from math import gcd
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
		continue
	i = 2
	s = n
	d = 1
	while i * i <= n:
		if n % i == 0:
			d = i
			break
		i += 1
	if d == 1:
		print(1, n - 1)
		continue
	print(n // d, n - n // d)


from math import sqrt

def divisores(a):
	s = []
	i = 1
	while i <= sqrt(a) and len(s) == 0:
		if n % i == 0:
			if n / i == i and i != 1 and (i != a):
				s.append(i)
			elif i != 1 and i != a:
				s.append(int(i))
				s.append(int(n / i))
		i += 1
	return s

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

def lcm(a, b):
	return a / gcd(a, b) * b
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(int(n / 2), int(n / 2))
	else:
		s = divisores(n)
		if len(s) == 0:
			print(1, n - 1)
		else:
			print(int(n / s[0]), int((s[0] - 1) * n / s[0]))


from sys import stdin, stdout
int_in = lambda : int(stdin.readline())
arr_in = lambda : [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for _ in range(rows)]
str_in = lambda : stdin.readline().strip()
out = lambda o: stdout.write('{}\n'.format(o))
arr_out = lambda o: out(' '.join(map(str, o)))
bool_out = lambda o: out('YES' if o else 'NO')
tests = lambda : range(1, int_in() + 1)
case_out = lambda i, o: out('Case #{}: {}'.format(i, o))
from math import gcd

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

def solve(n):
	result = [1, n - 1]
	i = 2
	while i * i <= n:
		if n % i == 0:
			ith = n // i
			return [ith, (i - 1) * ith]
		i += 1
	return result
for _ in tests():
	n = int_in()
	arr_out(solve(n))


import math

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

def solve(n):
	divs = []
	ans = 10 ** 9
	(a, b) = (-1, -1)
	for d in range(1, n + 1):
		if d * d > n:
			break
		if n % d == 0:
			for d2 in [d, n // d]:
				if d2 == n:
					continue
				ans = min(d2 * (n // d2 - 1), ans)
				if ans == d2 * (n // d2 - 1):
					a = d2
					b = d2 * (n // d2 - 1)
	print(a, b)
t = int(input())
for _ in range(t):
	n = int(input())
	solve(n)


for k in range(int(input())):
	a = int(input())
	x = 1
	for j in range(2, int(a ** 0.5) + 1):
		if a % j == 0:
			x = a // j
			break
	print(x, a - x)


n = int(input())
for i in range(n):
	x = int(input())
	if x % 2 == 0:
		print(int(x / 2), int(x / 2))
	else:
		k = 0
		for j in range(2, 32000):
			if x % j == 0:
				print(int(x / j), int(x - x / j))
				k += 1
				break
		if k == 0:
			print(1, x - 1)


import os
import heapq
import sys
import math
import operator
from collections import defaultdict
from io import BytesIO, IOBase

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

def main():
	for _ in range(int(input())):
		n = int(input())
		mx = 1
		if n % 2 == 0:
			print(n // 2, n // 2)
			continue
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				mx = max(mx, i)
				mx = max(mx, n // i)
		print(mx, n - mx)
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.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')
main()


import math
t = int(input())
for hatt in range(t):
	n = int(input())
	lim = int(math.sqrt(n)) + 2
	i = 2
	while i < lim and n % i != 0:
		i += 1
	if n % i == 0:
		a = n // i
		b = n - a
		print(a, b)
	else:
		print(1, n - 1)


import math

def smallestDivisor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n
t = int(input())
for i in range(0, t):
	n = int(input())
	m = smallestDivisor(n)
	k = n / m
	print(int(k), int(n - k))


from math import *

def prime(n):
	got = None
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			got = i
			return i
	if got == None:
		return int(n)
t = int(input())
for i in range(t):
	n = int(input())
	print(int(n / prime(n)), int(n - n / prime(n)))


import math

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(int(i))
			n = n / i
	if n > 2:
		l.append(int(n))
	return l
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		x = primeFactors(n)
		min_lcm = 1000000000000000000
		pair = []
		for i in x:
			a = n // i
			b = n - a
			curr = max(a, b)
			if curr < min_lcm:
				min_lcm = curr
				pair = [a, b]
		print(*pair)


from math import ceil, sqrt

def sieve(n):
	sqrtn = ceil(sqrt(n))
	prime = [True for _ in range(n + 1)]
	p = 2
	while p <= sqrtn:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = False
	prime[1] = False
	return [i for (i, x) in enumerate(prime) if x]
primes = sieve(10 ** 5)
for _ in range(int(input())):
	n = int(input())
	sp = n
	for x in primes:
		if not n % x:
			sp = x
			break
	div = n // sp
	print(div, div * (sp - 1))


t = int(input())
for _ in range(t):
	n = int(input())
	d = 2
	while n % d != 0 and d * d < n:
		d += 1
	if n % d == 0:
		print(n // d, n // d * (d - 1))
	else:
		print(1, n - 1)


import time, math as mt, bisect, 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 IO():
	return 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 readTree():
	v = int(input())
	adj = [set() for i in range(v + 1)]
	for i in range(v - 1):
		(u1, u2) = In()
		adj[u1].add(u2)
		adj[u2].add(u1)
	return (adj, v)

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

def sieve():
	li = [True] * 1000001
	(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 = []
	for i in range(1000001):
		if li[i] == True:
			prime.append(i)
	return prime

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

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

def solve():
	n = II()
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		mn = 999999999
		x = int(mt.sqrt(n)) + 1
		for i in range(1, x):
			if n % i == 0:
				if (n - i) % i == 0:
					if max(i, n - i) < mn:
						note = (i, n - i)
						mn = max(i, n - i)
				y = n // i
				if (n - y) % y == 0:
					if max(y, n - y) < mn:
						note = (y, n - y)
						mn = max(y, n - y)
		print(note[0], note[1])
t = II()
for i in range(t):
	solve()


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
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 list(map(int, sys.stdin.readline().split()))

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

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

def IF(c, t, f):
	return t if c else f

class Prime:

	def __init__(self, n):
		self.M = m = int(math.sqrt(n)) + 10
		self.A = a = [True] * m
		a[0] = a[1] = False
		self.T = t = [2]
		for j in range(4, m, 2):
			a[j] = False
		for i in range(3, m, 2):
			if not a[i]:
				continue
			t.append(i)
			for j in range(i * i, m, i):
				a[j] = False
		self.ds_memo = {}
		self.ds_memo[1] = set([1])

	def is_prime(self, n):
		return self.A[n]

	def division(self, n):
		for c in self.T:
			if n % c == 0:
				return c
		return n

def main():
	t = I()
	pr = Prime(10 ** 10)
	rr = []
	for _ in range(t):
		n = I()

		def f(n):
			d = pr.division(n)
			t = n // d
			if d == 1 or d == n:
				return [t, t * (n - 1)]
			r = f(d)
			return list(map(lambda x: x * t, r))
		rr.append(JA(f(n), ' '))
	return JA(rr, '\n')
print(main())


import math

def main():
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2, sep=' ')
		return
	for m in range(3, int(math.sqrt(n)) + 1, 2):
		if n % m == 0:
			print(n // m, n * (m - 1) // m, sep=' ')
			return
	print(1, n - 1, sep=' ')
k = int(input())
for i in range(0, k):
	main()


import math
from typing import *

def find_combination(n: int) -> Tuple[int, int]:
	if n % 2 == 0:
		return (n // 2, n // 2)
	for div in range(3, int(math.sqrt(n)) + 1):
		if n % div == 0:
			return (n // div, n - n // div)
	return (1, n - 1)
t = int(input())
for _ in range(t):
	print('%d %d' % find_combination(int(input())))


from math import sqrt

def func():
	t = int(input().strip())
	cases = []
	for _ in range(t):
		n = int(input().strip())
		cases.append(n)
	for case in cases:
		ans = min_num(case)
		print(str(ans[0]) + ' ' + str(ans[1]))

def min_num(n):
	ans = 1
	for x in range(2, int(sqrt(n)) + 1):
		if n % x == 0:
			ans = n // x
			break
	return (ans, n - ans)
func()


import bisect
import sys
import math
input = sys.stdin.readline
import functools
from collections import defaultdict

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 solve(case):
	n = inp()
	i = 2
	while i * i <= n:
		if n % i == 0:
			return str(n // i) + ' ' + str(n - n // i)
		i += 1
	return '1 ' + str(n - 1)
if len(sys.argv) > 1 and sys.argv[1].startswith('input'):
	f = open('./' + sys.argv[1], 'r')
	input = f.readline
T = inp()
for i in range(T):
	res = solve(i + 1)
	print(str(res))


import sys
input = sys.stdin.buffer.readline

def iinp() -> int:
	return int(input())

def linp() -> list:
	return [int(z) for z in input().split()]

def sinp():
	return input().decode('unicode-escape')[0:-2]
for _ in range(iinp()):
	n = iinp()
	(ans, i) = (1, 2)
	while i * i <= n:
		if n % i == 0:
			ans = n // i
			break
		i += 1
	print(ans, n - ans)


for i in range(int(input())):
	n = int(input())
	c = 0
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			c = i
			break
	if c == 0:
		print(1, n - 1)
	else:
		c = n // c
		print(c, n - c)


import math

def lcm(n):
	i = 1
	ans = []
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				ans.append(i)
			else:
				ans.append(i)
				ans.append(n // i)
		i = i + 1
	return ans
t = int(input())
for _ in range(t):
	n = int(input())
	ans = lcm(n)
	ans.sort()
	print(n - ans[-2], ans[-2])


from math import sqrt
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		a = 1
		b = n - 1
		i = int(sqrt(n))
		c = 3
		while c <= i:
			if n % c == 0:
				a = n // c
				b = n - a
				break
			c = c + 2
		print(a, b)


def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif isPrime(n):
		print(1, n - 1)
	else:
		i = 1
		while i <= n:
			if isPrime(i) and n % i == 0:
				print(n // i, n - n // i)
				break
			i += 1


import math
test = int(input())
while test > 0:
	test -= 1
	n = int(input())
	(a, b) = (1, n - 1)
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			x = n // i
			if x * (i - 1) < b:
				b = x * (i - 1)
				a = x
			if i * (x - 1) < b:
				b = i * (x - 1)
				a = i
	print(a, b)


from math import sqrt
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	ok = False
	if n % 2 == 0:
		print(int(n / 2), int(n / 2))
	else:
		for i in range(2, int(sqrt(n)) + 1):
			if n % i == 0:
				ok = True
				print(int(n / i), n - int(n / i))
				break
		if not ok:
			print(1, n - 1)


from math import isqrt

def pairWithMinimumLCM(n):
	if not n % 2:
		value = n // 2
		return f'{value} {value}'
	for i in range(3, isqrt(n) + 1, 2):
		if not n % i:
			value = n // i
			return f'{value} {n - value}'
	return f'1 {n - 1}'
nTestCases = int(input())
testCases = [int(input()) for x in range(nTestCases)]
[print(pairWithMinimumLCM(testCase)) for testCase in testCases]


def Lpf(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n
for _ in range(int(input())):
	n = int(input())
	f = n // Lpf(n)
	print(f, n - f)


import math
for _ in range(int(input())):
	n = int(input())
	if n % 2:
		a = -1
		b = 0
		for i in range(1, int(math.sqrt(n)) + 1):
			if n % i == 0:
				if i == 1:
					b = i
				else:
					a = max(i, n // i, a)
		if a != -1:
			print(a, n - a)
		else:
			print(1, n - 1)
	else:
		print(n // 2, n // 2)


for _ in range(int(input())):
	n = int(input())
	li = []
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif n % 2 != 0:
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				li.append(i)
		if len(li) == 0:
			print(1, n - 1)
		else:
			print(n // min(li), n - n // min(li))


import math

def printDivisors(n, l):
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
		i = i + 1
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		l = []
		printDivisors(n, l)
		l.sort()
		if len(l) == 2:
			print(1, n - 1)
		else:
			a = len(l)
			b = l[a - 2]
			print(b, n - b)


import math
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		t1 = 1
		t2 = n - 1
		for i in range(2, int(math.sqrt(n)) + 1):
			if n % i == 0:
				t1 = n // i
				t2 = n - t1
				break
		print(t1, t2)


n = int(input())
while n:
	n -= 1
	m = int(input())
	flag = 0
	for i in range(2, int(m ** 0.5) + 1):
		if m % i == 0:
			flag = 1
			print(m // i, m - m // i)
			break
	if flag == 0:
		print(1, m - 1)


import math
for i in range(int(input())):
	n = int(input())
	k = 0
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		for i in range(3, int(math.sqrt(n)) + 1, 2):
			if n % i == 0:
				k = n // i
				break
		if k == 0:
			print('1', n - 1)
		else:
			print(k, n - k)


for _ in [*open(0)][1:]:
	n = int(_)
	K = 1
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			a = n // i
			b = n - a
			K = 0
			break
	if K:
		print(n - 1, 1)
	else:
		print(a, b)


from math import gcd

def lcm(a, b):
	return a // gcd(a, b) * b
t = int(input())
from math import sqrt, ceil
from collections import defaultdict
lim = 10 ** 5

def sieve(N):
	b = [True] * (N + 1)
	b[0] = False
	b[1] = False
	lim = ceil(sqrt(N))
	i = 2
	while i <= lim:
		if b[i]:
			for n in range(i ** 2, N + 1, i):
				b[n] = False
		i += 1
	return [i for (i, b) in enumerate(b) if b]
P = sieve(lim)

def factor(n):
	if n in P:
		return [n]
	F = []
	for p in P:
		while n % p == 0:
			n //= p
			F.append(p)
		if n in P:
			F.append(n)
			break
	else:
		if n != 1:
			F.append(n)
	C = []
	for f in F:
		C.append(f)
	return sorted(C)
for _ in range(t):
	n = int(input())
	F = factor(n)
	a = n
	mn = n - 1
	best = (1, n - 1)
	for f in F:
		a //= f
		if n // a > 100000:
			break
		for i in range(a, n, a):
			asd = gcd(i, n - 1)
			if asd < mn:
				mn = asd
				best = (i, n - i)
	print(*best)


from math import sqrt
for _ in range(int(input())):
	x = int(input())
	if x & 1:
		for i in range(3, int(sqrt(x)) + 2, 2):
			if x % i == 0:
				a = x // i
				b = x - a
				print(a, b)
				break
		else:
			print(1, x - 1)
	else:
		print(x // 2, x // 2)


import math

def printDivisors(n):
	ar = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				ar.append(i)
			else:
				ar.append(i)
				ar.append(n // i)
		i = i + 1
	return ar
t = int(input())
while t:
	t -= 1
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		ar = printDivisors(n)
		ar.sort()
		sq = math.sqrt(n)
		mini = 1000000000 + 5
		for i in ar:
			if i == n:
				break
			elif (n - i) % i == 0 and mini > n - i:
				mini = n - i
		print(mini, n - mini)


t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		a = int(n / 2)
		print(a, a)
	else:
		for x in range(3, 10 ** 5, 2):
			if n % x == 0:
				b = int(n * (x - 1) / x)
				print(n - b, b)
				break
		else:
			print(1, n - 1)


t = int(input())
for _ in range(t):
	n = int(input())
	prime = True
	for x in range(2, int(n ** 0.5) + 1):
		if n % x == 0:
			print(n // x, n - n // x)
			prime = False
			break
	if prime:
		print(n - 1, 1)


for _ in range(int(input())):
	n = int(input())
	flag = True
	i = 2
	while i * i <= n:
		if n % i == 0:
			a = n // i
			b = n - a
			print(n // i, n - n // i)
			flag = False
			break
		i += 1
	if flag:
		print(1, n - 1)


from math import *
n = int(input())
for i in range(n):
	x = int(input())
	if x % 2 == 0:
		print(x // 2, x // 2)
	else:
		Max = 0
		for j in range(1, int(sqrt(x)) + 1):
			if x % j == 0:
				Max = max(Max, j)
				if x // j <= x // 2:
					Max = max(Max, x // j)
		print(Max, x - Max)


from math import gcd
for _ in range(int(input())):
	n = int(input())
	lcm = 1000000000.0
	ans = ()
	div = [1]
	for i in range(2, int(n ** (1 / 2)) + 1):
		if i == n // i:
			div.append(i)
		else:
			div.extend([i, n // i])
	for i in div:
		tans = i * (n - i) // gcd(i, n - i)
		if tans < lcm:
			lcm = tans
			ans = (i, n - i)
	print(*ans)


import sys
input = sys.stdin.readline
import heapq
import copy
import math
import decimal

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

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

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

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

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

def pr_list(a):
	print(*a, sep=' ')

def main():
	tests = inp()
	mod = 1000000007
	limit = 10 ** 18
	ans = 0
	stack = []
	hashm = {}
	arr = []
	heapq.heapify(arr)
	for test in range(tests):
		n = inp()
		ans = 0
		for i in range(2, int(math.sqrt(n)) + 2):
			if n % i == 0:
				a = n // i
				ans = (i - 1) * a
				break
		if ans == 0:
			pr_list([1, n - 1])
		else:
			pr_list([ans, n - ans])
main()


def gg(a):
	i = 2
	while i ** 2 <= a:
		if a % i == 0:
			return i
		i += 1
	return 0
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		d = gg(n)
		if d == 0:
			print(1, n - 1)
		else:
			print(n // d, n - n // d)


import math

def primes(n):
	t = n
	l = set()
	j = set()
	k = int(math.sqrt(n)) + 1
	while n % 2 == 0:
		n = n // 2
		l.add(2)
		j.add(n // 2)
	for i in range(3, k, 2):
		while n % i == 0:
			l.add(i)
			j.add(n // i)
			n = n // i
	j = list(j)
	if len(l) != 0:
		return j
	else:
		return [n - 1]

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		k = primes(n)
		for i in range(len(k)):
			t = gcd(n - k[i], k[i])
			if i == 0:
				mi = t
			else:
				mi = max(mi, t)
		print(mi, n - mi)


for _ in range(int(input())):
	x = int(input())
	r = []
	i = 1
	while i * i <= x:
		if x % i == 0:
			r.append(i)
			if x // i != i:
				r.append(x // i)
		i += 1
	r.sort()
	print(r[-1] - r[-2], r[-2])


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 smallestDivisor(n):
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n
test = inp()
for i in range(0, test):
	num = inp()
	if num % 2 == 0:
		print(num // 2, end=' ')
		print(num // 2)
	else:
		a = smallestDivisor(num)
		com = num // a
		num1 = com
		num2 = com * (a - 1)
		print(num1, end=' ')
		print(num2)


import math
for t in range(int(input())):
	n = int(input())
	if n % 2 != 0:
		l1 = []
		for i in range(2, int(math.sqrt(n)) + 1):
			if n % i == 0:
				if n / i != i:
					l1.append(i)
					l1.append(n // i)
				else:
					l1.append(i)
		l1.sort()
		if len(l1) != 0:
			print(l1[len(l1) - 1], n - l1[len(l1) - 1])
		else:
			print(n - 1, 1)
	else:
		print(n // 2, n // 2)


import math
t = int(input(''))
x = []
for i in range(t):
	x.append(int(input('')))
for i in range(t):
	y = x[i]
	if y % 2 == 0:
		print(int(y / 2), int(y / 2))
	elif y % 3 == 0:
		print(int(y / 3), int(2 * y / 3))
	else:
		for k in range(1, int(math.sqrt(y)) + 1, 1):
			if y % k == 0:
				if k == 1:
					minn = y - 1
					sol = 1
				else:
					minn = min(minn, min(y - k, y - int(y / k)))
					if minn == y - k:
						sol = y - k
					elif minn == y - int(y / k):
						sol = y - int(y / k)
		minn = min(sol, y - sol)
		print(minn, y - minn)


t = int(input())
s = []
import math
for i in range(t):
	r = []
	n = int(input())
	if n % 2 == 0:
		a = n // 2
		b = n // 2
		r.append(a)
		r.append(b)
	else:
		a = math.ceil(math.sqrt(n))
		for j in range(3, a + 1, 2):
			if n % j == 0:
				p = n // j
				break
			else:
				p = 0
		if p != 0:
			q = n - p
			r.append(p)
			r.append(q)
		else:
			p = 1
			q = n - p
			r.append(p)
			r.append(q)
	s.append(' '.join(map(str, r)))
for i in range(len(s)):
	print(s[i])


import math
for _ in range(int(input())):
	x = int(input())
	result = x - 1
	sqr = math.floor(math.sqrt(x)) + 1
	for i in range(2, sqr):
		if x % i == 0:
			result = int(x / i)
			break
	print(result, x - result)


from math import sqrt
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, end=' ')
		print(n // 2)
	else:
		fi = int(sqrt(n)) + 1
		f1 = 0
		i1 = 0
		for i in range(2, fi):
			if n % i == 0:
				f1 = 1
				break
		if f1 == 0:
			print(1, end=' ')
			print(n - 1)
		else:
			for i in range(2, fi):
				if n % (i + 1) == 0:
					i1 = n // (i + 1)
					break
			print(i1, end=' ')
			print(n - i1)


import math

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

def lcm(a, b):
	return a * b / gcd(a, b)
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	(a, b) = (1, n - 1)
	tlcm = lcm(a, b)
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			if lcm(i, n - i) < tlcm:
				tlcm = lcm(i, n - i)
				(a, b) = (i, n - i)
			j = n // i
			if lcm(j, n - j) < tlcm:
				tlcm = lcm(j, n - j)
				(a, b) = (j, n - j)
	print(a, b)


def find(n):
	is_prime = True
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			is_prime = False
			break
	if is_prime:
		return [1, n - 1]
	return [n // i, (i - 1) * (n // i)]
for _ in range(int(input())):
	n = int(input())
	print(*find(n))


import math

def lcm(a, b):
	return a * b // math.gcd(a, b)
for _ in range(int(input())):
	n = int(input())
	maxi = n - 1
	(one, two) = (1, n - 1)
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		flag = 0
		for i in range(3, int(math.sqrt(n)) + 1, 2):
			if n % i == 0:
				temp = n
				cnt = 1
				while temp % i == 0:
					temp = temp // i
					cnt += 1
				if cnt > 1:
					one = pow(i, cnt - 2) * temp
					two = n - one
				else:
					one = n // i
					two = n - n // i
				break
		print(one, two)


def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(a, b):
	return a * b // gcd(a, b)
for i in range(int(input())):
	n = int(input())
	p = 0
	for m in range(2, 100000):
		if n % m == 0:
			p = m
			break
	if p == 0:
		p = n
	print(' '.join([str(n // p), str(n - n // p)]))


import math

def divisorGenerator(n):
	large_divisors = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			yield i
			if i * i != n:
				large_divisors.append(n / i)
	for divisor in reversed(large_divisors):
		yield divisor
t = int(input())
for i in range(t):
	n = int(input())
	divs = list(divisorGenerator(n))[1:-1]
	if len(divs) == 0:
		print(1, n - 1)
	else:
		v = int(divs[-1])
		new_n = n // v
		print(1 * v, (new_n - 1) * v)


for _ in range(int(input())):
	n = int(input())
	a = count = 0
	if n % 2 == 0:
		print(n // 2, n // 2)
		continue
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			a = i
			count = 1
			break
	if count == 0:
		print(1, n - 1)
	else:
		print(n // a, n - n // a)


import math
t = int(input())
while t:
	n = int(input())
	for i in range(2, 10 ** 5):
		if n % i == 0:
			print(n // i, n - n // i)
			break
	else:
		print(1, n - 1)
	t = t - 1


def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		i = 2
		flag = False
		while True:
			if i * i > n:
				break
			if n % i == 0:
				flag = True
				t = i
				if n / i > t:
					t = int(n / i)
				s1 = n - t
				print(str(t) + ' ' + str(s1))
				break
			i += 1
		if flag == False:
			print('1 ' + str(n - 1))
main()


from math import gcd, sqrt
for _ in range(int(input())):
	n = int(input())
	ans = n - 1
	if n % 2 == 0:
		print(n // 2, end=' ')
		print(n // 2)
	else:
		for i in range(2, int(sqrt(n)) + 1):
			if gcd(n // i, n - n // i) == n // i:
				ans = min(ans, n - n // i)
		print(n - ans, end=' ')
		print(ans)


t = int(input())
for s in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		fact = []
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				fact.append(i)
				break
		else:
			fact.append(0)
		x = min(fact)
		if x != 0:
			x = n // x
			print(x, n - x)
		else:
			print(1, n - 1)


def chk(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
for t in range(int(input())):
	k = int(input())
	if k % 2 == 0:
		print(k // 2, k // 2)
	elif chk(k):
		print(1, k - 1)
	else:
		i = 1
		while i <= k:
			if chk(i) and k % i == 0:
				print(k // i, k - k // i)
				break
			i += 1


import math

def div(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n
for _ in range(int(input())):
	n = int(input())
	x = div(n)
	if x == 2:
		print(n // 2, n // 2)
	elif x == n:
		print(1, n - 1)
	else:
		print(n // x, n - n // x)


from collections import defaultdict
import math

def smallestDivisor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n
for t in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		temp = n // smallestDivisor(n)
		if temp == n:
			print(1, n - 1)
		else:
			print(temp, n - temp)


import math

def solve(n):
	sq = int(math.sqrt(n)) + 5
	for i in range(2, sq):
		if not n % i:
			return str(n // i) + ' ' + str(n - n // i)
	return '1 ' + str(n - 1)
t = int(input())
for i_t in range(t):
	n = int(input())
	print(solve(n))


import math
num_de_casos = int(input())
for i in range(num_de_casos):
	caso = int(input())
	raiz = int(math.sqrt(caso))
	maior = 1
	for j in range(2, raiz + 1):
		if caso % j == 0:
			maior = caso // j
			break
	complemento = caso - maior
	print(maior, complemento)


import math
import sys
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		t = sys.maxsize
		a = 0
		b = 0
		f = 0
		for p in range(2, int(math.sqrt(n)) + 1):
			if n % p == 0:
				q = n - p
				x = max(p, q)
				if x < t:
					a = p
					b = q
					t = x
				k = n // p
				l = n - k
				y = max(k, l)
				if y < t:
					a = k
					b = l
					t = y
				f = 1
		if f == 0:
			print(1, n - 1)
		else:
			print(a, b)


def smallestDivisor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n
for _ in range(int(input())):
	n = int(input())
	x = smallestDivisor(n)
	print(n // x, n * (x - 1) // x)


import math

def rt(n):
	i = 1
	arr = []
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				arr.append(i)
			else:
				arr.append(i)
				arr.append(n // i)
		i = i + 1
	return arr
for _ in range(int(input())):
	n = int(input())
	arr = rt(n)
	m = max(arr)
	arr.remove(m)
	m = max(arr)
	t = n // m
	t = m * (t - 1)
	print(m, t)


from sys import stdin
input = stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	a = 1
	i = 2
	while i * i <= n:
		if n % i == 0:
			a = n // i
			break
		i += 1
	b = n - a
	print(a, b)


from math import gcd, sqrt

def primefactors(n):
	maxx = 0
	a = 0
	for i in range(1, int(sqrt(n)) + 1):
		if n % i == 0:
			if maxx < gcd(i, n - i):
				maxx = gcd(i, n - i)
				a = i
			if n - n // i != 0 and maxx < gcd(n // i, n - n // i):
				maxx = gcd(n // i, n - n // i)
				a = n // i
	return a
for _ in range(int(input())):
	n = int(input())
	a = primefactors(n)
	b = n - a
	print(a, b)


import math

def prime(n, lis):
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			lis.append(i)
			n = n / i
	if n > 2:
		lis.append(n)
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		lis = []
		prime(n, lis)
		lis.sort()
		a = b = 1
		for i in lis:
			a = a * i
		if len(lis) == 1:
			print(int(lis[0]) - 1, 1)
		else:
			print(int(a // lis[0]), int(a // lis[0] * (lis[0] - 1)))


from sys import stdin, stdout
from collections import Counter
from math import ceil
from bisect import bisect_left
from bisect import bisect_right
import math

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

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

def ip():
	return int(stdin.readline().strip())

def op(ans):
	return stdout.write(str(ans) + '\n')
from math import gcd as __gcd, sqrt, ceil

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

def findNums(x, li):
	ans = 0
	for i in range(2, ceil(sqrt(x)) + 1):
		if x % i == 0:
			li.append(i)
			li.append(n // i)
	return li

def isprime(n):
	flag = 0
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
			flag = 1
			break
	if flag == 0:
		return True
for i in range(ip()):
	li = []
	n = ip()
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif isprime(n):
		print(1, n - 1)
	else:
		print(n - max(findNums(n, li)), max(findNums(n, li)))


import sys

def read():
	return sys.stdin.readline()

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

def main():
	t = int(read())
	for tt in range(t):
		n = int(read())
		k = 2
		ans = (n - 1, 1)
		while k * k <= n:
			if n % k == 0:
				ans = min(ans, (n - k, k))
				ans = min(ans, (n - n // k, n // k))
			k += 1
		print(ans[0], ans[1])
main()


import math
t = int(input())
for i in range(t):
	n = int(input())
	sq = int(math.sqrt(n))
	ck = 0
	for j in range(2, sq + 1):
		if n % j == 0:
			ck = 1
			break
	if ck == 0:
		print(1, n - 1)
	else:
		print(n // j, n - n // j)


for _ in range(int(input())):
	x = int(input())
	for i in range(2, int(x ** 0.5) + 1):
		if x % i == 0:
			a = x // i
			print(a, x - a)
			break
	else:
		print(1, x - 1)


from fractions import Fraction
import bisect
import os
import io
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate
from queue import Queue

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

def iinput():
	return int(input())

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

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())
mod = int(1000000000.0) + 7

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
t = 1
t = iinput()
for _ in range(t):
	n = iinput()
	j = 2
	ans = n
	while j * j <= n:
		if n % j == 0:
			ans = j
			break
		j += 1
	print(n // ans, n - n // ans)


primes = []
cn = 2
while cn ** 2 < 10 ** 9:
	f = 1
	for p in primes:
		if p * p > cn:
			break
		if not cn % p:
			f = 0
			break
	if f:
		primes.append(cn)
	cn += 1 + cn % 2
for i in range(int(input())):
	n = int(input())
	for p in primes:
		if n % p == 0:
			print(n // p, n - n // p)
			break
	else:
		print(1, n - 1)


import math

def is_prime(n):
	if n == 2:
		return True
	elif n % 2 == 0 or n == 1:
		return False
	max_divisor = math.floor(math.sqrt(n))
	for d in range(3, 1 + max_divisor, 2):
		if n % d == 0:
			return False
	return True
repetitions = int(input())
while repetitions > 0:
	n = int(input())
	if n % 2 == 0:
		print(int(n / 2), int(n / 2))
	elif is_prime(n):
		print(1, n - 1)
	else:
		for i in range(3, int(n / 2 + 1), 2):
			if n % i == 0:
				print(int(n / i), int(n - n / i))
				isPrime = False
				break
	repetitions -= 1


import functools

@functools.lru_cache(maxsize=None)
def factor(n, startFrom=2):
	if n <= 1:
		return []
	d = startFrom
	factors = []
	while n >= d * d:
		if n % d == 0:
			factors.append(d)
			n = n / d
		else:
			d += 1 + d % 2
	factors.append(n)
	return factors

def product(xs):
	prod = 1
	for x in xs:
		prod *= x
	return prod

def largest_proper_factor(n):
	factors = factor(n)
	if len(factors) > 1:
		return product(factors[1:])
	else:
		return 1

def solve(n):
	if n % 2 == 0:
		return [n // 2, n // 2]
	else:
		max_factor = int(largest_proper_factor(n))
		return [max_factor, n - max_factor]

def format_solve(n):
	return ' '.join(map(str, solve(n)))

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		print(format_solve(n))
main()


import math
t = int(input())
res = []
i = 0
while i < t:
	n = int(input())
	if n % 2 == 0:
		a = int(n / 2)
		res.append([a, a])
	else:
		k = 3
		divisor = 1
		while k <= math.sqrt(n):
			if n % k == 0:
				divisor = k
				break
			k += 1
		if divisor == 1:
			res.append([1, n - 1])
		else:
			b = int(n / divisor)
			res.append([b, n - b])
	i += 1
for e in res:
	print(e[0], e[1])


for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		lst = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667, 10687, 10691, 10709, 10711, 10723, 10729, 10733, 10739, 10753, 10771, 10781, 10789, 10799, 10831, 10837, 10847, 10853, 10859, 10861, 10867, 10883, 10889, 10891, 10903, 10909, 10937, 10939, 10949, 10957, 10973, 10979, 10987, 10993, 11003, 11027, 11047, 11057, 11059, 11069, 11071, 11083, 11087, 11093, 11113, 11117, 11119, 11131, 11149, 11159, 11161, 11171, 11173, 11177, 11197, 11213, 11239, 11243, 11251, 11257, 11261, 11273, 11279, 11287, 11299, 11311, 11317, 11321, 11329, 11351, 11353, 11369, 11383, 11393, 11399, 11411, 11423, 11437, 11443, 11447, 11467, 11471, 11483, 11489, 11491, 11497, 11503, 11519, 11527, 11549, 11551, 11579, 11587, 11593, 11597, 11617, 11621, 11633, 11657, 11677, 11681, 11689, 11699, 11701, 11717, 11719, 11731, 11743, 11777, 11779, 11783, 11789, 11801, 11807, 11813, 11821, 11827, 11831, 11833, 11839, 11863, 11867, 11887, 11897, 11903, 11909, 11923, 11927, 11933, 11939, 11941, 11953, 11959, 11969, 11971, 11981, 11987, 12007, 12011, 12037, 12041, 12043, 12049, 12071, 12073, 12097, 12101, 12107, 12109, 12113, 12119, 12143, 12149, 12157, 12161, 12163, 12197, 12203, 12211, 12227, 12239, 12241, 12251, 12253, 12263, 12269, 12277, 12281, 12289, 12301, 12323, 12329, 12343, 12347, 12373, 12377, 12379, 12391, 12401, 12409, 12413, 12421, 12433, 12437, 12451, 12457, 12473, 12479, 12487, 12491, 12497, 12503, 12511, 12517, 12527, 12539, 12541, 12547, 12553, 12569, 12577, 12583, 12589, 12601, 12611, 12613, 12619, 12637, 12641, 12647, 12653, 12659, 12671, 12689, 12697, 12703, 12713, 12721, 12739, 12743, 12757, 12763, 12781, 12791, 12799, 12809, 12821, 12823, 12829, 12841, 12853, 12889, 12893, 12899, 12907, 12911, 12917, 12919, 12923, 12941, 12953, 12959, 12967, 12973, 12979, 12983, 13001, 13003, 13007, 13009, 13033, 13037, 13043, 13049, 13063, 13093, 13099, 13103, 13109, 13121, 13127, 13147, 13151, 13159, 13163, 13171, 13177, 13183, 13187, 13217, 13219, 13229, 13241, 13249, 13259, 13267, 13291, 13297, 13309, 13313, 13327, 13331, 13337, 13339, 13367, 13381, 13397, 13399, 13411, 13417, 13421, 13441, 13451, 13457, 13463, 13469, 13477, 13487, 13499, 13513, 13523, 13537, 13553, 13567, 13577, 13591, 13597, 13613, 13619, 13627, 13633, 13649, 13669, 13679, 13681, 13687, 13691, 13693, 13697, 13709, 13711, 13721, 13723, 13729, 13751, 13757, 13759, 13763, 13781, 13789, 13799, 13807, 13829, 13831, 13841, 13859, 13873, 13877, 13879, 13883, 13901, 13903, 13907, 13913, 13921, 13931, 13933, 13963, 13967, 13997, 13999, 14009, 14011, 14029, 14033, 14051, 14057, 14071, 14081, 14083, 14087, 14107, 14143, 14149, 14153, 14159, 14173, 14177, 14197, 14207, 14221, 14243, 14249, 14251, 14281, 14293, 14303, 14321, 14323, 14327, 14341, 14347, 14369, 14387, 14389, 14401, 14407, 14411, 14419, 14423, 14431, 14437, 14447, 14449, 14461, 14479, 14489, 14503, 14519, 14533, 14537, 14543, 14549, 14551, 14557, 14561, 14563, 14591, 14593, 14621, 14627, 14629, 14633, 14639, 14653, 14657, 14669, 14683, 14699, 14713, 14717, 14723, 14731, 14737, 14741, 14747, 14753, 14759, 14767, 14771, 14779, 14783, 14797, 14813, 14821, 14827, 14831, 14843, 14851, 14867, 14869, 14879, 14887, 14891, 14897, 14923, 14929, 14939, 14947, 14951, 14957, 14969, 14983, 15013, 15017, 15031, 15053, 15061, 15073, 15077, 15083, 15091, 15101, 15107, 15121, 15131, 15137, 15139, 15149, 15161, 15173, 15187, 15193, 15199, 15217, 15227, 15233, 15241, 15259, 15263, 15269, 15271, 15277, 15287, 15289, 15299, 15307, 15313, 15319, 15329, 15331, 15349, 15359, 15361, 15373, 15377, 15383, 15391, 15401, 15413, 15427, 15439, 15443, 15451, 15461, 15467, 15473, 15493, 15497, 15511, 15527, 15541, 15551, 15559, 15569, 15581, 15583, 15601, 15607, 15619, 15629, 15641, 15643, 15647, 15649, 15661, 15667, 15671, 15679, 15683, 15727, 15731, 15733, 15737, 15739, 15749, 15761, 15767, 15773, 15787, 15791, 15797, 15803, 15809, 15817, 15823, 15859, 15877, 15881, 15887, 15889, 15901, 15907, 15913, 15919, 15923, 15937, 15959, 15971, 15973, 15991, 16001, 16007, 16033, 16057, 16061, 16063, 16067, 16069, 16073, 16087, 16091, 16097, 16103, 16111, 16127, 16139, 16141, 16183, 16187, 16189, 16193, 16217, 16223, 16229, 16231, 16249, 16253, 16267, 16273, 16301, 16319, 16333, 16339, 16349, 16361, 16363, 16369, 16381, 16411, 16417, 16421, 16427, 16433, 16447, 16451, 16453, 16477, 16481, 16487, 16493, 16519, 16529, 16547, 16553, 16561, 16567, 16573, 16603, 16607, 16619, 16631, 16633, 16649, 16651, 16657, 16661, 16673, 16691, 16693, 16699, 16703, 16729, 16741, 16747, 16759, 16763, 16787, 16811, 16823, 16829, 16831, 16843, 16871, 16879, 16883, 16889, 16901, 16903, 16921, 16927, 16931, 16937, 16943, 16963, 16979, 16981, 16987, 16993, 17011, 17021, 17027, 17029, 17033, 17041, 17047, 17053, 17077, 17093, 17099, 17107, 17117, 17123, 17137, 17159, 17167, 17183, 17189, 17191, 17203, 17207, 17209, 17231, 17239, 17257, 17291, 17293, 17299, 17317, 17321, 17327, 17333, 17341, 17351, 17359, 17377, 17383, 17387, 17389, 17393, 17401, 17417, 17419, 17431, 17443, 17449, 17467, 17471, 17477, 17483, 17489, 17491, 17497, 17509, 17519, 17539, 17551, 17569, 17573, 17579, 17581, 17597, 17599, 17609, 17623, 17627, 17657, 17659, 17669, 17681, 17683, 17707, 17713, 17729, 17737, 17747, 17749, 17761, 17783, 17789, 17791, 17807, 17827, 17837, 17839, 17851, 17863, 17881, 17891, 17903, 17909, 17911, 17921, 17923, 17929, 17939, 17957, 17959, 17971, 17977, 17981, 17987, 17989, 18013, 18041, 18043, 18047, 18049, 18059, 18061, 18077, 18089, 18097, 18119, 18121, 18127, 18131, 18133, 18143, 18149, 18169, 18181, 18191, 18199, 18211, 18217, 18223, 18229, 18233, 18251, 18253, 18257, 18269, 18287, 18289, 18301, 18307, 18311, 18313, 18329, 18341, 18353, 18367, 18371, 18379, 18397, 18401, 18413, 18427, 18433, 18439, 18443, 18451, 18457, 18461, 18481, 18493, 18503, 18517, 18521, 18523, 18539, 18541, 18553, 18583, 18587, 18593, 18617, 18637, 18661, 18671, 18679, 18691, 18701, 18713, 18719, 18731, 18743, 18749, 18757, 18773, 18787, 18793, 18797, 18803, 18839, 18859, 18869, 18899, 18911, 18913, 18917, 18919, 18947, 18959, 18973, 18979, 19001, 19009, 19013, 19031, 19037, 19051, 19069, 19073, 19079, 19081, 19087, 19121, 19139, 19141, 19157, 19163, 19181, 19183, 19207, 19211, 19213, 19219, 19231, 19237, 19249, 19259, 19267, 19273, 19289, 19301, 19309, 19319, 19333, 19373, 19379, 19381, 19387, 19391, 19403, 19417, 19421, 19423, 19427, 19429, 19433, 19441, 19447, 19457, 19463, 19469, 19471, 19477, 19483, 19489, 19501, 19507, 19531, 19541, 19543, 19553, 19559, 19571, 19577, 19583, 19597, 19603, 19609, 19661, 19681, 19687, 19697, 19699, 19709, 19717, 19727, 19739, 19751, 19753, 19759, 19763, 19777, 19793, 19801, 19813, 19819, 19841, 19843, 19853, 19861, 19867, 19889, 19891, 19913, 19919, 19927, 19937, 19949, 19961, 19963, 19973, 19979, 19991, 19993, 19997, 20011, 20021, 20023, 20029, 20047, 20051, 20063, 20071, 20089, 20101, 20107, 20113, 20117, 20123, 20129, 20143, 20147, 20149, 20161, 20173, 20177, 20183, 20201, 20219, 20231, 20233, 20249, 20261, 20269, 20287, 20297, 20323, 20327, 20333, 20341, 20347, 20353, 20357, 20359, 20369, 20389, 20393, 20399, 20407, 20411, 20431, 20441, 20443, 20477, 20479, 20483, 20507, 20509, 20521, 20533, 20543, 20549, 20551, 20563, 20593, 20599, 20611, 20627, 20639, 20641, 20663, 20681, 20693, 20707, 20717, 20719, 20731, 20743, 20747, 20749, 20753, 20759, 20771, 20773, 20789, 20807, 20809, 20849, 20857, 20873, 20879, 20887, 20897, 20899, 20903, 20921, 20929, 20939, 20947, 20959, 20963, 20981, 20983, 21001, 21011, 21013, 21017, 21019, 21023, 21031, 21059, 21061, 21067, 21089, 21101, 21107, 21121, 21139, 21143, 21149, 21157, 21163, 21169, 21179, 21187, 21191, 21193, 21211, 21221, 21227, 21247, 21269, 21277, 21283, 21313, 21317, 21319, 21323, 21341, 21347, 21377, 21379, 21383, 21391, 21397, 21401, 21407, 21419, 21433, 21467, 21481, 21487, 21491, 21493, 21499, 21503, 21517, 21521, 21523, 21529, 21557, 21559, 21563, 21569, 21577, 21587, 21589, 21599, 21601, 21611, 21613, 21617, 21647, 21649, 21661, 21673, 21683, 21701, 21713, 21727, 21737, 21739, 21751, 21757, 21767, 21773, 21787, 21799, 21803, 21817, 21821, 21839, 21841, 21851, 21859, 21863, 21871, 21881, 21893, 21911, 21929, 21937, 21943, 21961, 21977, 21991, 21997, 22003, 22013, 22027, 22031, 22037, 22039, 22051, 22063, 22067, 22073, 22079, 22091, 22093, 22109, 22111, 22123, 22129, 22133, 22147, 22153, 22157, 22159, 22171, 22189, 22193, 22229, 22247, 22259, 22271, 22273, 22277, 22279, 22283, 22291, 22303, 22307, 22343, 22349, 22367, 22369, 22381, 22391, 22397, 22409, 22433, 22441, 22447, 22453, 22469, 22481, 22483, 22501, 22511, 22531, 22541, 22543, 22549, 22567, 22571, 22573, 22613, 22619, 22621, 22637, 22639, 22643, 22651, 22669, 22679, 22691, 22697, 22699, 22709, 22717, 22721, 22727, 22739, 22741, 22751, 22769, 22777, 22783, 22787, 22807, 22811, 22817, 22853, 22859, 22861, 22871, 22877, 22901, 22907, 22921, 22937, 22943, 22961, 22963, 22973, 22993, 23003, 23011, 23017, 23021, 23027, 23029, 23039, 23041, 23053, 23057, 23059, 23063, 23071, 23081, 23087, 23099, 23117, 23131, 23143, 23159, 23167, 23173, 23189, 23197, 23201, 23203, 23209, 23227, 23251, 23269, 23279, 23291, 23293, 23297, 23311, 23321, 23327, 23333, 23339, 23357, 23369, 23371, 23399, 23417, 23431, 23447, 23459, 23473, 23497, 23509, 23531, 23537, 23539, 23549, 23557, 23561, 23563, 23567, 23581, 23593, 23599, 23603, 23609, 23623, 23627, 23629, 23633, 23663, 23669, 23671, 23677, 23687, 23689, 23719, 23741, 23743, 23747, 23753, 23761, 23767, 23773, 23789, 23801, 23813, 23819, 23827, 23831, 23833, 23857, 23869, 23873, 23879, 23887, 23893, 23899, 23909, 23911, 23917, 23929, 23957, 23971, 23977, 23981, 23993, 24001, 24007, 24019, 24023, 24029, 24043, 24049, 24061, 24071, 24077, 24083, 24091, 24097, 24103, 24107, 24109, 24113, 24121, 24133, 24137, 24151, 24169, 24179, 24181, 24197, 24203, 24223, 24229, 24239, 24247, 24251, 24281, 24317, 24329, 24337, 24359, 24371, 24373, 24379, 24391, 24407, 24413, 24419, 24421, 24439, 24443, 24469, 24473, 24481, 24499, 24509, 24517, 24527, 24533, 24547, 24551, 24571, 24593, 24611, 24623, 24631, 24659, 24671, 24677, 24683, 24691, 24697, 24709, 24733, 24749, 24763, 24767, 24781, 24793, 24799, 24809, 24821, 24841, 24847, 24851, 24859, 24877, 24889, 24907, 24917, 24919, 24923, 24943, 24953, 24967, 24971, 24977, 24979, 24989, 25013, 25031, 25033, 25037, 25057, 25073, 25087, 25097, 25111, 25117, 25121, 25127, 25147, 25153, 25163, 25169, 25171, 25183, 25189, 25219, 25229, 25237, 25243, 25247, 25253, 25261, 25301, 25303, 25307, 25309, 25321, 25339, 25343, 25349, 25357, 25367, 25373, 25391, 25409, 25411, 25423, 25439, 25447, 25453, 25457, 25463, 25469, 25471, 25523, 25537, 25541, 25561, 25577, 25579, 25583, 25589, 25601, 25603, 25609, 25621, 25633, 25639, 25643, 25657, 25667, 25673, 25679, 25693, 25703, 25717, 25733, 25741, 25747, 25759, 25763, 25771, 25793, 25799, 25801, 25819, 25841, 25847, 25849, 25867, 25873, 25889, 25903, 25913, 25919, 25931, 25933, 25939, 25943, 25951, 25969, 25981, 25997, 25999, 26003, 26017, 26021, 26029, 26041, 26053, 26083, 26099, 26107, 26111, 26113, 26119, 26141, 26153, 26161, 26171, 26177, 26183, 26189, 26203, 26209, 26227, 26237, 26249, 26251, 26261, 26263, 26267, 26293, 26297, 26309, 26317, 26321, 26339, 26347, 26357, 26371, 26387, 26393, 26399, 26407, 26417, 26423, 26431, 26437, 26449, 26459, 26479, 26489, 26497, 26501, 26513, 26539, 26557, 26561, 26573, 26591, 26597, 26627, 26633, 26641, 26647, 26669, 26681, 26683, 26687, 26693, 26699, 26701, 26711, 26713, 26717, 26723, 26729, 26731, 26737, 26759, 26777, 26783, 26801, 26813, 26821, 26833, 26839, 26849, 26861, 26863, 26879, 26881, 26891, 26893, 26903, 26921, 26927, 26947, 26951, 26953, 26959, 26981, 26987, 26993, 27011, 27017, 27031, 27043, 27059, 27061, 27067, 27073, 27077, 27091, 27103, 27107, 27109, 27127, 27143, 27179, 27191, 27197, 27211, 27239, 27241, 27253, 27259, 27271, 27277, 27281, 27283, 27299, 27329, 27337, 27361, 27367, 27397, 27407, 27409, 27427, 27431, 27437, 27449, 27457, 27479, 27481, 27487, 27509, 27527, 27529, 27539, 27541, 27551, 27581, 27583, 27611, 27617, 27631, 27647, 27653, 27673, 27689, 27691, 27697, 27701, 27733, 27737, 27739, 27743, 27749, 27751, 27763, 27767, 27773, 27779, 27791, 27793, 27799, 27803, 27809, 27817, 27823, 27827, 27847, 27851, 27883, 27893, 27901, 27917, 27919, 27941, 27943, 27947, 27953, 27961, 27967, 27983, 27997, 28001, 28019, 28027, 28031, 28051, 28057, 28069, 28081, 28087, 28097, 28099, 28109, 28111, 28123, 28151, 28163, 28181, 28183, 28201, 28211, 28219, 28229, 28277, 28279, 28283, 28289, 28297, 28307, 28309, 28319, 28349, 28351, 28387, 28393, 28403, 28409, 28411, 28429, 28433, 28439, 28447, 28463, 28477, 28493, 28499, 28513, 28517, 28537, 28541, 28547, 28549, 28559, 28571, 28573, 28579, 28591, 28597, 28603, 28607, 28619, 28621, 28627, 28631, 28643, 28649, 28657, 28661, 28663, 28669, 28687, 28697, 28703, 28711, 28723, 28729, 28751, 28753, 28759, 28771, 28789, 28793, 28807, 28813, 28817, 28837, 28843, 28859, 28867, 28871, 28879, 28901, 28909, 28921, 28927, 28933, 28949, 28961, 28979, 29009, 29017, 29021, 29023, 29027, 29033, 29059, 29063, 29077, 29101, 29123, 29129, 29131, 29137, 29147, 29153, 29167, 29173, 29179, 29191, 29201, 29207, 29209, 29221, 29231, 29243, 29251, 29269, 29287, 29297, 29303, 29311, 29327, 29333, 29339, 29347, 29363, 29383, 29387, 29389, 29399, 29401, 29411, 29423, 29429, 29437, 29443, 29453, 29473, 29483, 29501, 29527, 29531, 29537, 29567, 29569, 29573, 29581, 29587, 29599, 29611, 29629, 29633, 29641, 29663, 29669, 29671, 29683, 29717, 29723, 29741, 29753, 29759, 29761, 29789, 29803, 29819, 29833, 29837, 29851, 29863, 29867, 29873, 29879, 29881, 29917, 29921, 29927, 29947, 29959, 29983, 29989, 30011, 30013, 30029, 30047, 30059, 30071, 30089, 30091, 30097, 30103, 30109, 30113, 30119, 30133, 30137, 30139, 30161, 30169, 30181, 30187, 30197, 30203, 30211, 30223, 30241, 30253, 30259, 30269, 30271, 30293, 30307, 30313, 30319, 30323, 30341, 30347, 30367, 30389, 30391, 30403, 30427, 30431, 30449, 30467, 30469, 30491, 30493, 30497, 30509, 30517, 30529, 30539, 30553, 30557, 30559, 30577, 30593, 30631, 30637, 30643, 30649, 30661, 30671, 30677, 30689, 30697, 30703, 30707, 30713, 30727, 30757, 30763, 30773, 30781, 30803, 30809, 30817, 30829, 30839, 30841, 30851, 30853, 30859, 30869, 30871, 30881, 30893, 30911, 30931, 30937, 30941, 30949, 30971, 30977, 30983, 31013, 31019, 31033, 31039, 31051, 31063, 31069, 31079, 31081, 31091, 31121, 31123, 31139, 31147, 31151, 31153, 31159, 31177, 31181, 31183, 31189, 31193, 31219, 31223, 31231, 31237, 31247, 31249, 31253, 31259, 31267, 31271, 31277, 31307, 31319, 31321, 31327, 31333, 31337, 31357, 31379, 31387, 31391, 31393, 31397, 31469, 31477, 31481, 31489, 31511, 31513, 31517, 31531, 31541, 31543, 31547, 31567, 31573, 31583, 31601, 31607, 31627, 31643, 31649, 31657, 31663, 31667, 31687, 31699, 31721, 31723, 31727, 31729, 31741, 31751, 31769, 31771, 31793, 31799, 31817, 31847, 31849, 31859, 31873, 31883, 31891, 31907, 31957, 31963, 31973, 31981, 31991, 32003, 32009, 32027, 32029, 32051, 32057, 32059, 32063, 32069, 32077, 32083, 32089, 32099, 32117, 32119, 32141, 32143, 32159, 32173, 32183, 32189, 32191, 32203, 32213, 32233, 32237, 32251, 32257, 32261, 32297, 32299, 32303, 32309, 32321, 32323, 32327, 32341, 32353, 32359, 32363, 32369, 32371, 32377, 32381, 32401, 32411, 32413, 32423, 32429, 32441, 32443, 32467, 32479, 32491, 32497, 32503, 32507, 32531, 32533, 32537, 32561, 32563, 32569, 32573, 32579, 32587, 32603, 32609, 32611, 32621, 32633, 32647, 32653, 32687, 32693, 32707, 32713, 32717, 32719, 32749, 32771, 32779, 32783, 32789, 32797, 32801, 32803, 32831, 32833, 32839, 32843, 32869, 32887, 32909, 32911, 32917, 32933, 32939, 32941, 32957, 32969, 32971, 32983, 32987, 32993, 32999, 33013, 33023, 33029, 33037, 33049, 33053, 33071, 33073, 33083, 33091, 33107, 33113, 33119, 33149, 33151, 33161, 33179, 33181, 33191, 33199, 33203, 33211, 33223, 33247, 33287, 33289, 33301, 33311, 33317, 33329, 33331, 33343, 33347, 33349, 33353, 33359, 33377, 33391, 33403, 33409, 33413, 33427, 33457, 33461, 33469, 33479, 33487, 33493, 33503, 33521, 33529, 33533, 33547, 33563, 33569, 33577, 33581, 33587, 33589, 33599, 33601, 33613, 33617, 33619, 33623, 33629, 33637, 33641, 33647, 33679, 33703, 33713, 33721, 33739, 33749, 33751, 33757, 33767, 33769, 33773, 33791, 33797, 33809, 33811, 33827, 33829, 33851, 33857, 33863, 33871, 33889, 33893, 33911, 33923, 33931, 33937, 33941, 33961, 33967, 33997, 34019, 34031, 34033, 34039, 34057, 34061, 34123, 34127, 34129, 34141, 34147, 34157, 34159, 34171, 34183, 34211, 34213, 34217, 34231, 34253, 34259, 34261, 34267, 34273, 34283, 34297, 34301, 34303, 34313, 34319, 34327, 34337, 34351, 34361, 34367, 34369, 34381, 34403, 34421, 34429, 34439, 34457, 34469, 34471, 34483, 34487, 34499, 34501, 34511, 34513, 34519, 34537, 34543, 34549, 34583, 34589, 34591, 34603, 34607, 34613, 34631, 34649, 34651, 34667, 34673, 34679, 34687, 34693, 34703, 34721, 34729, 34739, 34747, 34757, 34759, 34763, 34781, 34807, 34819, 34841, 34843, 34847, 34849, 34871, 34877, 34883, 34897, 34913, 34919, 34939, 34949, 34961, 34963, 34981, 35023, 35027, 35051, 35053, 35059, 35069, 35081, 35083, 35089, 35099, 35107, 35111, 35117, 35129, 35141, 35149, 35153, 35159, 35171, 35201, 35221, 35227, 35251, 35257, 35267, 35279, 35281, 35291, 35311, 35317, 35323, 35327, 35339, 35353, 35363, 35381, 35393, 35401, 35407, 35419, 35423, 35437, 35447, 35449, 35461, 35491, 35507, 35509, 35521, 35527, 35531, 35533, 35537, 35543, 35569, 35573, 35591, 35593, 35597, 35603, 35617, 35671, 35677, 35729, 35731, 35747, 35753, 35759, 35771, 35797, 35801, 35803, 35809, 35831, 35837, 35839, 35851, 35863, 35869, 35879, 35897, 35899, 35911, 35923, 35933, 35951, 35963, 35969, 35977, 35983, 35993, 35999, 36007, 36011, 36013, 36017, 36037, 36061, 36067, 36073, 36083, 36097, 36107, 36109, 36131, 36137, 36151, 36161, 36187, 36191, 36209, 36217, 36229, 36241, 36251, 36263, 36269, 36277, 36293, 36299, 36307, 36313, 36319, 36341, 36343, 36353, 36373, 36383, 36389, 36433, 36451, 36457, 36467, 36469, 36473, 36479, 36493, 36497, 36523, 36527, 36529, 36541, 36551, 36559, 36563, 36571, 36583, 36587, 36599, 36607, 36629, 36637, 36643, 36653, 36671, 36677, 36683, 36691, 36697, 36709, 36713, 36721, 36739, 36749, 36761, 36767, 36779, 36781, 36787, 36791, 36793, 36809, 36821, 36833, 36847, 36857, 36871, 36877, 36887, 36899, 36901, 36913, 36919, 36923, 36929, 36931, 36943, 36947, 36973, 36979, 36997, 37003, 37013, 37019, 37021, 37039, 37049, 37057, 37061, 37087, 37097, 37117, 37123, 37139, 37159, 37171, 37181, 37189, 37199, 37201, 37217, 37223, 37243, 37253, 37273, 37277, 37307, 37309, 37313, 37321, 37337, 37339, 37357, 37361, 37363, 37369, 37379, 37397, 37409, 37423, 37441, 37447, 37463, 37483, 37489, 37493, 37501, 37507, 37511, 37517, 37529, 37537, 37547, 37549, 37561, 37567, 37571, 37573, 37579, 37589, 37591, 37607, 37619, 37633, 37643, 37649, 37657, 37663, 37691, 37693, 37699, 37717, 37747, 37781, 37783, 37799, 37811, 37813, 37831, 37847, 37853, 37861, 37871, 37879, 37889, 37897, 37907, 37951, 37957, 37963, 37967, 37987, 37991, 37993, 37997, 38011, 38039, 38047, 38053, 38069, 38083, 38113, 38119, 38149, 38153, 38167, 38177, 38183, 38189, 38197, 38201, 38219, 38231, 38237, 38239, 38261, 38273, 38281, 38287, 38299, 38303, 38317, 38321, 38327, 38329, 38333, 38351, 38371, 38377, 38393, 38431, 38447, 38449, 38453, 38459, 38461, 38501, 38543, 38557, 38561, 38567, 38569, 38593, 38603, 38609, 38611, 38629, 38639, 38651, 38653, 38669, 38671, 38677, 38693, 38699, 38707, 38711, 38713, 38723, 38729, 38737, 38747, 38749, 38767, 38783, 38791, 38803, 38821, 38833, 38839, 38851, 38861, 38867, 38873, 38891, 38903, 38917, 38921, 38923, 38933, 38953, 38959, 38971, 38977, 38993, 39019, 39023, 39041, 39043, 39047, 39079, 39089, 39097, 39103, 39107, 39113, 39119, 39133, 39139, 39157, 39161, 39163, 39181, 39191, 39199, 39209, 39217, 39227, 39229, 39233, 39239, 39241, 39251, 39293, 39301, 39313, 39317, 39323, 39341, 39343, 39359, 39367, 39371, 39373, 39383, 39397, 39409, 39419, 39439, 39443, 39451, 39461, 39499, 39503, 39509, 39511, 39521, 39541, 39551, 39563, 39569, 39581, 39607, 39619, 39623, 39631, 39659, 39667, 39671, 39679, 39703, 39709, 39719, 39727, 39733, 39749, 39761, 39769, 39779, 39791, 39799, 39821, 39827, 39829, 39839, 39841, 39847, 39857, 39863, 39869, 39877, 39883, 39887, 39901, 39929, 39937, 39953, 39971, 39979, 39983, 39989, 40009, 40013, 40031, 40037, 40039, 40063, 40087, 40093, 40099, 40111, 40123, 40127, 40129, 40151, 40153, 40163, 40169, 40177, 40189, 40193, 40213, 40231, 40237, 40241, 40253, 40277, 40283, 40289, 40343, 40351, 40357, 40361, 40387, 40423, 40427, 40429, 40433, 40459, 40471, 40483, 40487, 40493, 40499, 40507, 40519, 40529, 40531, 40543, 40559, 40577, 40583, 40591, 40597, 40609, 40627, 40637, 40639, 40693, 40697, 40699, 40709, 40739, 40751, 40759, 40763, 40771, 40787, 40801, 40813, 40819, 40823, 40829, 40841, 40847, 40849, 40853, 40867, 40879, 40883, 40897, 40903, 40927, 40933, 40939, 40949, 40961, 40973, 40993, 41011, 41017, 41023, 41039, 41047, 41051, 41057, 41077, 41081, 41113, 41117, 41131, 41141, 41143, 41149, 41161, 41177, 41179, 41183, 41189, 41201, 41203, 41213, 41221, 41227, 41231, 41233, 41243, 41257, 41263, 41269, 41281, 41299, 41333, 41341, 41351, 41357, 41381, 41387, 41389, 41399, 41411, 41413, 41443, 41453, 41467, 41479, 41491, 41507, 41513, 41519, 41521, 41539, 41543, 41549, 41579, 41593, 41597, 41603, 41609, 41611, 41617, 41621, 41627, 41641, 41647, 41651, 41659, 41669, 41681, 41687, 41719, 41729, 41737, 41759, 41761, 41771, 41777, 41801, 41809, 41813, 41843, 41849, 41851, 41863, 41879, 41887, 41893, 41897, 41903, 41911, 41927, 41941, 41947, 41953, 41957, 41959, 41969, 41981, 41983, 41999, 42013, 42017, 42019, 42023, 42043, 42061, 42071, 42073, 42083, 42089, 42101, 42131, 42139, 42157, 42169, 42179, 42181, 42187, 42193, 42197, 42209, 42221, 42223, 42227, 42239, 42257, 42281, 42283, 42293, 42299, 42307, 42323, 42331, 42337, 42349, 42359, 42373, 42379, 42391, 42397, 42403, 42407, 42409, 42433, 42437, 42443, 42451, 42457, 42461, 42463, 42467, 42473, 42487, 42491, 42499, 42509, 42533, 42557, 42569, 42571, 42577, 42589, 42611, 42641, 42643, 42649, 42667, 42677, 42683, 42689, 42697, 42701, 42703, 42709, 42719, 42727, 42737, 42743, 42751, 42767, 42773, 42787, 42793, 42797, 42821, 42829, 42839, 42841, 42853, 42859, 42863, 42899, 42901, 42923, 42929, 42937, 42943, 42953, 42961, 42967, 42979, 42989, 43003, 43013, 43019, 43037, 43049, 43051, 43063, 43067, 43093, 43103, 43117, 43133, 43151, 43159, 43177, 43189, 43201, 43207, 43223, 43237, 43261, 43271, 43283, 43291, 43313, 43319, 43321, 43331, 43391, 43397, 43399, 43403, 43411, 43427, 43441, 43451, 43457, 43481, 43487, 43499, 43517, 43541, 43543, 43573, 43577, 43579, 43591, 43597, 43607, 43609, 43613, 43627, 43633, 43649, 43651, 43661, 43669, 43691, 43711, 43717, 43721, 43753, 43759, 43777, 43781, 43783, 43787, 43789, 43793, 43801, 43853, 43867, 43889, 43891, 43913, 43933, 43943, 43951, 43961, 43963, 43969, 43973, 43987, 43991, 43997, 44017, 44021, 44027, 44029, 44041, 44053, 44059, 44071, 44087, 44089, 44101, 44111, 44119, 44123, 44129, 44131, 44159, 44171, 44179, 44189, 44201, 44203, 44207, 44221, 44249, 44257, 44263, 44267, 44269, 44273, 44279, 44281, 44293, 44351, 44357, 44371, 44381, 44383, 44389, 44417, 44449, 44453, 44483, 44491, 44497, 44501, 44507, 44519, 44531, 44533, 44537, 44543, 44549, 44563, 44579, 44587, 44617, 44621, 44623, 44633, 44641, 44647, 44651, 44657, 44683, 44687, 44699, 44701, 44711, 44729, 44741, 44753, 44771, 44773, 44777, 44789, 44797, 44809, 44819, 44839, 44843, 44851, 44867, 44879, 44887, 44893, 44909, 44917, 44927, 44939, 44953, 44959, 44963, 44971, 44983, 44987, 45007, 45013, 45053, 45061, 45077, 45083, 45119, 45121, 45127, 45131, 45137, 45139, 45161, 45179, 45181, 45191, 45197, 45233, 45247, 45259, 45263, 45281, 45289, 45293, 45307, 45317, 45319, 45329, 45337, 45341, 45343, 45361, 45377, 45389, 45403, 45413, 45427, 45433, 45439, 45481, 45491, 45497, 45503, 45523, 45533, 45541, 45553, 45557, 45569, 45587, 45589, 45599, 45613, 45631, 45641, 45659, 45667, 45673, 45677, 45691, 45697, 45707, 45737, 45751, 45757, 45763, 45767, 45779, 45817, 45821, 45823, 45827, 45833, 45841, 45853, 45863, 45869, 45887, 45893, 45943, 45949, 45953, 45959, 45971, 45979, 45989, 46021, 46027, 46049, 46051, 46061, 46073, 46091, 46093, 46099, 46103, 46133, 46141, 46147, 46153, 46171, 46181, 46183, 46187, 46199, 46219, 46229, 46237, 46261, 46271, 46273, 46279, 46301, 46307, 46309, 46327, 46337, 46349, 46351, 46381, 46399, 46411, 46439, 46441, 46447, 46451, 46457, 46471, 46477, 46489, 46499, 46507, 46511, 46523, 46549, 46559, 46567, 46573, 46589, 46591, 46601, 46619, 46633, 46639, 46643, 46649, 46663, 46679, 46681, 46687, 46691, 46703, 46723, 46727, 46747, 46751, 46757, 46769, 46771, 46807, 46811, 46817, 46819, 46829, 46831, 46853, 46861, 46867, 46877, 46889, 46901, 46919, 46933, 46957, 46993, 46997, 47017, 47041, 47051, 47057, 47059, 47087, 47093, 47111, 47119, 47123, 47129, 47137, 47143, 47147, 47149, 47161, 47189, 47207, 47221, 47237, 47251, 47269, 47279, 47287, 47293, 47297, 47303, 47309, 47317, 47339, 47351, 47353, 47363, 47381, 47387, 47389, 47407, 47417, 47419, 47431, 47441, 47459, 47491, 47497, 47501, 47507, 47513, 47521, 47527, 47533, 47543, 47563, 47569, 47581, 47591, 47599, 47609, 47623, 47629, 47639, 47653, 47657, 47659, 47681, 47699, 47701, 47711, 47713, 47717, 47737, 47741, 47743, 47777, 47779, 47791, 47797, 47807, 47809, 47819, 47837, 47843, 47857, 47869, 47881, 47903, 47911, 47917, 47933, 47939, 47947, 47951, 47963, 47969, 47977, 47981, 48017, 48023, 48029, 48049, 48073, 48079, 48091, 48109, 48119, 48121, 48131, 48157, 48163, 48179, 48187, 48193, 48197, 48221, 48239, 48247, 48259, 48271, 48281, 48299, 48311, 48313, 48337, 48341, 48353, 48371, 48383, 48397, 48407, 48409, 48413, 48437, 48449, 48463, 48473, 48479, 48481, 48487, 48491, 48497, 48523, 48527, 48533, 48539, 48541, 48563, 48571, 48589, 48593, 48611, 48619, 48623, 48647, 48649, 48661, 48673, 48677, 48679, 48731, 48733, 48751, 48757, 48761, 48767, 48779, 48781, 48787, 48799, 48809, 48817, 48821, 48823, 48847, 48857, 48859, 48869, 48871, 48883, 48889, 48907, 48947, 48953, 48973, 48989, 48991, 49003, 49009, 49019, 49031, 49033, 49037, 49043, 49057, 49069, 49081, 49103, 49109, 49117, 49121, 49123, 49139, 49157, 49169, 49171, 49177, 49193, 49199, 49201, 49207, 49211, 49223, 49253, 49261, 49277, 49279, 49297, 49307, 49331, 49333, 49339, 49363, 49367, 49369, 49391, 49393, 49409, 49411, 49417, 49429, 49433, 49451, 49459, 49463, 49477, 49481, 49499, 49523, 49529, 49531, 49537, 49547, 49549, 49559, 49597, 49603, 49613, 49627, 49633, 49639, 49663, 49667, 49669, 49681, 49697, 49711, 49727, 49739, 49741, 49747, 49757, 49783, 49787, 49789, 49801, 49807, 49811, 49823, 49831, 49843, 49853, 49871, 49877, 49891, 49919, 49921, 49927, 49937, 49939, 49943, 49957, 49991, 49993, 49999, 50021, 50023, 50033, 50047, 50051, 50053, 50069, 50077, 50087, 50093, 50101, 50111, 50119, 50123, 50129, 50131, 50147, 50153, 50159, 50177, 50207, 50221, 50227, 50231, 50261, 50263, 50273, 50287, 50291, 50311, 50321, 50329, 50333, 50341, 50359, 50363, 50377, 50383, 50387, 50411, 50417, 50423, 50441, 50459, 50461, 50497, 50503, 50513, 50527, 50539, 50543, 50549, 50551, 50581, 50587, 50591, 50593, 50599, 50627, 50647, 50651, 50671, 50683, 50707, 50723, 50741, 50753, 50767, 50773, 50777, 50789, 50821, 50833, 50839, 50849, 50857, 50867, 50873, 50891, 50893, 50909, 50923, 50929, 50951, 50957, 50969, 50971, 50989, 50993, 51001, 51031, 51043, 51047, 51059, 51061, 51071, 51109, 51131, 51133, 51137, 51151, 51157, 51169, 51193, 51197, 51199, 51203, 51217, 51229, 51239, 51241, 51257, 51263, 51283, 51287, 51307, 51329, 51341, 51343, 51347, 51349, 51361, 51383, 51407, 51413, 51419, 51421, 51427, 51431, 51437, 51439, 51449, 51461, 51473, 51479, 51481, 51487, 51503, 51511, 51517, 51521, 51539, 51551, 51563, 51577, 51581, 51593, 51599, 51607, 51613, 51631, 51637, 51647, 51659, 51673, 51679, 51683, 51691, 51713, 51719, 51721, 51749, 51767, 51769, 51787, 51797, 51803, 51817, 51827, 51829, 51839, 51853, 51859, 51869, 51871, 51893, 51899, 51907, 51913, 51929, 51941, 51949, 51971, 51973, 51977, 51991, 52009, 52021, 52027, 52051, 52057, 52067, 52069, 52081, 52103, 52121, 52127, 52147, 52153, 52163, 52177, 52181, 52183, 52189, 52201, 52223, 52237, 52249, 52253, 52259, 52267, 52289, 52291, 52301, 52313, 52321, 52361, 52363, 52369, 52379, 52387, 52391, 52433, 52453, 52457, 52489, 52501, 52511, 52517, 52529, 52541, 52543, 52553, 52561, 52567, 52571, 52579, 52583, 52609, 52627, 52631, 52639, 52667, 52673, 52691, 52697, 52709, 52711, 52721, 52727, 52733, 52747, 52757, 52769, 52783, 52807, 52813, 52817, 52837, 52859, 52861, 52879, 52883, 52889, 52901, 52903, 52919, 52937, 52951, 52957, 52963, 52967, 52973, 52981, 52999, 53003, 53017, 53047, 53051, 53069, 53077, 53087, 53089, 53093, 53101, 53113, 53117, 53129, 53147, 53149, 53161, 53171, 53173, 53189, 53197, 53201, 53231, 53233, 53239, 53267, 53269, 53279, 53281, 53299, 53309, 53323, 53327, 53353, 53359, 53377, 53381, 53401, 53407, 53411, 53419, 53437, 53441, 53453, 53479, 53503, 53507, 53527, 53549, 53551, 53569, 53591, 53593, 53597, 53609, 53611, 53617, 53623, 53629, 53633, 53639, 53653, 53657, 53681, 53693, 53699, 53717, 53719, 53731, 53759, 53773, 53777, 53783, 53791, 53813, 53819, 53831, 53849, 53857, 53861, 53881, 53887, 53891, 53897, 53899, 53917, 53923, 53927, 53939, 53951, 53959, 53987, 53993, 54001, 54011, 54013, 54037, 54049, 54059, 54083, 54091, 54101, 54121, 54133, 54139, 54151, 54163, 54167, 54181, 54193, 54217, 54251, 54269, 54277, 54287, 54293, 54311, 54319, 54323, 54331, 54347, 54361, 54367, 54371, 54377, 54401, 54403, 54409, 54413, 54419, 54421, 54437, 54443, 54449, 54469, 54493, 54497, 54499, 54503, 54517, 54521, 54539, 54541, 54547, 54559, 54563, 54577, 54581, 54583, 54601, 54617, 54623, 54629, 54631, 54647, 54667, 54673, 54679, 54709, 54713, 54721, 54727, 54751, 54767, 54773, 54779, 54787, 54799, 54829, 54833, 54851, 54869, 54877, 54881, 54907, 54917, 54919, 54941, 54949, 54959, 54973, 54979, 54983, 55001, 55009, 55021, 55049, 55051, 55057, 55061, 55073, 55079, 55103, 55109, 55117, 55127, 55147, 55163, 55171, 55201, 55207, 55213, 55217, 55219, 55229, 55243, 55249, 55259, 55291, 55313, 55331, 55333, 55337, 55339, 55343, 55351, 55373, 55381, 55399, 55411, 55439, 55441, 55457, 55469, 55487, 55501, 55511, 55529, 55541, 55547, 55579, 55589, 55603, 55609, 55619, 55621, 55631, 55633, 55639, 55661, 55663, 55667, 55673, 55681, 55691, 55697, 55711, 55717, 55721, 55733, 55763, 55787, 55793, 55799, 55807, 55813, 55817, 55819, 55823, 55829, 55837, 55843, 55849, 55871, 55889, 55897, 55901, 55903, 55921, 55927, 55931, 55933, 55949, 55967, 55987, 55997, 56003, 56009, 56039, 56041, 56053, 56081, 56087, 56093, 56099, 56101, 56113, 56123, 56131, 56149, 56167, 56171, 56179, 56197, 56207, 56209, 56237, 56239, 56249, 56263, 56267, 56269, 56299, 56311, 56333, 56359, 56369, 56377, 56383, 56393, 56401, 56417, 56431, 56437, 56443, 56453, 56467, 56473, 56477, 56479, 56489, 56501, 56503, 56509, 56519, 56527, 56531, 56533, 56543, 56569, 56591, 56597, 56599, 56611, 56629, 56633, 56659, 56663, 56671, 56681, 56687, 56701, 56711, 56713, 56731, 56737, 56747, 56767, 56773, 56779, 56783, 56807, 56809, 56813, 56821, 56827, 56843, 56857, 56873, 56891, 56893, 56897, 56909, 56911, 56921, 56923, 56929, 56941, 56951, 56957, 56963, 56983, 56989, 56993, 56999, 57037, 57041, 57047, 57059, 57073, 57077, 57089, 57097, 57107, 57119, 57131, 57139, 57143, 57149, 57163, 57173, 57179, 57191, 57193, 57203, 57221, 57223, 57241, 57251, 57259, 57269, 57271, 57283, 57287, 57301, 57329, 57331, 57347, 57349, 57367, 57373, 57383, 57389, 57397, 57413, 57427, 57457, 57467, 57487, 57493, 57503, 57527, 57529, 57557, 57559, 57571, 57587, 57593, 57601, 57637, 57641, 57649, 57653, 57667, 57679, 57689, 57697, 57709, 57713, 57719, 57727, 57731, 57737, 57751, 57773, 57781, 57787, 57791, 57793, 57803, 57809, 57829, 57839, 57847, 57853, 57859, 57881, 57899, 57901, 57917, 57923, 57943, 57947, 57973, 57977, 57991, 58013, 58027, 58031, 58043, 58049, 58057, 58061, 58067, 58073, 58099, 58109, 58111, 58129, 58147, 58151, 58153, 58169, 58171, 58189, 58193, 58199, 58207, 58211, 58217, 58229, 58231, 58237, 58243, 58271, 58309, 58313, 58321, 58337, 58363, 58367, 58369, 58379, 58391, 58393, 58403, 58411, 58417, 58427, 58439, 58441, 58451, 58453, 58477, 58481, 58511, 58537, 58543, 58549, 58567, 58573, 58579, 58601, 58603, 58613, 58631, 58657, 58661, 58679, 58687, 58693, 58699, 58711, 58727, 58733, 58741, 58757, 58763, 58771, 58787, 58789, 58831, 58889, 58897, 58901, 58907, 58909, 58913, 58921, 58937, 58943, 58963, 58967, 58979, 58991, 58997, 59009, 59011, 59021, 59023, 59029, 59051, 59053, 59063, 59069, 59077, 59083, 59093, 59107, 59113, 59119, 59123, 59141, 59149, 59159, 59167, 59183, 59197, 59207, 59209, 59219, 59221, 59233, 59239, 59243, 59263, 59273, 59281, 59333, 59341, 59351, 59357, 59359, 59369, 59377, 59387, 59393, 59399, 59407, 59417, 59419, 59441, 59443, 59447, 59453, 59467, 59471, 59473, 59497, 59509, 59513, 59539, 59557, 59561, 59567, 59581, 59611, 59617, 59621, 59627, 59629, 59651, 59659, 59663, 59669, 59671, 59693, 59699, 59707, 59723, 59729, 59743, 59747, 59753, 59771, 59779, 59791, 59797, 59809, 59833, 59863, 59879, 59887, 59921, 59929, 59951, 59957, 59971, 59981, 59999, 60013, 60017, 60029, 60037, 60041, 60077, 60083, 60089, 60091, 60101, 60103, 60107, 60127, 60133, 60139, 60149, 60161, 60167, 60169, 60209, 60217, 60223, 60251, 60257, 60259, 60271, 60289, 60293, 60317, 60331, 60337, 60343, 60353, 60373, 60383, 60397, 60413, 60427, 60443, 60449, 60457, 60493, 60497, 60509, 60521, 60527, 60539, 60589, 60601, 60607, 60611, 60617, 60623, 60631, 60637, 60647, 60649, 60659, 60661, 60679, 60689, 60703, 60719, 60727, 60733, 60737, 60757, 60761, 60763, 60773, 60779, 60793, 60811, 60821, 60859, 60869, 60887, 60889, 60899, 60901, 60913, 60917, 60919, 60923, 60937, 60943, 60953, 60961, 61001, 61007, 61027, 61031, 61043, 61051, 61057, 61091, 61099, 61121, 61129, 61141, 61151, 61153, 61169, 61211, 61223, 61231, 61253, 61261, 61283, 61291, 61297, 61331, 61333, 61339, 61343, 61357, 61363, 61379, 61381, 61403, 61409, 61417, 61441, 61463, 61469, 61471, 61483, 61487, 61493, 61507, 61511, 61519, 61543, 61547, 61553, 61559, 61561, 61583, 61603, 61609, 61613, 61627, 61631, 61637, 61643, 61651, 61657, 61667, 61673, 61681, 61687, 61703, 61717, 61723, 61729, 61751, 61757, 61781, 61813, 61819, 61837, 61843, 61861, 61871, 61879, 61909, 61927, 61933, 61949, 61961, 61967, 61979, 61981, 61987, 61991, 62003, 62011, 62017, 62039, 62047, 62053, 62057, 62071, 62081, 62099, 62119, 62129, 62131, 62137, 62141, 62143, 62171, 62189, 62191, 62201, 62207, 62213, 62219, 62233, 62273, 62297, 62299, 62303, 62311, 62323, 62327, 62347, 62351, 62383, 62401, 62417, 62423, 62459, 62467, 62473, 62477, 62483, 62497, 62501, 62507, 62533, 62539, 62549, 62563, 62581, 62591, 62597, 62603, 62617, 62627, 62633, 62639, 62653, 62659, 62683, 62687, 62701, 62723, 62731, 62743, 62753, 62761, 62773, 62791, 62801, 62819, 62827, 62851, 62861, 62869, 62873, 62897, 62903, 62921, 62927, 62929, 62939, 62969, 62971, 62981, 62983, 62987, 62989, 63029, 63031, 63059, 63067, 63073, 63079, 63097, 63103, 63113, 63127, 63131, 63149, 63179, 63197, 63199, 63211, 63241, 63247, 63277, 63281, 63299, 63311, 63313, 63317, 63331, 63337, 63347, 63353, 63361, 63367, 63377, 63389, 63391, 63397, 63409, 63419, 63421, 63439, 63443, 63463, 63467, 63473, 63487, 63493, 63499, 63521, 63527, 63533, 63541, 63559, 63577, 63587, 63589, 63599, 63601, 63607, 63611, 63617, 63629, 63647, 63649, 63659, 63667, 63671, 63689, 63691, 63697, 63703, 63709, 63719, 63727, 63737, 63743, 63761, 63773, 63781, 63793, 63799, 63803, 63809, 63823, 63839, 63841, 63853, 63857, 63863, 63901, 63907, 63913, 63929, 63949, 63977, 63997, 64007, 64013, 64019, 64033, 64037, 64063, 64067, 64081, 64091, 64109, 64123, 64151, 64153, 64157, 64171, 64187, 64189, 64217, 64223, 64231, 64237, 64271, 64279, 64283, 64301, 64303, 64319, 64327, 64333, 64373, 64381, 64399, 64403, 64433, 64439, 64451, 64453, 64483, 64489, 64499, 64513, 64553, 64567, 64577, 64579, 64591, 64601, 64609, 64613, 64621, 64627, 64633, 64661, 64663, 64667, 64679, 64693, 64709, 64717, 64747, 64763, 64781, 64783, 64793, 64811, 64817, 64849, 64853, 64871, 64877, 64879, 64891, 64901, 64919, 64921, 64927, 64937, 64951, 64969, 64997, 65003, 65011, 65027, 65029, 65033, 65053, 65063, 65071, 65089, 65099, 65101, 65111, 65119, 65123, 65129, 65141, 65147, 65167, 65171, 65173, 65179, 65183, 65203, 65213, 65239, 65257, 65267, 65269, 65287, 65293, 65309, 65323, 65327, 65353, 65357, 65371, 65381, 65393, 65407, 65413, 65419, 65423, 65437, 65447, 65449, 65479, 65497, 65519, 65521, 65537, 65539, 65543, 65551, 65557, 65563, 65579, 65581, 65587, 65599, 65609, 65617, 65629, 65633, 65647, 65651, 65657, 65677, 65687, 65699, 65701, 65707, 65713, 65717, 65719, 65729, 65731, 65761, 65777, 65789, 65809, 65827, 65831, 65837, 65839, 65843, 65851, 65867, 65881, 65899, 65921, 65927, 65929, 65951, 65957, 65963, 65981, 65983, 65993, 66029, 66037, 66041, 66047, 66067, 66071, 66083, 66089, 66103, 66107, 66109, 66137, 66161, 66169, 66173, 66179, 66191, 66221, 66239, 66271, 66293, 66301, 66337, 66343, 66347, 66359, 66361, 66373, 66377, 66383, 66403, 66413, 66431, 66449, 66457, 66463, 66467, 66491, 66499, 66509, 66523, 66529, 66533, 66541, 66553, 66569, 66571, 66587, 66593, 66601, 66617, 66629, 66643, 66653, 66683, 66697, 66701, 66713, 66721, 66733, 66739, 66749, 66751, 66763, 66791, 66797, 66809, 66821, 66841, 66851, 66853, 66863, 66877, 66883, 66889, 66919, 66923, 66931, 66943, 66947, 66949, 66959, 66973, 66977, 67003, 67021, 67033, 67043, 67049, 67057, 67061, 67073, 67079, 67103, 67121, 67129, 67139, 67141, 67153, 67157, 67169, 67181, 67187, 67189, 67211, 67213, 67217, 67219, 67231, 67247, 67261, 67271, 67273, 67289, 67307, 67339, 67343, 67349, 67369, 67391, 67399, 67409, 67411, 67421, 67427, 67429, 67433, 67447, 67453, 67477, 67481, 67489, 67493, 67499, 67511, 67523, 67531, 67537, 67547, 67559, 67567, 67577, 67579, 67589, 67601, 67607, 67619, 67631, 67651, 67679, 67699, 67709, 67723, 67733, 67741, 67751, 67757, 67759, 67763, 67777, 67783, 67789, 67801, 67807, 67819, 67829, 67843, 67853, 67867, 67883, 67891, 67901, 67927, 67931, 67933, 67939, 67943, 67957, 67961, 67967, 67979, 67987, 67993, 68023, 68041, 68053, 68059, 68071, 68087, 68099, 68111, 68113, 68141, 68147, 68161, 68171, 68207, 68209, 68213, 68219, 68227, 68239, 68261, 68279, 68281, 68311, 68329, 68351, 68371, 68389, 68399, 68437, 68443, 68447, 68449, 68473, 68477, 68483, 68489, 68491, 68501, 68507, 68521, 68531, 68539, 68543, 68567, 68581, 68597, 68611, 68633, 68639, 68659, 68669, 68683, 68687, 68699, 68711, 68713, 68729, 68737, 68743, 68749, 68767, 68771, 68777, 68791, 68813, 68819, 68821, 68863, 68879, 68881, 68891, 68897, 68899, 68903, 68909, 68917, 68927, 68947, 68963, 68993, 69001, 69011, 69019, 69029, 69031, 69061, 69067, 69073, 69109, 69119, 69127, 69143, 69149, 69151, 69163, 69191, 69193, 69197, 69203, 69221, 69233, 69239, 69247, 69257, 69259, 69263, 69313, 69317, 69337, 69341, 69371, 69379, 69383, 69389, 69401, 69403, 69427, 69431, 69439, 69457, 69463, 69467, 69473, 69481, 69491, 69493, 69497, 69499, 69539, 69557, 69593, 69623, 69653, 69661, 69677, 69691, 69697, 69709, 69737, 69739, 69761, 69763, 69767, 69779, 69809, 69821, 69827, 69829, 69833, 69847, 69857, 69859, 69877, 69899, 69911, 69929, 69931, 69941, 69959, 69991, 69997, 70001, 70003, 70009, 70019, 70039, 70051, 70061, 70067, 70079, 70099, 70111, 70117, 70121, 70123, 70139, 70141, 70157, 70163, 70177, 70181, 70183, 70199, 70201, 70207, 70223, 70229, 70237, 70241, 70249, 70271, 70289, 70297, 70309, 70313, 70321, 70327, 70351, 70373, 70379, 70381, 70393, 70423, 70429, 70439, 70451, 70457, 70459, 70481, 70487, 70489, 70501, 70507, 70529, 70537, 70549, 70571, 70573, 70583, 70589, 70607, 70619, 70621, 70627, 70639, 70657, 70663, 70667, 70687, 70709, 70717, 70729, 70753, 70769, 70783, 70793, 70823, 70841, 70843, 70849, 70853, 70867, 70877, 70879, 70891, 70901, 70913, 70919, 70921, 70937, 70949, 70951, 70957, 70969, 70979, 70981, 70991, 70997, 70999, 71011, 71023, 71039, 71059, 71069, 71081, 71089, 71119, 71129, 71143, 71147, 71153, 71161, 71167, 71171, 71191, 71209, 71233, 71237, 71249, 71257, 71261, 71263, 71287, 71293, 71317, 71327, 71329, 71333, 71339, 71341, 71347, 71353, 71359, 71363, 71387, 71389, 71399, 71411, 71413, 71419, 71429, 71437, 71443, 71453, 71471, 71473, 71479, 71483, 71503, 71527, 71537, 71549, 71551, 71563, 71569, 71593, 71597, 71633, 71647, 71663, 71671, 71693, 71699, 71707, 71711, 71713, 71719, 71741, 71761, 71777, 71789, 71807, 71809, 71821, 71837, 71843, 71849, 71861, 71867, 71879, 71881, 71887, 71899, 71909, 71917, 71933, 71941, 71947, 71963, 71971, 71983, 71987, 71993, 71999, 72019, 72031, 72043, 72047, 72053, 72073, 72077, 72089, 72091, 72101, 72103, 72109, 72139, 72161, 72167, 72169, 72173, 72211, 72221, 72223, 72227, 72229, 72251, 72253, 72269, 72271, 72277, 72287, 72307, 72313, 72337, 72341, 72353, 72367, 72379, 72383, 72421, 72431, 72461, 72467, 72469, 72481, 72493, 72497, 72503, 72533, 72547, 72551, 72559, 72577, 72613, 72617, 72623, 72643, 72647, 72649, 72661, 72671, 72673, 72679, 72689, 72701, 72707, 72719, 72727, 72733, 72739, 72763, 72767, 72797, 72817, 72823, 72859, 72869, 72871, 72883, 72889, 72893, 72901, 72907, 72911, 72923, 72931, 72937, 72949, 72953, 72959, 72973, 72977, 72997, 73009, 73013, 73019, 73037, 73039, 73043, 73061, 73063, 73079, 73091, 73121, 73127, 73133, 73141, 73181, 73189, 73237, 73243, 73259, 73277, 73291, 73303, 73309, 73327, 73331, 73351, 73361, 73363, 73369, 73379, 73387, 73417, 73421, 73433, 73453, 73459, 73471, 73477, 73483, 73517, 73523, 73529, 73547, 73553, 73561, 73571, 73583, 73589, 73597, 73607, 73609, 73613, 73637, 73643, 73651, 73673, 73679, 73681, 73693, 73699, 73709, 73721, 73727, 73751, 73757, 73771, 73783, 73819, 73823, 73847, 73849, 73859, 73867, 73877, 73883, 73897, 73907, 73939, 73943, 73951, 73961, 73973, 73999, 74017, 74021, 74027, 74047, 74051, 74071, 74077, 74093, 74099, 74101, 74131, 74143, 74149, 74159, 74161, 74167, 74177, 74189, 74197, 74201, 74203, 74209, 74219, 74231, 74257, 74279, 74287, 74293, 74297, 74311, 74317, 74323, 74353, 74357, 74363, 74377, 74381, 74383, 74411, 74413, 74419, 74441, 74449, 74453, 74471, 74489, 74507, 74509, 74521, 74527, 74531, 74551, 74561, 74567, 74573, 74587, 74597, 74609, 74611, 74623, 74653, 74687, 74699, 74707, 74713, 74717, 74719, 74729, 74731, 74747, 74759, 74761, 74771, 74779, 74797, 74821, 74827, 74831, 74843, 74857, 74861, 74869, 74873, 74887, 74891, 74897, 74903, 74923, 74929, 74933, 74941, 74959, 75011, 75013, 75017, 75029, 75037, 75041, 75079, 75083, 75109, 75133, 75149, 75161, 75167, 75169, 75181, 75193, 75209, 75211, 75217, 75223, 75227, 75239, 75253, 75269, 75277, 75289, 75307, 75323, 75329, 75337, 75347, 75353, 75367, 75377, 75389, 75391, 75401, 75403, 75407, 75431, 75437, 75479, 75503, 75511, 75521, 75527, 75533, 75539, 75541, 75553, 75557, 75571, 75577, 75583, 75611, 75617, 75619, 75629, 75641, 75653, 75659, 75679, 75683, 75689, 75703, 75707, 75709, 75721, 75731, 75743, 75767, 75773, 75781, 75787, 75793, 75797, 75821, 75833, 75853, 75869, 75883, 75913, 75931, 75937, 75941, 75967, 75979, 75983, 75989, 75991, 75997, 76001, 76003, 76031, 76039, 76079, 76081, 76091, 76099, 76103, 76123, 76129, 76147, 76157, 76159, 76163, 76207, 76213, 76231, 76243, 76249, 76253, 76259, 76261, 76283, 76289, 76303, 76333, 76343, 76367, 76369, 76379, 76387, 76403, 76421, 76423, 76441, 76463, 76471, 76481, 76487, 76493, 76507, 76511, 76519, 76537, 76541, 76543, 76561, 76579, 76597, 76603, 76607, 76631, 76649, 76651, 76667, 76673, 76679, 76697, 76717, 76733, 76753, 76757, 76771, 76777, 76781, 76801, 76819, 76829, 76831, 76837, 76847, 76871, 76873, 76883, 76907, 76913, 76919, 76943, 76949, 76961, 76963, 76991, 77003, 77017, 77023, 77029, 77041, 77047, 77069, 77081, 77093, 77101, 77137, 77141, 77153, 77167, 77171, 77191, 77201, 77213, 77237, 77239, 77243, 77249, 77261, 77263, 77267, 77269, 77279, 77291, 77317, 77323, 77339, 77347, 77351, 77359, 77369, 77377, 77383, 77417, 77419, 77431, 77447, 77471, 77477, 77479, 77489, 77491, 77509, 77513, 77521, 77527, 77543, 77549, 77551, 77557, 77563, 77569, 77573, 77587, 77591, 77611, 77617, 77621, 77641, 77647, 77659, 77681, 77687, 77689, 77699, 77711, 77713, 77719, 77723, 77731, 77743, 77747, 77761, 77773, 77783, 77797, 77801, 77813, 77839, 77849, 77863, 77867, 77893, 77899, 77929, 77933, 77951, 77969, 77977, 77983, 77999, 78007, 78017, 78031, 78041, 78049, 78059, 78079, 78101, 78121, 78137, 78139, 78157, 78163, 78167, 78173, 78179, 78191, 78193, 78203, 78229, 78233, 78241, 78259, 78277, 78283, 78301, 78307, 78311, 78317, 78341, 78347, 78367, 78401, 78427, 78437, 78439, 78467, 78479, 78487, 78497, 78509, 78511, 78517, 78539, 78541, 78553, 78569, 78571, 78577, 78583, 78593, 78607, 78623, 78643, 78649, 78653, 78691, 78697, 78707, 78713, 78721, 78737, 78779, 78781, 78787, 78791, 78797, 78803, 78809, 78823, 78839, 78853, 78857, 78877, 78887, 78889, 78893, 78901, 78919, 78929, 78941, 78977, 78979, 78989, 79031, 79039, 79043, 79063, 79087, 79103, 79111, 79133, 79139, 79147, 79151, 79153, 79159, 79181, 79187, 79193, 79201, 79229, 79231, 79241, 79259, 79273, 79279, 79283, 79301, 79309, 79319, 79333, 79337, 79349, 79357, 79367, 79379, 79393, 79397, 79399, 79411, 79423, 79427, 79433, 79451, 79481, 79493, 79531, 79537, 79549, 79559, 79561, 79579, 79589, 79601, 79609, 79613, 79621, 79627, 79631, 79633, 79657, 79669, 79687, 79691, 79693, 79697, 79699, 79757, 79769, 79777, 79801, 79811, 79813, 79817, 79823, 79829, 79841, 79843, 79847, 79861, 79867, 79873, 79889, 79901, 79903, 79907, 79939, 79943, 79967, 79973, 79979, 79987, 79997, 79999, 80021, 80039, 80051, 80071, 80077, 80107, 80111, 80141, 80147, 80149, 80153, 80167, 80173, 80177, 80191, 80207, 80209, 80221, 80231, 80233, 80239, 80251, 80263, 80273, 80279, 80287, 80309, 80317, 80329, 80341, 80347, 80363, 80369, 80387, 80407, 80429, 80447, 80449, 80471, 80473, 80489, 80491, 80513, 80527, 80537, 80557, 80567, 80599, 80603, 80611, 80621, 80627, 80629, 80651, 80657, 80669, 80671, 80677, 80681, 80683, 80687, 80701, 80713, 80737, 80747, 80749, 80761, 80777, 80779, 80783, 80789, 80803, 80809, 80819, 80831, 80833, 80849, 80863, 80897, 80909, 80911, 80917, 80923, 80929, 80933, 80953, 80963, 80989, 81001, 81013, 81017, 81019, 81023, 81031, 81041, 81043, 81047, 81049, 81071, 81077, 81083, 81097, 81101, 81119, 81131, 81157, 81163, 81173, 81181, 81197, 81199, 81203, 81223, 81233, 81239, 81281, 81283, 81293, 81299, 81307, 81331, 81343, 81349, 81353, 81359, 81371, 81373, 81401, 81409, 81421, 81439, 81457, 81463, 81509, 81517, 81527, 81533, 81547, 81551, 81553, 81559, 81563, 81569, 81611, 81619, 81629, 81637, 81647, 81649, 81667, 81671, 81677, 81689, 81701, 81703, 81707, 81727, 81737, 81749, 81761, 81769, 81773, 81799, 81817, 81839, 81847, 81853, 81869, 81883, 81899, 81901, 81919, 81929, 81931, 81937, 81943, 81953, 81967, 81971, 81973, 82003, 82007, 82009, 82013, 82021, 82031, 82037, 82039, 82051, 82067, 82073, 82129, 82139, 82141, 82153, 82163, 82171, 82183, 82189, 82193, 82207, 82217, 82219, 82223, 82231, 82237, 82241, 82261, 82267, 82279, 82301, 82307, 82339, 82349, 82351, 82361, 82373, 82387, 82393, 82421, 82457, 82463, 82469, 82471, 82483, 82487, 82493, 82499, 82507, 82529, 82531, 82549, 82559, 82561, 82567, 82571, 82591, 82601, 82609, 82613, 82619, 82633, 82651, 82657, 82699, 82721, 82723, 82727, 82729, 82757, 82759, 82763, 82781, 82787, 82793, 82799, 82811, 82813, 82837, 82847, 82883, 82889, 82891, 82903, 82913, 82939, 82963, 82981, 82997, 83003, 83009, 83023, 83047, 83059, 83063, 83071, 83077, 83089, 83093, 83101, 83117, 83137, 83177, 83203, 83207, 83219, 83221, 83227, 83231, 83233, 83243, 83257, 83267, 83269, 83273, 83299, 83311, 83339, 83341, 83357, 83383, 83389, 83399, 83401, 83407, 83417, 83423, 83431, 83437, 83443, 83449, 83459, 83471, 83477, 83497, 83537, 83557, 83561, 83563, 83579, 83591, 83597, 83609, 83617, 83621, 83639, 83641, 83653, 83663, 83689, 83701, 83717, 83719, 83737, 83761, 83773, 83777, 83791, 83813, 83833, 83843, 83857, 83869, 83873, 83891, 83903, 83911, 83921, 83933, 83939, 83969, 83983, 83987, 84011, 84017, 84047, 84053, 84059, 84061, 84067, 84089, 84121, 84127, 84131, 84137, 84143, 84163, 84179, 84181, 84191, 84199, 84211, 84221, 84223, 84229, 84239, 84247, 84263, 84299, 84307, 84313, 84317, 84319, 84347, 84349, 84377, 84389, 84391, 84401, 84407, 84421, 84431, 84437, 84443, 84449, 84457, 84463, 84467, 84481, 84499, 84503, 84509, 84521, 84523, 84533, 84551, 84559, 84589, 84629, 84631, 84649, 84653, 84659, 84673, 84691, 84697, 84701, 84713, 84719, 84731, 84737, 84751, 84761, 84787, 84793, 84809, 84811, 84827, 84857, 84859, 84869, 84871, 84913, 84919, 84947, 84961, 84967, 84977, 84979, 84991, 85009, 85021, 85027, 85037, 85049, 85061, 85081, 85087, 85091, 85093, 85103, 85109, 85121, 85133, 85147, 85159, 85193, 85199, 85201, 85213, 85223, 85229, 85237, 85243, 85247, 85259, 85297, 85303, 85313, 85331, 85333, 85361, 85363, 85369, 85381, 85411, 85427, 85429, 85439, 85447, 85451, 85453, 85469, 85487, 85513, 85517, 85523, 85531, 85549, 85571, 85577, 85597, 85601, 85607, 85619, 85621, 85627, 85639, 85643, 85661, 85667, 85669, 85691, 85703, 85711, 85717, 85733, 85751, 85781, 85793, 85817, 85819, 85829, 85831, 85837, 85843, 85847, 85853, 85889, 85903, 85909, 85931, 85933, 85991, 85999, 86011, 86017, 86027, 86029, 86069, 86077, 86083, 86111, 86113, 86117, 86131, 86137, 86143, 86161, 86171, 86179, 86183, 86197, 86201, 86209, 86239, 86243, 86249, 86257, 86263, 86269, 86287, 86291, 86293, 86297, 86311, 86323, 86341, 86351, 86353, 86357, 86369, 86371, 86381, 86389, 86399, 86413, 86423, 86441, 86453, 86461, 86467, 86477, 86491, 86501, 86509, 86531, 86533, 86539, 86561, 86573, 86579, 86587, 86599, 86627, 86629, 86677, 86689, 86693, 86711, 86719, 86729, 86743, 86753, 86767, 86771, 86783, 86813, 86837, 86843, 86851, 86857, 86861, 86869, 86923, 86927, 86929, 86939, 86951, 86959, 86969, 86981, 86993, 87011, 87013, 87037, 87041, 87049, 87071, 87083, 87103, 87107, 87119, 87121, 87133, 87149, 87151, 87179, 87181, 87187, 87211, 87221, 87223, 87251, 87253, 87257, 87277, 87281, 87293, 87299, 87313, 87317, 87323, 87337, 87359, 87383, 87403, 87407, 87421, 87427, 87433, 87443, 87473, 87481, 87491, 87509, 87511, 87517, 87523, 87539, 87541, 87547, 87553, 87557, 87559, 87583, 87587, 87589, 87613, 87623, 87629, 87631, 87641, 87643, 87649, 87671, 87679, 87683, 87691, 87697, 87701, 87719, 87721, 87739, 87743, 87751, 87767, 87793, 87797, 87803, 87811, 87833, 87853, 87869, 87877, 87881, 87887, 87911, 87917, 87931, 87943, 87959, 87961, 87973, 87977, 87991, 88001, 88003, 88007, 88019, 88037, 88069, 88079, 88093, 88117, 88129, 88169, 88177, 88211, 88223, 88237, 88241, 88259, 88261, 88289, 88301, 88321, 88327, 88337, 88339, 88379, 88397, 88411, 88423, 88427, 88463, 88469, 88471, 88493, 88499, 88513, 88523, 88547, 88589, 88591, 88607, 88609, 88643, 88651, 88657, 88661, 88663, 88667, 88681, 88721, 88729, 88741, 88747, 88771, 88789, 88793, 88799, 88801, 88807, 88811, 88813, 88817, 88819, 88843, 88853, 88861, 88867, 88873, 88883, 88897, 88903, 88919, 88937, 88951, 88969, 88993, 88997, 89003, 89009, 89017, 89021, 89041, 89051, 89057, 89069, 89071, 89083, 89087, 89101, 89107, 89113, 89119, 89123, 89137, 89153, 89189, 89203, 89209, 89213, 89227, 89231, 89237, 89261, 89269, 89273, 89293, 89303, 89317, 89329, 89363, 89371, 89381, 89387, 89393, 89399, 89413, 89417, 89431, 89443, 89449, 89459, 89477, 89491, 89501, 89513, 89519, 89521, 89527, 89533, 89561, 89563, 89567, 89591, 89597, 89599, 89603, 89611, 89627, 89633, 89653, 89657, 89659, 89669, 89671, 89681, 89689, 89753, 89759, 89767, 89779, 89783, 89797, 89809, 89819, 89821, 89833, 89839, 89849, 89867, 89891, 89897, 89899, 89909, 89917, 89923, 89939, 89959, 89963, 89977, 89983, 89989, 90001, 90007, 90011, 90017, 90019, 90023, 90031, 90053, 90059, 90067, 90071, 90073, 90089, 90107, 90121, 90127, 90149, 90163, 90173, 90187, 90191, 90197, 90199, 90203, 90217, 90227, 90239, 90247, 90263, 90271, 90281, 90289, 90313, 90353, 90359, 90371, 90373, 90379, 90397, 90401, 90403, 90407, 90437, 90439, 90469, 90473, 90481, 90499, 90511, 90523, 90527, 90529, 90533, 90547, 90583, 90599, 90617, 90619, 90631, 90641, 90647, 90659, 90677, 90679, 90697, 90703, 90709, 90731, 90749, 90787, 90793, 90803, 90821, 90823, 90833, 90841, 90847, 90863, 90887, 90901, 90907, 90911, 90917, 90931, 90947, 90971, 90977, 90989, 90997, 91009, 91019, 91033, 91079, 91081, 91097, 91099, 91121, 91127, 91129, 91139, 91141, 91151, 91153, 91159, 91163, 91183, 91193, 91199, 91229, 91237, 91243, 91249, 91253, 91283, 91291, 91297, 91303, 91309, 91331, 91367, 91369, 91373, 91381, 91387, 91393, 91397, 91411, 91423, 91433, 91453, 91457, 91459, 91463, 91493, 91499, 91513, 91529, 91541, 91571, 91573, 91577, 91583, 91591, 91621, 91631, 91639, 91673, 91691, 91703, 91711, 91733, 91753, 91757, 91771, 91781, 91801, 91807, 91811, 91813, 91823, 91837, 91841, 91867, 91873, 91909, 91921, 91939, 91943, 91951, 91957, 91961, 91967, 91969, 91997, 92003, 92009, 92033, 92041, 92051, 92077, 92083, 92107, 92111, 92119, 92143, 92153, 92173, 92177, 92179, 92189, 92203, 92219, 92221, 92227, 92233, 92237, 92243, 92251, 92269, 92297, 92311, 92317, 92333, 92347, 92353, 92357, 92363, 92369, 92377, 92381, 92383, 92387, 92399, 92401, 92413, 92419, 92431, 92459, 92461, 92467, 92479, 92489, 92503, 92507, 92551, 92557, 92567, 92569, 92581, 92593, 92623, 92627, 92639, 92641, 92647, 92657, 92669, 92671, 92681, 92683, 92693, 92699, 92707, 92717, 92723, 92737, 92753, 92761, 92767, 92779, 92789, 92791, 92801, 92809, 92821, 92831, 92849, 92857, 92861, 92863, 92867, 92893, 92899, 92921, 92927, 92941, 92951, 92957, 92959, 92987, 92993, 93001, 93047, 93053, 93059, 93077, 93083, 93089, 93097, 93103, 93113, 93131, 93133, 93139, 93151, 93169, 93179, 93187, 93199, 93229, 93239, 93241, 93251, 93253, 93257, 93263, 93281, 93283, 93287, 93307, 93319, 93323, 93329, 93337, 93371, 93377, 93383, 93407, 93419, 93427, 93463, 93479, 93481, 93487, 93491, 93493, 93497, 93503, 93523, 93529, 93553, 93557, 93559, 93563, 93581, 93601, 93607, 93629, 93637, 93683, 93701, 93703, 93719, 93739, 93761, 93763, 93787, 93809, 93811, 93827, 93851, 93871, 93887, 93889, 93893, 93901, 93911, 93913, 93923, 93937, 93941, 93949, 93967, 93971, 93979, 93983, 93997, 94007, 94009, 94033, 94049, 94057, 94063, 94079, 94099, 94109, 94111, 94117, 94121, 94151, 94153, 94169, 94201, 94207, 94219, 94229, 94253, 94261, 94273, 94291, 94307, 94309, 94321, 94327, 94331, 94343, 94349, 94351, 94379, 94397, 94399, 94421, 94427, 94433, 94439, 94441, 94447, 94463, 94477, 94483, 94513, 94529, 94531, 94541, 94543, 94547, 94559, 94561, 94573, 94583, 94597, 94603, 94613, 94621, 94649, 94651, 94687, 94693, 94709, 94723, 94727, 94747, 94771, 94777, 94781, 94789, 94793, 94811, 94819, 94823, 94837, 94841, 94847, 94849, 94873, 94889, 94903, 94907, 94933, 94949, 94951, 94961, 94993, 94999, 95003, 95009, 95021, 95027, 95063, 95071, 95083, 95087, 95089, 95093, 95101, 95107, 95111, 95131, 95143, 95153, 95177, 95189, 95191, 95203, 95213, 95219, 95231, 95233, 95239, 95257, 95261, 95267, 95273, 95279, 95287, 95311, 95317, 95327, 95339, 95369, 95383, 95393, 95401, 95413, 95419, 95429, 95441, 95443, 95461, 95467, 95471, 95479, 95483, 95507, 95527, 95531, 95539, 95549, 95561, 95569, 95581, 95597, 95603, 95617, 95621, 95629, 95633, 95651, 95701, 95707, 95713, 95717, 95723, 95731, 95737, 95747, 95773, 95783, 95789, 95791, 95801, 95803, 95813, 95819, 95857, 95869, 95873, 95881, 95891, 95911, 95917, 95923, 95929, 95947, 95957, 95959, 95971, 95987, 95989, 96001, 96013, 96017, 96043, 96053, 96059, 96079, 96097, 96137, 96149, 96157, 96167, 96179, 96181, 96199, 96211, 96221, 96223, 96233, 96259, 96263, 96269, 96281, 96289, 96293, 96323, 96329, 96331, 96337, 96353, 96377, 96401, 96419, 96431, 96443, 96451, 96457, 96461, 96469, 96479, 96487, 96493, 96497, 96517, 96527, 96553, 96557, 96581, 96587, 96589, 96601, 96643, 96661, 96667, 96671, 96697, 96703, 96731, 96737, 96739, 96749, 96757, 96763, 96769, 96779, 96787, 96797, 96799, 96821, 96823, 96827, 96847, 96851, 96857, 96893, 96907, 96911, 96931, 96953, 96959, 96973, 96979, 96989, 96997, 97001, 97003, 97007, 97021, 97039, 97073, 97081, 97103, 97117, 97127, 97151, 97157, 97159, 97169, 97171, 97177, 97187, 97213, 97231, 97241, 97259, 97283, 97301, 97303, 97327, 97367, 97369, 97373, 97379, 97381, 97387, 97397, 97423, 97429, 97441, 97453, 97459, 97463, 97499, 97501, 97511, 97523, 97547, 97549, 97553, 97561, 97571, 97577, 97579, 97583, 97607, 97609, 97613, 97649, 97651, 97673, 97687, 97711, 97729, 97771, 97777, 97787, 97789, 97813, 97829, 97841, 97843, 97847, 97849, 97859, 97861, 97871, 97879, 97883, 97919, 97927, 97931, 97943, 97961, 97967, 97973, 97987, 98009, 98011, 98017, 98041, 98047, 98057, 98081, 98101, 98123, 98129, 98143, 98179, 98207, 98213, 98221, 98227, 98251, 98257, 98269, 98297, 98299, 98317, 98321, 98323, 98327, 98347, 98369, 98377, 98387, 98389, 98407, 98411, 98419, 98429, 98443, 98453, 98459, 98467, 98473, 98479, 98491, 98507, 98519, 98533, 98543, 98561, 98563, 98573, 98597, 98621, 98627, 98639, 98641, 98663, 98669, 98689, 98711, 98713, 98717, 98729, 98731, 98737, 98773, 98779, 98801, 98807, 98809, 98837, 98849, 98867, 98869, 98873, 98887, 98893, 98897, 98899, 98909, 98911, 98927, 98929, 98939, 98947, 98953, 98963]
		broken = 0
		for divisor in lst:
			if n % divisor == 0:
				print(n // divisor, n - n // divisor)
				broken = 1
				break
		if not broken:
			print(1, n - 1)


def min_nok(n):
	if n % 2 == 0:
		return f'{n // 2} {n // 2}'
	i = 3
	while i * i <= n:
		if n % i == 0:
			return f'{n // i} {n - n // i}'
		i += 1
	return f'1 {n - 1}'
res = []
for _ in range(int(input())):
	res.append(min_nok(int(input())))
print('\n'.join(res))


import math
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
		continue
	else:
		i = 1
		lis = []
		while i <= math.sqrt(n):
			if n % i == 0:
				if n / i == i:
					lis.append(i)
				else:
					lis.append(i)
					lis.append(n / i)
			i += 1
	lis.sort()
	p = len(lis)
	if p == 2:
		print(1, n - 1)
	else:
		print(int(lis[p - 2]), int(n - lis[p - 2]))


def solve(t):
	if not t:
		return
	n = int(input())
	i = 2
	k = -1
	while i * i <= n:
		if not n % i:
			k = i
			break
		i += 1
	if k == -1:
		k = n
	print('%d %d' % (n / k, n - n / k))
	solve(t - 1)
tests = int(input())
solve(tests)


from math import sqrt
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		fst = 1
		scnd = n - 1
		i = int(sqrt(n))
		carry = 3
		while carry <= i:
			if n % carry == 0:
				fst = n // carry
				scnd = n - fst
				break
			carry = carry + 2
		print(fst, scnd)


def first_div(n):
	d = 2
	while n % d != 0 and d * d <= n:
		d += 1
	if n % d == 0:
		return d
	else:
		return n
for _ in range(int(input())):
	n = int(input())
	d = first_div(n)
	print(n // d, n - n // d)


from sys import stdin, stdout
cin = stdin.readline
cout = stdout.write
mp = lambda : list(map(int, cin().split()))

def isPrime(x):
	y = int(x ** 0.5) + 1
	for i in range(2, y):
		if not x % i:
			return x // i
	return 1
(t,) = mp()
for _ in range(t):
	(n,) = mp()
	if not n % 2:
		cout(str(n // 2) + ' ' + str(n // 2) + '\n')
	else:
		f = isPrime(n)
		if f == 1:
			cout('1 ' + str(n - 1) + '\n')
		else:
			cout(str(f) + ' ' + str(n - f) + '\n')


from math import sqrt

def check_prime(n):
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True

def highest_factor(n):
	for i in range(3, int(sqrt(n)) + 1, 2):
		if n % i == 0:
			return n // i
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif check_prime(n):
		print(1, n - 1)
	else:
		k = highest_factor(n)
		print(k, n - k)


from collections import defaultdict

def make_divisors(n):
	(lower_divisors, upper_divisors) = ([], [])
	i = 1
	while i * i <= n:
		if n % i == 0:
			lower_divisors.append(i)
			if i != n // i:
				upper_divisors.append(n // i)
		i += 1
	return lower_divisors + upper_divisors[::-1]
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		divisors = make_divisors(n)
		a = divisors[-2]
		print(a, n - a)


R1 = lambda : list(map(int, input().split()))
R2 = lambda : int(input())
for _ in range(R2()):
	n = R2()
	i = 2
	while i * i <= n and n % i:
		i += 1
	if i * i < n + 1:
		print(n // i, n - n // i)
	else:
		print(1, n - 1)


import math

def primeFactors(n):
	while n % 2 == 0:
		l.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n // i
	if n > 2:
		l.append(n)
x = int(input())
for i in range(x):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, end=' ')
		print(n // 2)
	else:
		l = []
		primeFactors(n)
		if len(l) == 1:
			print(1, end=' ')
			print(n - 1)
		else:
			print(n // min(l), end=' ')
			print(n - n // min(l))


from math import sqrt
for _ in range(int(input())):
	n = int(input())
	x = 1
	k = n - 1
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			x = n // i
			k = i - 1
			break
	print(x, k * x)


import math
t = int(input())
Maxn = 210000
while t > 0:
	t -= 1
	n = int(input())
	flag = 0
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			flag = int(n - n / i)
			break
	if flag == 0:
		print(1, n - 1)
	else:
		print(n - flag, flag)


from math import sqrt, floor

def f(ele):
	res = -1
	for i in range(2, floor(sqrt(ele)) + 1):
		if ele % i == 0:
			res = ele // i
			break
	if res != -1:
		res *= f(ele // res)
		return res
	return ele - 1
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
		continue
	ans = f(n)
	print(ans, n - ans)


t = int(input())
from math import sqrt
for case in range(t):
	n = int(input())
	factors = set()
	best = float('inf')
	(p, q) = (None, None)
	for i in range(1, min(n + 1, int(sqrt(n) + 2))):
		if n % i == 0:
			factors.add(i)
			factors.add(n // i)
	for factor in factors:
		a = factor
		b = n - factor
		if not 1 <= a <= n:
			continue
		if not 1 <= b <= n:
			continue
		lcm = max(a, b)
		if lcm < best:
			p = a
			q = b
			best = lcm
	print(p, q)


from math import sqrt
import sys

def inlt():
	input = sys.stdin.readlines
	return list(map(int, input()))

class Test:

	def __init__(self, test):
		test = list(map(int, test))
		self.n_numbers = test[0]
		assert 0 < self.n_numbers <= 10
		self.numbers = test[1:]

class SmallestDivisor:

	@staticmethod
	def find(n):
		if n % 2 == 0:
			return 2
		else:
			sn = int(sqrt(n)) + 1
			for i in range(3, sn, 2):
				if n % i == 0:
					return i
			return n

class AB:

	@staticmethod
	def find(n):
		n_sd = SmallestDivisor.find(n)
		y = n / n_sd
		a = y
		b = y * (n_sd - 1)
		return (int(a), int(b))
test = Test(inlt())
for num in test.numbers:
	(a, b) = AB.find(num)
	print(a, b, sep=' ')


from math import sqrt
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(f'{n // 2} {n // 2}')
	else:
		sqrtn = int(sqrt(n))
		divisors = set()
		for i in range(2, sqrtn + 1):
			if n % i == 0:
				divisors.add(i)
				divisors.add(n // i)
		divisors = list(divisors)
		divisors.sort(reverse=True)
		if len(divisors) == 0:
			print(f'{1} {n - 1}')
		else:
			print(f'{divisors[0]} {n - divisors[0]}')


for j in range(int(input())):
	a = int(input())
	if a % 2 == 0:
		print(a // 2, a // 2)
	else:
		i = 3
		while i * i <= a:
			if a % i == 0:
				print(a // i, a - a // i)
				break
			i += 2
		else:
			print(1, a - 1)


t = int(input())

def make_divisors(n):
	divisors = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			divisors.append(i)
			if i != n // i:
				divisors.append(n // i)
	return divisors
import math
from functools import reduce

def lcm_base(x, y):
	return x * y // math.gcd(x, y)

def lcm_list(numbers):
	return reduce(lcm_base, numbers, 1)
for _ in range(t):
	n = int(input())
	d = make_divisors(n)
	m = 10 ** 18
	ans = -1
	for i in d:
		if i == 1:
			continue
		a = n // i
		b = n - a
		l = lcm_base(a, b)
		if l <= m:
			m = l
			ans = (a, b)
	print(*ans)


def make_divisors(n):
	divisors = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			divisors.append(i)
			if i != n // i:
				divisors.append(n // i)
	return divisors
for _ in range(int(input())):
	import math

	def lcm(x, y):
		return x * y // math.gcd(x, y)
	n = int(input())
	l = make_divisors(n)
	l.sort()
	divcnt = n // l[1]
	print(divcnt, n - divcnt)


from functools import reduce

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def sol():
	n = int(input())
	f = list(factors(n))
	m = 999999999999999
	for i in range(len(f)):
		if f[i] < m and f[i] != 1:
			m = f[i]
	if m == 1:
		print(n - 1, 1)
	else:
		print(n // m * (m - 1), n // m)
for _ in range(int(input())):
	sol()


import sys
import math as m

def fi():
	return sys.stdin.readline()
for _ in range(int(fi())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		ans = 1
		i = 2
		while i * i <= n:
			if n % i == 0:
				ans = n // i
				break
			i += 1
		print(ans, n - ans)


t = int(input())
for i in range(t):
	n = int(input())
	a = 1
	b = n - 1
	for i in range(2, int(n ** 0.5) + 2):
		if n % i == 0:
			d = i - 1
			e = 1
			c = n // i
			a = d * c
			b = e * c
			break
	print(a, b)


for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		found = False
		for i in range(3, 100000, 2):
			if n % i == 0:
				found = True
				print(n // i, n - n // i)
				break
		if not found:
			print(n - 1, 1)


from math import gcd

def lcm(a, b):
	return a * b // gcd(a, b)
for _ in range(int(input())):
	n = int(input())
	if n & 1 == 0:
		print(n // 2, n // 2)
	else:
		factors = set()
		i = 1
		while i * i <= n:
			if n % i == 0:
				factors.add(i)
				factors.add(n // i)
			i += 1
		(a, b, l) = (0, 0, float('inf'))
		for f in factors:
			(x, y) = (f, n - f)
			z = lcm(x, y)
			if l > z and x and y:
				(a, b, l) = (x, y, z)
		print(a, b)


t = int(input())

def siege(h):
	pr = [True] * (h + 1)
	pr[0] = False
	pr[1] = False
	for i in range(2, h):
		if pr[i]:
			j = 2
			while i * j <= h:
				pr[i * j] = False
				j += 1
	primes = []
	for i in range(h + 1):
		if pr[i]:
			primes.append(i)
	return primes
primes = siege(10 ** 5)
for _ in range(t):
	n = int(input())
	find = False
	for p in primes:
		if n % p == 0:
			find = True
			break
	if find:
		print(n // p, n - n // p)
	else:
		print(1, n - 1)


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

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

def I():
	return int(input())
for _ in range(I()):
	n = I()
	j = 0
	for i in range(2, int(n ** 0.5) + 2):
		if n % i == 0:
			j = 1
			break
	if j == 0:
		i = n
	d = n // i
	print(d, d * (i - 1))


for i in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		j = 3
		x = 1
		while j ** 2 <= n and n > 1:
			if n % j == 0:
				x = j
				break
			j += 1
		if x == 1:
			k = 1
		else:
			k = n // x
		print(k, n - k)


import math

def perfect(n):
	k = int(math.sqrt(n))
	for i in range(2, k + 1):
		if n % i == 0:
			return n // i
	return 1
for _ in range(int(input())):
	n = int(input())
	k = perfect(n)
	print(k, n - k)


T = int(input())

def spf(n):
	for i in range(2, int(n ** 0.5) + 2):
		if n % i == 0:
			return i
	return n
for i in range(T):
	n = int(input())
	s = spf(n)
	print(n // s, (s - 1) * n // s)


import math
for _ in range(int(input())):
	n = int(input())

	def factors(n):
		return set((x for tup in ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0) for x in tup))
	x = factors(n)
	x.remove(n)
	p = max(x)
	print(p, n - p)


import math
T = int(input())
for t in range(T):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		for i in range(3, int(math.sqrt(n)) + 1):
			if n % i == 0:
				break
		else:
			print(1, n - 1)
			continue
		counter = n // i
		print((i - 1) * counter, counter)


import math
n = int(input())
for j in range(n):
	n1 = int(input())
	if n1 == 2:
		print(1, 1)
		continue
	for i in range(2, int(math.sqrt(n1)) + 1):
		if n1 % i == 0:
			print(n1 // i, n1 - n1 // i, end=' ')
			break
		if i == int(math.sqrt(n1)):
			print(1, n1 - 1, end='')
	print('')


T = int(input())

def findFirstDiv(n):
	c = int(pow(n, 0.5))
	for i in range(2, c + 1):
		if n % i == 0:
			return i
	return 1

def solve(n):
	bb = findFirstDiv(n)
	a = n // bb
	b = a * (bb - 1)
	if bb == 1:
		a = n - 1
		b = 1
	return (a, b)

def solve_naive(n):
	(i, j) = (int(n / 2), int(n / 2) + 1)
	for k in range(1, i):
		if (j + k) % (i - k) == 0:
			break
	return (j + k, i - k)
while T > 0:
	n = int(input())
	if n % 2 == 0:
		print('{} {}'.format(n // 2, n // 2))
	else:
		(a, b) = solve(n)
		print('{} {}'.format(a, b))
	T -= 1


from math import sqrt
for tt in range(int(input())):
	n = int(input())
	v = 1
	for j in range(2, int(sqrt(n)) + 1):
		if n % j == 0:
			v = n // j
			break
	print(v, n - v)


import math

def printDivisors(n):
	i = 2
	l = []
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
		i = i + 1
	l.sort()
	return l
for _ in range(int(input())):
	n = int(input())
	s = [0] * 1000
	if n % 2:
		f = printDivisors(n)
		if len(f) == 0:
			print(n - 1, 1)
		else:
			print(f[len(f) - 1], n - f[len(f) - 1])
	else:
		print(n // 2, n // 2)


t = int(input())
for p in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		flag = False
		for j in range(2, int(n ** 0.5) + 1):
			if n % j == 0:
				print(n // j, n - n // j)
				flag = True
				break
		if flag == False:
			print(1, n - 1)


t = 1
t = int(input())
while t:
	t -= 1
	n = int(input())
	if n & 1:
		for i in range(3, int(n ** 0.5) + 1, 2):
			if n % i == 0:
				print(n // i, n - n // i)
				break
		else:
			print(1, n - 1)
	else:
		print(n // 2, n // 2)


import math
for _ in range(int(input())):
	n = int(input())
	j = 1
	f = 0
	while j * j <= n:
		if n % (j + 1) == 0:
			f = 1
			print(n // (j + 1), n * j // (j + 1))
			break
		j += 1
	if f == 0:
		print(1, n - 1)


t = input()
for opo in range(int(t)):
	n = int(input())
	if n % 2 == 0:
		print(int(n / 2), end=' ')
		print(int(n / 2))
	else:
		for i in range(2, 1 + int(n ** 0.5)):
			if n % i == 0:
				print(int(n / i), end=' ')
				print(n - int(n / i))
				break
			if i == int(n ** 0.5):
				print(1, n - 1)


from math import *
from collections import *
from itertools import *
from functools import *
from bisect import *
from heapq import *
from operator import *
from sys import *
setrecursionlimit(100000000)

def cal(n):
	i = 2
	while i <= int(sqrt(n)):
		if n % i == 0:
			return n // i
		i += 1
	return 0
for _ in range(int(input())):
	n = int(input())
	if not n & 1:
		print(n // 2, n // 2)
	else:
		x = cal(n)
		if x:
			print(x, n - x)
		else:
			print(1, n - 1)


import os
import sys
from io import BytesIO, IOBase
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.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')

def fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x - 1)

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val, lb, ub):
	ans = 0
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = 1
			break
	return ans

def sieve_of_eratosthenes(n):
	ans = []
	arr = [1] * (n + 1)
	(arr[0], arr[1], i) = (0, 0, 2)
	while i * i <= n:
		if arr[i] == 1:
			j = i + i
			while j <= n:
				arr[j] = 0
				j += i
		i += 1
	for k in range(n):
		if arr[k] == 1:
			ans.append(k)
	return ans

def nc2(x):
	if x == 1:
		return 0
	else:
		return x * (x - 1) // 2

def kadane(x):
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = max(sum_so_far, current_sum)
	return sum_so_far

def mex(li):
	check = [0] * 1001
	for i in li:
		check[i] += 1
	for i in range(len(check)):
		if check[i] == 0:
			return i
from math import *
for _ in range(int(input())):
	n = int(input())
	if n & 1:
		(a, b, ans) = (0, 0, 10000000000)
		for i in range(1, int(sqrt(n)) + 1):
			if n % i == 0:
				j = i
				lcm = j * (n - j) // gcd(j, n - j)
				if lcm < ans:
					(a, b, ans) = (j, n - j, lcm)
				if j != 1:
					j = n // i
					lcm = j * (n - j) // gcd(j, n - j)
					if lcm < ans:
						(a, b, ans) = (j, n - j, lcm)
		print(a, b)
	else:
		print(n // 2, n // 2)


t = int(input())

def gcd(a, b):
	if a < b:
		(a, b) = (b, a)
	while a % b > 0:
		r = a % b
		a = b
		b = r
	return b

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

def brute(n):
	(ma, mb, m) = (0, 0, 1e+25)
	for i in range(1, n // 2 + 1):
		print(i, n - i, lcm(i, n - i))
		if lcm(i, n - i) < m:
			m = lcm(i, n - i)
			ma = i
			mb = n - i
	print(ma, mb, m, '*')
while t:
	n = int(input())
	i = 2
	flag = False
	while i * i <= n:
		if n % i == 0:
			print(n // i, n - n // i)
			flag = True
			break
		i += 1
	if not flag:
		print(1, n - 1)
	t -= 1


import math
for _ in range(int(input())):
	n = int(input())
	i = 2
	x = n ** 0.5
	k = math.ceil(x)
	a = 1
	b = n - 1
	f = 0
	while i <= k and f == 0:
		if n % i == 0:
			a = n // i
			b = n - n // i
			f = 1
		i = i + 1
	print(a, b)


tc = int(input())
for _ in range(tc):
	n = int(input())
	for i in range(2, 31623):
		if n % i == 0:
			a = n // i
			b = n - a
			print(a, b)
			break
	else:
		print(1, n - 1)


import math

def factor(n, start=1):
	divisors = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return divisors

def main():
	for i in range(int(input())):
		n = int(input())
		if n % 2 == 0:
			print(n // 2, n // 2)
			continue
		else:
			li = factor(n)
			if len(li) == 1:
				print(1, n - 1)
				continue
			else:
				l = len(li)
				li.remove(n)
				print(max(li), n - max(li))
				continue
main()


def prime(n):
	i = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += 1
	return True
import math
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif prime(n):
		print(1, n - 1)
	else:
		for i in range(3, n + 1):
			if n % i == 0:
				d = n // i
				print(d, n - d)
				break


tc = int(input())
for ctr in range(tc):
	n = int(input())
	k = 0
	for i in range(2, 10 ** 5):
		if n % i == 0:
			k = i
			break
	if k == 0:
		k = n
	print(n // k, n - n // k)


import sys
input = sys.stdin.readline
from functools import reduce

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
t = int(input())
for i in range(t):
	n = int(input())
	if n & 1:
		l = factors(n)
		l = list(l)
		l.sort()
		print(l[-2], n - l[-2])
	else:
		print(n // 2, n // 2)


for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		f = []
		for i in range(1, int(n ** 0.5) + 1):
			if n % i == 0:
				if i * i == n:
					f.append(i)
				else:
					f.append(i)
					f.append(n // i)
		f.sort()
		if len(f) == 2:
			print(1, n - 1)
		else:
			x = n // f[1]
			y = n - x
			print(x, y)


import io
import os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def prime(n):
	i = 1
	ma = 0
	while i * i <= n:
		if n % i == 0:
			if n // i == i:
				if ma < i and i != n:
					ma = i
			else:
				if ma < i and i != n:
					ma = i
				if n // i > ma and n // i != n:
					ma = n // i
		i += 1
	print(ma, n - ma)

def solve():
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		prime(n)

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


for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		mx = -1
		for i in range(2, int(1 + n ** 0.5)):
			if n % i == 0:
				if i % 2 == 1:
					mx = max(mx, i)
				if n // i % 2 == 1:
					mx = max(mx, n // i)
		if mx != -1:
			print(mx, n - mx)
		else:
			print(1, n - 1)


import sys
input = lambda : sys.stdin.readline().rstrip()
from math import gcd
lcm = lambda a, b: a * b // gcd(a, b)
for _ in range(int(input())):
	n = int(input())
	v = n - 1
	(l, r) = (1, n - 1)
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			(a, b) = (n // i, n - n // i)
			x = lcm(a, b)
		else:
			(a, b) = (i, n - i)
			x = lcm(a, b)
		if x < v:
			v = x
			(l, r) = (a, b)
	print(l, r)


def prime(n):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return (False, i)
	return (True, 0)
import math
T = int(input())
for _ in range(T):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		(d, f) = prime(n)
		if d == False:
			print(n // f, n - n // f)
		else:
			print(1, n - 1)


import math
t = int(input())
for i in range(t):
	n = int(input())
	maxi = math.floor(n ** 0.5)
	for i in range(2, maxi + 1):
		if n % i == 0:
			print(n // i, n // i * (i - 1))
			break
	else:
		print(1, n - 1)


t = int(input())
for i in range(t):
	n = int(input())
	a = 0
	if n & 1:
		for i in range(3, 2 * 100000):
			if n % i == 0:
				a = i
				break
		if a == 0:
			a = n
		print(n // a, n - n // a)
	else:
		print(n // 2, n - n // 2)


import math

def printDivisors(n):
	list = []
	list1 = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				list.append(i)
			else:
				list.append(i)
				list1.append(int(n / i))
	list1 = list1[::-1]
	b = list + list1
	return b[-2]
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		ans = printDivisors(n)
		f = n - ans
		print(min(ans, f), max(ans, f))


import math

def function(n):
	min1 = 10 ** 9
	min1 = 0
	for i in range(2, int(math.sqrt(n) + 1)):
		if n % i == 0:
			x = int(n / i)
			y = n - x
			return f'{x} {y}'
	return f'{1} {n - 1}'
t = int(input())
for k1 in range(t):
	n = int(input())
	print(function(n))


for j in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(int(n / 2), end=' ')
		print(int(n / 2))
	else:
		count = 0
		for i in range(2, int(pow(n, 0.5)) + 1):
			if n % i == 0:
				count = 1
				break
		if count == 1:
			k = int(n / i)
		else:
			k = 1
		print(k, n - k)


from sys import maxsize
from math import gcd
get_int = lambda : int(input())
get_mul_int = lambda : map(int, input().rstrip().split())
get_list = lambda : list(map(int, input().rstrip().split()))

def lf(n):
	i = 2
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
	return n
TEST_CASES = True

def main():
	m = maxsize
	n = get_int()
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		factor = lf(n)
		if factor == n:
			print(1, n - 1)
			return
		else:
			i = 1
			while factor * i < n:
				left = factor * i
				right = n - left
				m = min(m, left * right // gcd(left, right))
				i += 1
			print(n - m, m)
if not TEST_CASES:
	main()
else:
	[main() for _ in range(int(input()))]


for _ in range(int(input())):
	t = int(input())
	if t % 2 == 0:
		print(int(t // 2), int(t // 2))
	else:
		i = 3
		flag = 0
		while i * i <= t:
			if t % i == 0:
				a = t // i
				b = t - a
				print(a, b)
				flag = 1
				break
			else:
				i += 2
		if flag == 0:
			print(1, t - 1)


import math, sys
from sys import stdin, stdout
from collections import Counter, defaultdict, deque
input = stdin.readline
I = lambda : int(input())
li = lambda : list(map(int, input().split()))

def solve():
	n = I()
	p = int(math.sqrt(n)) + 1
	key = 1
	(t, s) = (0, 0)
	m = 0
	a = []
	for i in range(1, p + 1):
		if n % i == 0:
			a.append(i)
			if n // i != i:
				a.append(n // i)
	for i in range(len(a)):
		if a[i] > 0 and n - a[i] > 0:
			g = math.gcd(a[i], n - a[i])
			if g > m:
				m = g
				(s, t) = (a[i], n - a[i])
	print(s, t)
for _ in range(I()):
	solve()


tc = int(input())
for i in range(tc):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		sf = 1
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				sf = i
				break
		if sf == 1:
			print(1, n - 1)
		else:
			lf = n // sf
			print(lf, n - lf)


import math

def pf(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n // i
	if n > 2:
		l.append(n)
	return min(l)
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		p = pf(n)
		p = n // p
		if p == n:
			p = 1
		print(p, n - p)


t = int(input())
from math import sqrt
for _ in range(t):
	n = int(input())
	s = int(sqrt(n))
	for divider in range(2, s + 3):
		if n % divider == 0:
			print(n // divider, n - n // divider)
			break
	else:
		print(1, n - 1)


from __future__ import division, print_function
import itertools, os, sys, threading
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
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.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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from math import sqrt, floor, factorial, gcd, log
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
from math import gcd
from bisect import bisect
from random import randrange
input = lambda : sys.stdin.readline().rstrip('\r\n')
read = lambda : list(map(int, input().strip().split(' ')))

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

def facts(n):
	arr = [1]
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			arr.extend([i, n // i])
	return arr

def main():
	for _ in range(int(input())):
		n = int(input())
		mini = [10 ** 9, 10 ** 9, 10 ** 9]
		arr = facts(n)
		for i in arr:
			if lcm(i, n - i) < mini[0]:
				mini = [lcm(i, n - i), i, n - i]
		print(*mini[1:])
main()


import sys

def factorization(n):
	arr = []
	temp = n
	for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			arr.append([i, cnt])
	if temp != 1:
		arr.append([temp, 1])
	if arr == []:
		arr.append([n, 1])
	return arr
input = sys.stdin.readline
t = int(input())
for a_ in range(t):
	n = int(input())
	nn = factorization(n)
	div = 1
	for i in range(len(nn)):
		if i == 0:
			div *= nn[i][0] ** (nn[i][1] - 1)
		else:
			div *= nn[i][0] ** nn[i][1]
	print(div, n - div)


from sys import stdin
input = lambda : stdin.readline().rstrip('\r\n')
from collections import deque as que
from collections import defaultdict as vector
inin = lambda : int(input())
inar = lambda : list(map(int, input().split()))

def all_factors(n):
	(small, large) = ([], [])
	for i in range(1, int(n ** 0.5) + 1, 2 if n & 1 else 1):
		if not n % i:
			small.append(i)
			large.append(n // i)
	if small[-1] == large[-1]:
		large.pop()
	large.reverse()
	small.extend(large)
	return small
from math import gcd

def lcm(x, y):
	return x * y // gcd(x, y)
Testcase = inin()
for _ in range(Testcase):
	n = inin()
	(a, b) = (1, n - 1)
	lcmv = n - 1
	for i in all_factors(n)[:-1]:
		if lcm(i, n - i) < lcmv:
			(a, b) = (i, n - i)
			lcmv = lcm(a, b)
	print(a, b)


def smallestDivisor(n):
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n

def solve(N):
	if N % 2 == 0:
		return (N // 2, N // 2)
	else:
		tmp = smallestDivisor(N)
		return (N // tmp, N - N // tmp)

def main():
	n = int(input())
	for i in range(n):
		N = int(input())
		(start, end) = solve(N)
		print(start, end)
main()


t = int(input())
import math

def lcm(a, b):
	return a * b // math.gcd(a, b)
for _ in range(t):
	n = int(input())
	ans = lcm(1, n - 1)
	an = (1, n - 1)
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			if lcm(i, n - i) < ans:
				ans = lcm(i, n - i)
				an = (i, n - i)
			if lcm(n // i, n - n // i) < ans:
				ans = lcm(n // i, n - n // i)
				an = (n // i, n - n // i)
	print(*an)


import math
query = int(input())
for i in range(query):
	num = int(input())
	if num and 1:
		cont = 0
		for j in range(1, int(math.sqrt(num)) + 1):
			if num % j == 0:
				cont = max(cont, j)
				if j != 1:
					cont = max(cont, num / j)
		print(int(cont), num - int(cont))
	else:
		print(num / 2 + ' ' + num / 2)


from math import sqrt, ceil

def gcd(a, b):
	if a % b == 0:
		return b
	return gcd(b, a % b)
for _ in range(int(input())):
	n = int(input())
	l = []
	ans = n - 1
	(a, b) = (1, n - 1)
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			l.append(i)
			l.append(n // i)
	for i in l:
		if i * (n - i) // gcd(i, n - i) < ans:
			ans = i * (n - i) // gcd(i, n - i)
			(a, b) = (i, n - i)
	print(a, b)


t = int(input())
import math
for _ in range(t):
	n = int(input())
	factor = []
	dic = {}
	for i in range(1, int(math.sqrt(n)) + 1):
		if n % i == 0:
			factor.append(i)
			factor.append(n // i)
	for i in factor:
		ch = n - i
		if ch == 0:
			pass
		else:
			lcm = i * ch // math.gcd(i, ch)
			if i < ch:
				dic[lcm] = [i, ch]
			else:
				dic[lcm] = [ch, i]
	print(*dic[min(list(dic.keys()))])


from math import *
for u in range(int(input())):
	n = int(input())
	if n == 2:
		print(1, 1)
	elif n == 3:
		print(2, 1)
	elif n % 2 == 0:
		print(n // 2, n // 2)
	else:
		f = 0
		l = []
		for i in range(2, int(sqrt(n)) + 1):
			if n % i == 0:
				f = 1
				l.append(i)
				l.append(n // i)
		if f == 1:
			m = max(l)
			print(m, n - m)
		else:
			print(1, n - 1)


ll = lambda : list(map(int, input().split()))
st = lambda : input()
v = lambda : map(int, input().split())
ii = lambda : int(input())
from collections import *
from math import *
from datetime import datetime

def pd(n):
	i = 2
	l = []
	while i <= sqrt(n):
		if n % i == 0:
			if n / i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
		i = i + 1
	l.sort()
	return l
for _ in range(ii()):
	n = ii()
	if not n % 2:
		print(n // 2, n // 2)
	else:
		s = pd(n)
		if len(s) != 0:
			print(s[len(s) - 1], n - s[len(s) - 1])
		else:
			print(n - 1, 1)


import bisect
import decimal
from decimal import Decimal
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate
decimal.getcontext().prec = 46

def primeFactors(n):
	prime = set()
	while n % 2 == 0:
		prime.add(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			prime.add(i)
			n = n // i
	if n > 2:
		prime.add(n)
	return list(prime)

def getFactors(n):
	factors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				factors.append(i)
			else:
				factors.append(i)
				factors.append(n // i)
		i = i + 1
	return factors

def modefiedSieve():
	mx = 10 ** 7 + 1
	sieve = [-1] * mx
	for i in range(2, mx):
		if sieve[i] == -1:
			sieve[i] = i
			for j in range(i * i, mx, i):
				if sieve[j] == -1:
					sieve[j] = i
	return sieve

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

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

def sort_dict(key_value):
	return sorted(key_value.items(), key=lambda kv: (kv[1], kv[0]), reverse=True)

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

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

def string_list():
	return list(input())

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

def binaryToDecimal(n):
	return int(n, 2)

def DFS(n, s, adj):
	visited = [False for i in range(n + 1)]
	stack = []
	stack.append(s)
	while len(stack):
		s = stack[-1]
		stack.pop()
		if not visited[s]:
			visited[s] = True
		for node in adj[s]:
			if not visited[node]:
				stack.append(node)

def maxSubArraySum(a, size):
	maxint = 10 ** 10
	max_so_far = -maxint - 1
	max_ending_here = 0
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_so_far < max_ending_here:
			max_so_far = max_ending_here
		if max_ending_here < 0:
			max_ending_here = 0
	return max_so_far

def lis(arr):
	n = len(arr)
	lis = [1] * n
	for i in range(1, n):
		for j in range(0, i):
			if arr[i] >= arr[j] and lis[i] < lis[j] + 1:
				lis[i] = lis[j] + 1
	maximum = 0
	for i in range(n):
		maximum = max(maximum, lis[i])
	return maximum

def solve():
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		factors = getFactors(n)
		if len(factors) == 2:
			print(1, n - 1)
		else:
			l = 10 ** 10
			(a1, a2) = (1, 1)
			for i in factors:
				if i == n:
					continue
				(n1, n2) = (i, n - i)
				temp = lcm(n1, n2)
				if temp < l:
					l = temp
					(a1, a2) = (n1, n2)
			print(a1, a2)
t = 1
t = int(input())
for _ in range(t):
	solve()


t = int(input())
while t:
	t -= 1
	n = int(input())
	maxx = 1
	i = 2
	flag = False
	while i * i <= n:
		if n % i == 0:
			flag = True
			break
		i += 1
	a = 1
	b = n - 1
	if flag:
		a = n // i
		b = n - a
	print(str(a) + ' ' + str(b))


import math
for _ in range(int(input())):
	n = int(input())
	if not n % 2:
		print(n // 2, n // 2)
	else:
		ans = 1
		for i in range(2, int(math.sqrt(n)) + 1):
			if n % i == 0:
				if n % (n // i) == 0:
					ans = max(i, n // i, ans)
				else:
					ans = max(ans, i)
		print(ans, n - ans)


from collections import defaultdict
from math import floor, sqrt

def lcm(x, y, p):
	while y:
		(x, y) = (y, x % y)
	return p // x

def great(n):
	d = defaultdict(int)
	for i in range(3, floor(sqrt(n)) + 1):
		while n % i == 0:
			d[i] += 1
			n //= i
	if n > 2:
		d[n] += 1
	return d
for i in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		d = great(n)
		(m, p) = (10 ** 9 + 1, 1)
		for i in d:
			m = min(m, i)
		if m == n:
			print(1, n - 1)
		else:
			k = n // m
			print(k, n - k)


t = int(input())
for i in range(t):
	n = int(input())
	done = False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			done = True
			print(n // i, n - n // i)
			break
	if not done:
		print(1, n - 1)


import math

def compute_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def compute_lcm(x, y):
	lcm = x * y // compute_gcd(x, y)
	return lcm

def getFactors(n):
	factors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				factors.append(i)
			else:
				factors.append(i)
				factors.append(n // i)
		i = i + 1
	return sorted(factors)

def main():
	n = int(input())
	for i in range(n):
		solve()

def solve():
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
		return
	factors = getFactors(n)
	lowest = n
	numbers = (1, n)
	for i in factors:
		if i == n:
			continue
		score = compute_lcm(i, n - i)
		if score < lowest:
			numbers = (i, n - i)
			lowest = score
	print(numbers[0], numbers[1])
main()


import sys
import math

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

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

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

def SI():
	return sys.stdin.readline().strip()
t = II()
for q in range(t):
	n = II()
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		boo = False
		for i in range(3, int(n ** 0.5) + 1):
			if n % i == 0:
				boo = True
				print(n // i, n - n // i)
				break
		if boo == False:
			print(1, n - 1)


T = int(input())
for _ in range(T):
	n = int(input())
	num = n
	i = 2
	(a, b) = (None, None)
	while i * i <= n:
		if n % i == 0:
			k = n // i
			(a, b) = (k, n - k)
			break
		else:
			i += 1
	if a is None:
		(a, b) = (1, n - 1)
	print(a, b)


for _ in range(int(input())):
	n = int(input())
	if n % 2 < 1:
		print(n // 2, n // 2)
	else:
		i = 3
		while n % i and i * i < n:
			i += 2
		if n % i:
			print(1, n - 1)
		else:
			print(n // i, n - n // i)


from functools import reduce

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(1, 1)
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		li = sorted(factors(n))
		if len(li) == 2:
			print(1, li[-1] - 1)
		else:
			n1 = li[-2]
			n2 = n // n1
			print(n1, (n2 - 1) * n1)


a = int(input())

def smallestDivisor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n
for _ in range(a):
	b = int(input())
	lol = smallestDivisor(b)
	t = (lol - 1) * b // lol
	h = b - t
	print(h, t)


import math
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		m = 10000000000
		set1 = set()
		for i in range(1, int(math.sqrt(n)) + 1):
			if n % i == 0:
				set1.add(i)
				set1.add(n // i)
		set1 = set1 - {n}
		for i in set1:
			x = i
			y = n - i
			if max(x, y) % min(x, y) == 0:
				if max(x, y) < m:
					m = max(x, y)
		print(n - m, m)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		p = 0
		for m in range(2, int(math.sqrt(n)) + 1):
			if n % m == 0:
				p = m
				break
		if p == 0:
			p = n
		print(n // p, n - n // p)


import math

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def getSmallestPrimefactor(n):
	for i in range(2, int(math.sqrt(n) + 1)):
		if n % i == 0:
			return i
	return -1
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif isPrime(n):
		print(1, n - 1)
	else:
		bf = n // getSmallestPrimefactor(n)
		print(bf, n - bf)


for t in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		d = 3
		while d * d <= n:
			if n % d == 0:
				break
			d += 2
		if d * d > n:
			print(1, n - 1)
		else:
			b = n // d
			print(b, (d - 1) * b)


import os
import sys
from io import BytesIO, IOBase
import threading
from math import gcd

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

def main():
	for _ in range(int(input())):
		n = int(input())
		if n % 2 == 0:
			print(n // 2, n // 2)
		else:
			fac = -1
			for i in range(3, int(n ** 0.5) + 1, 2):
				if n % i == 0:
					fac = i
					break
			if fac == -1:
				print(n - 1, 1)
			else:
				t = 1
				s = n // fac
				print(t * s, (fac - t) * s)
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.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')
main()


from math import gcd, sqrt

def compute_lcm(x, y):
	lcm = x * y // gcd(x, y)
	return lcm
for I in range(int(input())):
	n = int(input())
	mini = 10000000000000
	res = [-1, -1]
	for i in range(1, int(sqrt(n)) + 2):
		if n % i == 0:
			if n - i > 0:
				lcm = compute_lcm(i, n - i)
				if lcm < mini:
					mini = lcm
					res = [i, n - i]
			temp = n // i
			if n - temp > 0:
				lcm = compute_lcm(temp, n - temp)
				if lcm < mini:
					mini = lcm
					res = [temp, n - temp]
	print(*res)


import sys
from math import floor as fl
from math import ceil as ce
from math import sqrt
cont = sys.stdin.readlines()
cont = [i.strip('\n') for i in cont]
num = int(cont.pop(0)[0])
for i in cont:
	n = int(i)
	if n % 2 == 0:
		n = n // 2
		print(f'{n} {n}')
	else:
		factors = set([1])
		j = 2
		while j <= int(ce(sqrt(n))):
			if n % j == 0:
				factors.add(j)
				if j * j != n:
					factors.add(n // j)
			j += 1
		m = max(factors)
		print(f'{m} {n - m}')


from sys import stdin, stdout
from itertools import combinations
from collections import defaultdict, Counter
import math

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

def stringListIn():
	return [x for x in stdin.readline().split()]

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

def stringIn():
	return stdin.readline().strip()

def largestDivisor(n):
	li = []
	li2 = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				li2.append(i)
			else:
				li2.append(i)
				li.append(n // i)
	li2 += li[::-1]
	return max(li2[:-1])
t = intIn()
while t > 0:
	t -= 1
	n = intIn()
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		ans = largestDivisor(n)
		print(ans, n - ans)


from sys import stdin, stdout
from math import gcd, ceil, sqrt
from collections import Counter
from bisect import bisect_left, bisect_right
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
tc = ii1()
for _ in range(tc):
	n = ii1()
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			print(n // i, n - n // i)
			break
	else:
		print(1, n - 1)


from math import gcd

def lcm(x, y):
	return x * y // gcd(x, y)
for _ in range(int(input())):
	n = int(input())
	if n & 1:
		g = 1
		mi = n
		(a, b) = (1, n)
		while g * g <= n:
			if n % g == 0:
				p = g
				q = n - g
				l = lcm(p, q)
				if l < mi:
					mi = l
					a = p
					b = q
				if g != 1:
					p = n // g
					q = n - p
					l = lcm(p, q)
					if l < mi:
						mi = l
						a = p
						b = q
			g += 1
		print(a, b)
	else:
		print(n // 2, n // 2)


def solve(n):
	if n % 2 == 0:
		return (n // 2, n // 2, n // 2)
	else:
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				return (n // i, n - n // i, n - n // i)
		return (1, n - 1, n - 1)
t = int(input())
cnt = 0
while cnt < t:
	cnt += 1
	n = int(input())
	(a, b, c) = solve(n)
	print(a, b)


import math
import os
import random
import re
import sys
from collections import Counter

def solve():
	for _ in range(int(input())):
		n = int(input())
		if n % 2 == 0:
			print(n // 2, n // 2)
		else:
			l1 = []
			sq = math.sqrt(n)
			for i in range(1, int(sq) + 1):
				if n % i == 0:
					l1.append(i)
					l1.append(int(n / i))
			l1.sort()
			print(l1[-2], n - l1[-2])
solve()


from sys import stdin
t = int(stdin.readline().strip())
for i in range(t):
	n = int(stdin.readline().strip())
	isPrime = True
	for i in range(2, int(n ** 0.5 + 2)):
		if n % i == 0:
			print(int(n // i), int(n - n // i))
			isPrime = False
			break
	if isPrime:
		print(1, n - 1)


from sys import stdin, stdout
import math as mt, itertools as it, functools as ft
import os
import sys
from io import BytesIO, IOBase

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	return x * y // gcd(x, y)

def main():
	for _ in range(int(input())):
		n = int(input())
		ans = float('inf')
		first = -1
		second = -1
		if n % 2 == 0:
			print((str(n // 2) + ' ') * 2)
		else:
			for i in range(1, int(mt.sqrt(n)) + 1):
				if n % i == 0:
					x = i
					y = n - i
					if x == 0 or y == 0:
						continue
					if lcm(x, y) < ans:
						ans = lcm(x, y)
						first = x
						sec = y
					if n // i != i:
						x = n // i
						y = n - x
						if x == 0 or y == 0:
							continue
						if lcm(x, y) < ans:
							ans = lcm(x, y)
							first = x
							sec = y
			print(first, sec)
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.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')
main()


import math
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 1:
		k = int(math.sqrt(n))
		found = False
		for i in range(2, k + 1):
			if n % i == 0:
				print(n // i, n - n // i)
				found = True
				break
		if not found:
			print(1, n - 1)
	else:
		k = n // 2
		print(k, k)


from sys import stdin
import math

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

def printDivisors(n):
	i = 1
	div = []
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				if i != n:
					div.append(i)
			else:
				if i != n:
					div.append(i)
				if n / i != n:
					div.append(n / i)
		i = i + 1
	return div
t = int(inp())
for _ in range(t):
	n = int(inp())
	if n % 2 == 0:
		print(n // 2, end=' ')
		print(n // 2)
	else:
		a = printDivisors(n)
		intDiv = int(max(a))
		print(intDiv, end=' ')
		print(n - intDiv)


t = int(input())
for _ in range(t):
	n = int(input())
	i = 2
	while i * i < n and n % i != 0:
		i += 1
	if n % i != 0:
		print(1, n - 1)
		continue
	a = n // i
	b = n - a
	print(a, b)


t = int(input())
for _ in range(t):
	n = int(input())
	k = []
	for i in range(1, int(pow(n, 0.5)) + 1):
		if not n % i:
			k.append(i)
			if i != n // i:
				k.append(n // i)
	k.sort()
	print(k[-2], n - k[-2])


import math
t = int(input())
for i in range(t):
	n = int(input())
	i = 2
	flag = 0
	while i <= math.sqrt(n):
		if n % i == 0:
			ans = n // i
			print(ans, n - ans)
			flag = 1
			break
		i += 1
	if flag == 0:
		print(1, n - 1)


t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	if n % 2 == 0:
		print(n // 2, end=' ')
		print(n // 2)
	else:
		i = 3
		m = 0
		flag = 0
		while i * i <= n:
			if n % i == 0:
				m = max(m, n // i, i)
				flag = 1
			i = i + 1
		if flag == 0:
			print(1, end=' ')
			print(n - 1)
		else:
			print(m, end=' ')
			print(n - m)


import sys
import os
import math
import copy
from math import gcd
from bisect import bisect
from io import BytesIO, IOBase
from math import sqrt, floor, factorial, gcd, log, ceil
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
import itertools

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

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

def Lstr():
	return list(sys.stdin.readline().strip())

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

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

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

def Hash():
	return dict()

def Mod():
	return 1000000007

def Ncr(n, r, p):
	return fact[n] * (ifact[r] * ifact[n - r] % p) % p

def Most_frequent(list):
	return max(set(list), key=list.count)

def Mat2x2(n):
	return [List() for _ in range(n)]

def Lcm(x, y):
	lcm = x * y // gcd(x, y)
	return lcm

def solution():
	for i in range(Int()):
		n = Int()
		ans = []
		for i in range(2, floor(n ** 0.5) + 1):
			if n % i == 0:
				ans.append(i)
		if len(ans) == 0:
			print(1, n - 1)
		else:
			print(n // min(ans), n - n // min(ans))
solution()


input = __import__('sys').stdin.readline
for _ in range(int(input())):
	n = int(input())
	prime = 1
	for d in range(2, int(n ** 0.5) + 1):
		if n % d == 0:
			print(n // d, n - n // d)
			prime = 0
			break
	if prime:
		print(n - 1, 1)


t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		min_val = 1
		for j in range(2, int(n ** 0.5) + 1):
			if n % j == 0:
				min_val = n // j
				break
		print(min_val, n - min_val)


def fac(n):
	i = 2
	p = 1
	while i * i <= n:
		if n % i == 0:
			z = max(i, n // i)
			p = max(p, z)
		i += 1
	return p
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	if n % 2 == 1:
		p = fac(n)
		print(p, n - p)


import math

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
try:
	for _ in range(int(input())):
		n = int(input())
		if n % 2 == 0:
			print(n // 2, n // 2)
		elif isPrime(n):
			print(1, n - 1)
		else:
			ans = 1
			for i in range(3, n, 2):
				if n % i == 0:
					ans = n // i
					break
			print(n - ans, ans)
except:
	pass


import math

def printDivisors(n):
	i = 1
	maxi = float('-inf')
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				if i > maxi and i != n:
					maxi = i
			elif i != n and n // i != n:
				maxi = max(maxi, i, n // i)
		i = i + 1
	return maxi
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		a = 1
		ta = 0
		tb = 0
		ans = printDivisors(n)
		if ans == float('-inf'):
			print(1, n - 1)
		else:
			print(ans, n - ans)


def isPrime(n):
	i = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += 1
	return True

def smFc(n):
	i = 2
	while i * i <= n:
		if n % i == 0:
			return i
		i += 1
	return n
t = int(input())
for q in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif isPrime(n):
		print(1, n - 1)
	else:
		k = smFc(n)
		print(n // k, n - n // k)


from collections import Counter as C, defaultdict as D, deque as Q
from operator import itemgetter as I
from itertools import product as P
from bisect import bisect_left as BL, bisect_right as BR
from heapq import heappush as HPUSH, heappop as HPOP
from math import floor as MF, ceil as MC, gcd as MG, factorial as F, sqrt as SQRT

def factors(n):
	largest = 1
	for i in range(2, MC(SQRT(n)) + 1):
		if n % i == 0:
			largest = max(largest, i)
			x = n // i
			largest = max(largest, x)
	return largest

def main():
	for _ in range(int(input())):
		n = int(input())
		a = n // 2
		if n & 1:
			m = factors(n)
			print('%d %d' % (m, n - m))
		else:
			print('%d %d' % (a, a))
main()


t = int(input())
for teste in range(t):
	n = int(input())
	div = []
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			div.append(i)
			div.append(n // i)
	div.append(1)
	div = sorted(set(div))
	print(div[-1], n - div[-1])


import sys
input = sys.stdin.readline

def divisors(n):
	divisors = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			divisors.append(i)
			if i != n // i:
				divisors.append(n // i)
	divisors.sort()
	return divisors
t = int(input())
for _ in range(t):
	n = int(input())
	div = divisors(n)
	if len(div) == 1:
		print(1, n - 1)
	else:
		print(n // div[1], n // div[1] * (div[1] - 1))


import math

def lcm(a, b):
	g = math.gcd(max(a, b), min(a, b))
	l = a * b // g
	return l

def find(n):
	facts = set()
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			facts.add(i)
			facts.add(n // i)
	facts = list(facts)
	return facts

def main():
	t = int(input())
	ans = []
	for i in range(t):
		n = int(input())
		min_l = float('inf')
		facts = find(n)
		for a in facts:
			b = (n // a - 1) * a
			if a > 0 and b > 0:
				l = lcm(a, b)
				if l < min_l:
					min_a = a
					min_b = b
					min_l = l
		ans.append(str(min_a) + ' ' + str(min_b))
	for i in ans:
		print(i)
main()


from math import gcd, sqrt, ceil
import sys

def lcm(a, b, z):
	if a == 0 or b == 0:
		return max(a, b)
	return z(a * b) // gcd(a, b)
T = int(input())
z = abs
for i in range(T):
	n = int(input())
	t = 0
	if n % 2 == 0:
		print(n // 2, n // 2)
		continue
	for i in range(2, ceil(sqrt(n)) + 1):
		if n % i == 0:
			print(n // i, n - n // i)
			t = 1
			break
	if t != 1:
		print(1, n - 1)


from math import gcd

def lcm(a, b):
	return a * b // gcd(a, b)
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		(a, b) = (1, n - 1)
		l = n - 1
		for i in range(2, 1 + int(n ** 0.5)):
			if n % i == 0:
				q = n // i
				if lcm(q, n - q) < l:
					a = q
					b = n - q
					l = lcm(q, n - q)
		print(a, b)


def ques1(n):
	flag = 0
	count = 0
	if n % 2 == 0:
		print(int(n / 2), end=' ')
		print(int(n / 2))
	else:
		k = int(n ** 0.5)
		for i in range(3, k + 1):
			if n % i == 0:
				flag = 1
				m = i
				break
		if flag == 1:
			print(int(n / m), end=' ')
			print(int(n - n / m))
		else:
			print(1, end=' ')
			print(n - 1)
t = int(input())
for i in range(t):
	n = int(input())
	ans = ques1(n)
	ans


import math

def isfind(n):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return (n // i, n - n // i)
	return (1, n - 1)
t = int(input())
while t > 0:
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		(a, b) = isfind(n)
		print(a, b)
	t -= 1


def is_p(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return i
	return True
for i in range(int(input())):
	n = int(input())
	imp = is_p(n)
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif imp == True:
		print(1, n - 1)
	else:
		x = n // imp
		print(x, (n // x - 1) * x)


import math
for _ in range(int(input())):

	def smallestDivisor(n):
		if n % 2 == 0:
			return 2
		i = 3
		while i * i <= n:
			if n % i == 0:
				return i
			i += 2
		return n
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		z = smallestDivisor(n)
		if z == n:
			print(1, n - 1)
		else:
			g = n // z
			print(g, n - g)


def smallestDivisor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		k = smallestDivisor(n)
		if k == n:
			print(1, n - 1)
		else:
			q = n // k
			print(q, (k - 1) * q)


for i in range(int(input())):
	ai = int(input())
	Ind = 0
	for k in range(2, int(ai ** 0.5) + 1):
		if ai % k == 0:
			Ind += 1
			print(ai // k, ai - ai // k)
			break
	if Ind == 0:
		print(1, ai - 1)


import sys
input = sys.stdin.readline

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

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
t = int(input())
for _ in range(t):
	n = int(input())
	divs = divisors(n)
	ans = 10 ** 18
	pair = [0, 0]
	for val in divs:
		if val == n:
			continue
		a = val
		b = n - val
		tmp = a * b // gcd(a, b)
		if tmp < ans:
			pair = [a, b]
			ans = tmp
	print(*pair)


import math

def ans(n):
	l = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
		i = i + 1
	l.sort()
	l.reverse()
	m = l[1]
	print(m, n - m)
t = int(input())
while t > 0:
	a = int(input())
	if a % 2 == 0:
		print(a // 2, a // 2)
	else:
		ans(a)
	t -= 1


import math
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		div = []
		for i in range(1, int(math.sqrt(n) + 1)):
			if n % i == 0:
				if i == n / i:
					div.append(i)
				else:
					div.append(i)
					div.append(n // i)
		div.sort()
		print(div[-2], n - div[-2])


import math
t = int(input())
limit = int(math.sqrt(2 * 10 ** 9))
numbers = list(range(2, limit))
for i in range(0, int(math.sqrt(limit))):
	if numbers[i] > 0:
		k = 2
		while k * numbers[i] - 2 < len(numbers):
			numbers[numbers[i] * k - 2] = 0
			k += 1
primes = []
for n in numbers:
	if n > 0:
		primes.append(n)

def minorDivisor(n):
	i = 0
	while primes[i] * primes[i] <= n:
		if n % primes[i] == 0:
			return primes[i]
		i += 1
	return n
results = []
for i in range(t):
	n = int(input())
	div = minorDivisor(n)
	a = n / div
	b = n - a
	results.append(a)
	results.append(b)
for i in range(t):
	print(int(results[2 * i]), int(results[2 * i + 1]))


from sys import stdin, gettrace
from math import sqrt
if gettrace():
	inputi = input
else:

	def input():
		return next(stdin)[:-1]

	def inputi():
		return stdin.buffer.readline()

def solve():
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
		return
	for i in range(3, int(sqrt(n)) + 1, 2):
		if n % i == 0:
			print(n // i, n - n // i)
			return
	else:
		print(1, n - 1)

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


import math
count = int(input())
arr = []
for i in range(count):
	arr.append(int(input()))
for item in arr:
	if item % 2 == 0:
		print(item // 2, item // 2)
		continue
	ab = (1, item - 1)
	div = 3
	while div <= math.sqrt(item):
		if item % div == 0:
			ab = (item // div, item - item // div)
			break
		div += 2
	print(*ab)


for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		f = -1
		i = 2
		while i * i <= n:
			if n % i == 0:
				f = i
				break
			i += 1
		if f == -1:
			print(n - 1, 1)
		else:
			print(n - n // f, n // f)


import sys
import math
import collections
from sys import stdin, stdout, setrecursionlimit
import bisect as bs
setrecursionlimit(2 ** 20)
M = 998244353
T = int(stdin.readline())
for _ in range(T):
	n = int(stdin.readline())
	a = n - 1
	b = 1
	clcm = n - 1
	for i in range(2, int(math.sqrt(n)) + 1, 1):
		if n % i != 0:
			continue
		f = n // i
		if n - i > (i - 1) * f:
			if (i - 1) * f > clcm:
				continue
			b = f
			a = (i - 1) * f
			clcm = a
		else:
			if n - i > clcm:
				continue
			b = i
			a = n - i
			clcm = a
	print(a, b)


from math import sqrt
t = int(input())
for _ in range(t):
	n = int(input())
	rangeLoop = int(sqrt(n)) + 1
	smallDivisor = -1
	for i in range(2, rangeLoop):
		if n % i == 0:
			smallDivisor = i
			break
	if smallDivisor == -1:
		print('1 ' + str(n - 1))
	else:
		print(str(n // smallDivisor) + ' ' + str(n - n // smallDivisor))


import math
for _ in range(int(input())):
	x = int(input())
	min_lcm = x - 1
	sqr = math.floor(math.sqrt(x)) + 1
	for i in range(2, sqr):
		if x % i == 0:
			min_sub = min(x - i, x - int(x / i))
			if min_lcm > min_sub:
				min_lcm = min_sub
	print(x - min_lcm, min_lcm)


import math

def factors(n):
	ans = 1
	a = 2
	while a <= math.sqrt(n):
		if n % a == 0:
			ans = max(a, n // a, ans)
		a += 1
	return ans
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		ans = factors(n)
		print(ans, n - ans)


def modinv(n, p):
	return pow(n, p - 2, p)
import math

def main():
	primes_upto = int(100000.0 + 1)
	is_prime = [True] * (primes_upto + 1)
	for i in range(2, int(math.sqrt(primes_upto)) + 1):
		if is_prime[i]:
			j = i * i
			while j <= primes_upto:
				is_prime[j] = False
				j += i
	primes = []
	for i in range(2, primes_upto + 1):
		if is_prime[i]:
			primes.append(i)
	for case in range(int(input())):
		n = int(input())
		x = 1
		for p in primes:
			if n % p == 0:
				x = p
				break
		if x == 1 or x == n:
			print(1, n - 1)
		else:
			a = n // x
			b = n - a
			print(a, b)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			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')
main()


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

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

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

def ws(s):
	sys.stdout.write(s + '\n')

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

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools
from collections import deque, defaultdict, OrderedDict
import collections

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	for _ in range(ri()):
		n = ri()
		z = []
		if n % 2 == 0:
			print(n // 2, n // 2)
		else:
			c = 0
			for i in range(1, int(math.sqrt(n)) + 1):
				if n % i == 0:
					c += 1
					z.append(i)
					z.append(n // i)
					if c == 2:
						break
			k = z[-1]
			l = n // k
			if k != n:
				l -= 1
				print(k, l * k)
			else:
				print(1, n - 1)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			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, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			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()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

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

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


import sys
import bisect as bi
import math
from collections import defaultdict as dd
import heapq
input = sys.stdin.readline
mo = 10 ** 9 + 7

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())

def pref(a, n, f):
	pre = [0] * n
	if f == 0:
		pre[0] = a[0]
		for i in range(1, n):
			pre[i] = a[i] + pre[i - 1]
	else:
		pre[-1] = a[-1]
		for i in range(n - 2, -1, -1):
			pre[i] = pre[i + 1] + a[i]
	return pre
maxint = 10 ** 24

def kadane(a, size):
	max_so_far = -maxint - 1
	max_ending_here = 0
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_so_far < max_ending_here:
			max_so_far = max_ending_here
		if max_ending_here < 0:
			max_ending_here = 0
	return max_so_far
for _ in range(inin()):
	n = inin()
	sq = int(math.sqrt(n))
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		ans = 1
		for i in range(3, sq + 1):
			if n % i == 0:
				ans = n // i
				break
		print(ans, n - ans)


from math import gcd
for n in range(int(input())):
	x = int(input())
	if x % 2 == 0:
		print(x // 2, x // 2)
		continue
	res = 10 ** 10
	a = 1
	b = x - 1
	for n in range(3, int(x ** 0.5) + 1, 2):
		if x % n == 0:
			p = n
			q = x - n
			lc = p * q // gcd(p, q)
			if lc < res:
				res = lc
				a = p
				b = q
			p = x // n
			q = x - p
			lc = p * q // gcd(p, q)
			if lc < res:
				res = lc
				a = p
				b = q
	print(a, b)


from functools import reduce
from math import gcd
from math import inf

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
t = int(input())
for _ in range(t):
	n = int(input())
	factor = factors(n)
	ans = inf
	a0 = inf
	for a in factor:
		if ans > a * (n - a) // gcd(a, n - a) and a != 0 and (n - a != 0):
			ans = a * (n - a) // gcd(a, n - a)
			a0 = a
	print(a0, n - a0)


import sys

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

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

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 Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 19
MOD = 10 ** 9 + 7

def divisors(N: int) -> set:
	from math import sqrt
	s = {1, N}
	for i in range(2, int(sqrt(N)) + 1):
		if N % i == 0:
			s.add(i)
			s.add(N // i)
	return s
for _ in range(INT()):
	N = INT()
	divs = sorted(divisors(N), reverse=1)[1:]
	a = divs[0]
	b = N - divs[0]
	print(a, b)


def main(n):
	if not n % 2:
		return str(n // 2) + ' ' + str(n // 2)
	else:
		lst = {}
		for i in range(int(n ** 0.5) + 1, 0, -1):
			if n % i == 0:
				val = max(i, n // i)
				if max(i, n - i) <= max(val, n - val):
					lst[max(i, n - i)] = i
				else:
					lst[max(val, n - val)] = val
		a = min(lst.keys())
		return str(lst[a]) + ' ' + str(n - lst[a])
for _ in range(int(input())):
	print(main(int(input())))


import math

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

def prime_factor(n):
	factor = []
	while not n % 2:
		factor.append(2)
		n /= 2
	for i in range(3, int(math.sqrt(n)) + 3, 2):
		while not n % i:
			factor.append(i)
			n /= i
	if n > 2:
		factor.append(n)
	return list(set(factor))
test_case = int(input())
for _ in range(test_case):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		factor = prime_factor(n)
		print(n // min(factor), n - n // min(factor))


for x in range(int(input())):
	z = int(input())
	a = 0
	for i in range(2, 100000):
		if z % i == 0:
			a = z // i
			break
	print(max(1, a), z - max(1, a))


from math import *

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

def solve(n):
	a = 2
	b = 1
	while a * a <= n:
		if n % a == 0:
			b = n // a
			break
		a += 1
	return ' '.join(map(str, [n - b, b]))

def main():
	[print(solve(int(input()))) for i in range(int(input()))]
main()


import math as ma
t = int(input())
while t:
	n = int(input())
	div = int(ma.sqrt(n))
	key = 0
	for i in range(2, div + 1):
		if n % i == 0:
			key = i
			break
	if key == 0:
		print(n - 1, 1)
	else:
		k = n / key
		print(int(n / key), int(n - k))
	t = t - 1


from math import *
from sys import *
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	g = -1
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			g = i
			break
	if g == -1:
		print(n - 1, 1)
		continue
	a = n // g
	b = n // g * (g - 1)
	print(a, b)


import math
t = int(input())
while t > 0:
	n = int(input())
	m = math.sqrt(n)
	p = 2
	f = 0
	while p <= m:
		if n % p == 0:
			break
		p += 1
	if p <= m:
		print(n // p, end=' ')
		print(n - n // p)
	else:
		print(1, end=' ')
		print(n - 1)
	t -= 1


n = int(input())
arr = []

def the_smallest(r):
	for j in range(2, int(r ** (1 / 2)) + 1):
		if r % j == 0:
			return [r // j, r // j * (j - 1)]
	return [1, r - 1]
for i in range(n):
	arr.append(the_smallest(int(input())))
for i in range(len(arr)):
	print(arr[i][0], arr[i][1])


import math
for i in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		l = []
		i = 1
		while i <= math.sqrt(n):
			if n % i == 0:
				if n // i == i:
					l.append(i)
				else:
					l.append(n // i)
					l.append(i)
			i += 1
		l.sort()
		print(l[-2], n - l[-2])


import math
t = int(input())
for i in range(t):
	n = int(input())
	m = int(math.sqrt(n)) + 1
	k = u = v = 0
	for j in range(1, m):
		if n % j == 0:
			x = j * (n - j) / math.gcd(j, n - j)
			if (k == 0) | (x < k):
				k = x
				u = j
				v = n - j
			if j == 1:
				continue
			y = n // j
			x = y * (n - y) / math.gcd(y, n - y)
			if (k == 0) | (x < k):
				k = x
				u = y
				v = n - y
	print(u, v)


import sys
input = sys.stdin.readline
from math import sqrt
for T in range(int(input())):
	n = int(input())
	temp = n
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		res = []
		for i in range(3, int(sqrt(n)) + 1, 2):
			if n % i == 0:
				while n % i == 0:
					res.append(i)
					n //= i
		if n > 1:
			res.append(n)
		if len(res) > 1:
			ans = 1
			for i in range(1, len(res)):
				ans *= res[i]
			print(ans, temp - ans)
		else:
			print(1, n - 1)


import math

def primefactors(n):
	l = []
	while n % 2 == 0:
		(l.append(2),)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n / i
	if n > 2:
		l.append(n)
	return l

def solve(n):
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		s = primefactors(n)
		if len(s) == 1:
			print(1, n - 1)
		else:
			l = len(s) - 1
			p = 1
			while l > 0:
				p *= s[l]
				l -= 1
			print(int(p), int(n - p))
t = int(input())
for i in range(t):
	solve(int(input()))


n = int(input())
for i in range(n):
	num = int(input())
	a = 0
	b = 0
	for j in range(1, int(num ** 0.5)):
		aux = 1 + j
		if num % aux == 0:
			a = int(num / aux)
			b = a * j
			break
	if a == 0:
		a = 1
		b = num - 1
	print(a, b)


import math

def func(n: int) -> tuple:
	end = 0
	a = 1
	b = n - 1
	for i in range(2, int(math.sqrt(n)) + 1):
		if (n - i) % i != 0:
			continue
		max_end = max(int(n / i), i)
		if end < max_end:
			end = max_end
			a = max_end
			b = n - max_end
	return (a, b)
n = int(input())
for i in range(n):
	t = int(input())
	(a, b) = func(t)
	print(a, b)


import math
t = int(input())
for i in range(t):
	lst1 = []
	n = int(input())
	if n % 2 == 0:
		print(n // 2, end=' ')
		print(n // 2)
	else:
		for i in range(1, int(math.sqrt(n)) + 1, 2):
			if n % i == 0:
				lst1.append(i)
				lst1.append(n // i)
		if len(lst1) == 2:
			print(n - 1, end=' ')
			print(1)
		else:
			a = (lst1[2] - 1) / lst1[2]
			m = a * n
			print(int(m), end=' ')
			print(n // lst1[2])


from sys import stdin, exit, setrecursionlimit
from collections import deque
setrecursionlimit(10000000)
from math import *
from collections import deque
input = stdin.readline
lmi = lambda : list(map(int, input().split()))
mi = lambda : map(int, input().split())
si = lambda : input().strip('\n')
ssi = lambda : input().strip('\n').split()

def lcm(a, b):
	tmp = gcd(a, b)
	return a * b // tmp
for _ in range(int(input())):
	n = int(input())
	on = n
	factors = []
	for i in range(2, int(n ** 0.5) + 1):
		while n % i == 0:
			n //= i
			factors.append(i)
	if n != 1:
		factors.append(n)
	ans = on - 1
	minlcm = on - 1
	for i in factors:
		tmp = lcm(on // i, on - on // i)
		if tmp < minlcm:
			minlcm = tmp
			ans = on // i
	print(ans, on - ans)


import math
from sys import stdin, stdout
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	flag = 0
	if n % 2 == 0:
		print(n // 2, n // 2, sep=' ')
	else:
		i = 3
		ans1 = i
		while i < int(math.sqrt(n)) + 1:
			if n % i == 0:
				ans1 = n // i
				ans2 = (i - 1) * (n // i)
				flag = 1
				break
			i = i + 2
		if flag != 1:
			print(1, n - 1, sep=' ')
		else:
			print(ans1, ans2, sep=' ')


from itertools import islice

def primes():
	if hasattr(primes, 'D'):
		D = primes.D
	else:
		primes.D = D = {}

	def sieve():
		q = 2
		while True:
			if q not in D:
				yield q
				D[q * q] = [q]
			else:
				for p in D[q]:
					D.setdefault(p + q, []).append(p)
				del D[q]
			q += 1
	return sieve()
t = int(input())
for _ in range(t):
	n = int(input())
	gen = primes()
	pr = next(gen)
	while n % pr != 0 and pr <= int(n ** 0.5):
		pr = next(gen)
	if pr <= int(n ** 0.5):
		a = n // pr
		b = n - a
		print(a, b)
	else:
		print(1, n - 1)


from collections import deque
from math import *
import heapq

def printDivisors(n):
	l = []
	i = 1
	while i <= sqrt(n):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.extend([i, n // i])
		i = i + 1
	return l
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		ll = printDivisors(n)
		ll.sort()
		print(ll[-2], n - ll[-2])


import math

def get_factors(n):
	arr = []
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			arr.append(i)
			n = n // i
	if n > 2:
		arr.append(n)
	return arr
test = int(input())
for _ in range(test):
	n = int(input())
	if n % 2 == 0:
		d = n // 2
		print(d, ' ', d)
	else:
		fac = get_factors(n)
		if len(fac) == 1:
			print(n - 1, ' ', 1)
		else:
			a1 = fac[0]
			a2 = n // a1
			print(a2, ' ', a2 * (a1 - 1))


t = int(input())
import math
while t > 0:
	t -= 1
	n = int(input())
	if n % 2 == 0:
		a = n // 2
		print(a, a)
		continue
	else:
		i = 3
		flag = 0
		while i * i <= n:
			if n % i == 0:
				flag = 1
				temp = i
				break
			i += 2
		if flag != 1:
			temp = n
		a = n // temp
		b = n - a
		print(a, b)


import sys
input = lambda : sys.stdin.readline().strip()
char = [chr(i) for i in range(97, 123)]
CHAR = [chr(i) for i in range(65, 91)]
mp = lambda : list(map(int, input().split()))
INT = lambda : int(input())
rn = lambda : range(INT())
from math import ceil, sqrt, factorial, gcd
for _ in rn():
	n = INT()
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		k = int(n ** (1 / 2)) + 1
		ans = 1
		while k > 1:
			if n % k == 0:
				ans = max(k, n // k)
			k -= 1
		print(ans, n - ans)


def maths(n):
	r1 = []
	p = 0
	for m in range(2, 100000):
		if n % m == 0:
			p = m
			break
	if p == 0:
		p = n
	r1.append(str(n // p))
	r1.append(str(n - n // p))
	r2 = ' '.join(r1)
	return r2
t = int(input())
for i in range(t):
	n = int(input())
	print(maths(n))


import math

def isprime(n):
	d = 2
	while d <= math.sqrt(n) and n % d != 0:
		d += 1
	if d > math.sqrt(n):
		return True
	else:
		return False
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif isprime(n):
		print(1, n - 1)
	else:
		nexus = 3
		while True:
			if n % nexus == 0:
				break
			else:
				nexus += 1
		print(n // nexus, n - n // nexus)


for s in [*open(0)][1:]:
	n = int(s)
	i = 2
	while i * i <= n and n % i:
		i += 1
	a = n % i > 0 or n // i
	print(+a, n - a)


import math
import sys
input = sys.stdin.readline
t = int(input())

def lcm(a, b):
	return a * (b // math.gcd(a, b))
for cs in range(t):
	n = int(input())
	cur = 1
	(ans, opt) = (n + 1, 0)
	div = []
	while cur * cur <= n:
		if n % cur == 0:
			div.append(cur)
			if cur * cur != n:
				div.append(n // cur)
		cur += 1
	for i in div:
		if i == n:
			continue
		if ans > lcm(i, n - i):
			ans = lcm(i, n - i)
			opt = i
	print(opt, n - opt)


x = int(input())

def isprime(n):
	for a in range(2, int(n ** 0.5) + 1):
		if n % a == 0:
			return a
	return True
for a in range(x):
	y = int(input())
	r = isprime(y)
	if r == True:
		print('1 ' + str(y - 1))
	else:
		print(str(y // r) + ' ' + str(y - y // r))


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

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

def prime(n):
	if n < 3:
		return 1
	i = 2
	while i * i <= n:
		if n % i == 0:
			return False
	else:
		return True

def give(n):
	if n % 2 == 0:
		return [n // 2, n // 2]
	ans = [1, n - 1]
	mn = n - 1
	i = 2
	while i * i <= n:
		if n % i == 0:
			if mn > lcm(n // i, n // i * (i - 1)):
				mn = lcm(n // i, n // i * (i - 1))
				ans = [n // i, n - n // i]
		i += 1
	return ans
for _ in range(int(input())):
	n = int(input())
	print(*give(n))


from math import ceil
for _ in range(int(input())):
	n1 = int(input())
	if n1 % 2 == 0:
		print(n1 // 2, n1 // 2)
		continue
	n = n1
	p = -1
	flag = 0
	for i in range(2, ceil(n ** 0.5) + 1):
		if n % i == 0:
			p = i
			flag = 1
			break
	if flag == 0:
		print(1, n1 - 1)
	else:
		ans = n1 // p
		print(ans, n1 - ans)


import sys, io, os, time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect, math, heapq
alphabet = 'abcdefghijklmnopqrstuvwxyz'
input = sys.stdin.readline

def solve():
	n = int(input())
	k = 1
	i = 2
	while i * i <= n:
		if n % i == 0:
			k = n // i
			break
		i += 1
	print(k, n - k)
for ii in range(int(input())):
	solve()


for i in range(int(input())):
	n = int(input())
	i = 2
	while i * i <= n and n % i > 0:
		i += 1
	if i * i < n + 1:
		print(n // i, n - n // i)
	else:
		print(1, n - 1)


from math import gcd, sqrt
for _ in range(int(input())):
	a = int(input())
	if a % 2 == 0:
		print(a // 2, a // 2)
	else:
		(r, t) = (1, a - 1)
		l = a - 1
		for i in range(2, int(sqrt(a)) + 1):
			if a % i == 0:
				r = int(a / i)
				t = int(a - r)
				break
		print(r, t)


from math import gcd, sqrt

def lcm(a, b):
	return a * b // gcd(a, b)
for _ in range(int(input())):
	n = int(input())
	minn = 10 ** 9
	a = 1
	b = n - 1
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			if lcm(n // i, (i - 1) * n // i) < minn:
				minn = lcm(n // i, (i - 1) * n // i)
				a = n // i
				b = (i - 1) * n // i
	print(a, b)


n = int(input())

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

def main():
	n = int(input())
	divs = sorted(make_divisors(n))
	x = divs[-2]
	return (x, n - x)
ans = []
for _ in range(n):
	a = main()
	ans.append(a)
for a in ans:
	print(*a)


t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(str(n // 2) + ' ' + str(n // 2))
	else:

		def smallestDivisor(n):
			if n % 2 == 0:
				return 2
			i = 3
			while i * i <= n:
				if n % i == 0:
					return i
				i += 2
			return n
		a = smallestDivisor(n)
		print(str(n // a) + ' ' + str(n - n // a))


for i in range(int(input())):
	n = int(input())
	a = 0
	b = 0
	c = 0
	if n % 2 == 0:
		a = n // 2
		b = n // 2
	elif n % 3 == 0:
		a = n // 3
		b = n - a
	else:
		for i in range(2, 10 ** 5):
			if n % i == 0:
				a = n // i
				b = n - a
				c = 1
				break
		if c == 0:
			a = 1
			b = n - a
	print(a, b)


import math

def algo(n):
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		i = 2
		while i * i <= n:
			if n % i == 0:
				print(n // i, n - n // i)
				return
			i += 1
		print(1, n - 1)
for _ in range(int(input())):
	n = int(input())
	algo(n)


import math

def get_lcm(n1, n2):
	gcd = math.gcd(n1, n2)
	result = n1 * n2 // gcd
	return result

def factor(num):
	f = []
	for i in range(2, int(num ** 0.5) + 1):
		if num % i == 0:
			f.append(i)
			f.append(num // i)
	return f
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		ans = n - 1
		factors = factor(n)
		for i in factors:
			lcm = get_lcm(i, n - i)
			ans = min(ans, lcm)
		print(n - ans, ans)


for _ in range(int(input())):
	n = int(input())
	i = 2
	g = -1
	while i * i <= n:
		if n % i == 0:
			g = n // i
			break
		i += 1
	if g == -1:
		print(1, n - 1)
	else:
		v = n // g - 1
		print(g, g * v)


import sys

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

def func(n):
	res = []
	for i in range(2, int(n ** 0.5 + 1)):
		if n % i == 0:
			return (n // i, n - n // i)
	return (1, n - 1)
	return res
t = int(input())
for i in range(t):
	n = int(input())
	res = func(n)
	for i in res:
		print(i, end=' ')
	print()


import math
t = int(input())
num = 1

def smallestDivisor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return 1
for i in range(t):
	n = int(input())
	flag = 0
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif smallestDivisor(n) == 1:
		print(1, n - 1)
	else:
		print(n // smallestDivisor(n), n - n // smallestDivisor(n))


import math
from collections import defaultdict, deque
from sys import stdin
from bisect import bisect_left, bisect_right

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

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

def getMinPrime(n):
	if n % 2 == 0:
		return 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		if n % i == 0:
			return i
	return 1
for _ in range(int(input())):
	n = int(input())
	p = getMinPrime(n)
	if p >= 2:
		num = n // p
		print(num, (p - 1) * num)
	else:
		print(1, n - 1)


def prime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
			break
	return True
for t in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif prime(n):
		print(1, n - 1)
	else:
		for k in range(1, n):
			if n % (k + 1) == 0:
				print(n // (k + 1), k * (n // (k + 1)))
				break


import math

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
for i in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		max_val = int(math.sqrt(n))
		champ = 1
		for i in range(2, max_val + 2):
			if n % i == 0:
				champ = max(champ, i, n // i)
		print(champ, n - champ)


import math
t = int(input())
while t > 0:
	n = int(input())
	k = n // 2
	if n % 2 == 0:
		print(k, k)
	else:
		flag = 0
		h = int(math.sqrt(n))
		for i in range(2, h + 1):
			if n % i == 0:
				print(n // i, n - n // i)
				flag = 1
				break
		if flag == 0:
			print(1, n - 1)
	t = t - 1


t = int(input())
for i in range(t):
	n = int(input())
	x = n
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		l = []
		for j in range(2, int(n ** 0.5) + 1):
			if n % j == 0:
				l.append(j)
				if n // j != j:
					l.append(n // j)
		l.sort(reverse=True)
		if len(l) == 0:
			print(1, n - 1)
		else:
			a = True
			for j in range(len(l)):
				if (n - l[j]) % l[j] == 0:
					print(n - l[j], l[j])
					a = False
					break
			if a:
				print(1, n - 1)


def compute(N):
	if N % 2 == 0:
		return (N // 2, N // 2)
	else:
		for i in range(2, int(N ** 0.5) + 1):
			if N % i == 0:
				return (N // i, N - N // i)
		return (N - 1, 1)
for i in range(int(input())):
	N = int(input())
	print(*compute(N))


import sys
sys.setrecursionlimit(10 ** 5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

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

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

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

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]
for _ in range(II()):
	a = II()
	for d in range(2, a + 1):
		if d ** 2 > a:
			print(1, a - 1)
			break
		if a % d == 0:
			print(a // d, a - a // d)
			break


t = int(input())
l = []
for i in range(t):
	l.append(int(input()))
for i in range(t):
	for j in range(2, l[i] + 1):
		if l[i] % j == 0 and j * j <= l[i]:
			print('%d %d' % (l[i] / j, l[i] - l[i] / j))
			break
		if j * j > l[i]:
			print(1, l[i] - 1)
			break


import sys
import os
from io import BytesIO, IOBase

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

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

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

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

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def ddi():
	return defaultdict(int)

def ddl():
	return defaultdict(list)

def ddd():
	return defaultdict(defaultdict(int))
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.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
from math import gcd, pi, inf

def calc(a, b):
	if b <= 1:
		return float('inf')
	else:
		return a * (b - 1)
for _ in range(ii()):
	n = ii()
	res = n - 1
	ans = (1, n - 1)
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			(a, b) = (i, n // i)
			if b > 1 and a * (b - 1) < res:
				res = a * (b - 1)
				ans = (a, a * (b - 1))
			if a > 1 and b * (a - 1) < res:
				res = b * (a - 1)
				ans = (b, b * (a - 1))
	print(*ans)


import math
for tt in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		ele = int(math.sqrt(n))
		s = 1
		for i in range(2, ele + 1):
			if n % i == 0:
				s = i
				break
		if s == 1:
			print(1, n - 1)
		else:
			print(n // s, n - n // s)


def factors(n):
	i = 1
	while i * i <= n:
		if n % i == 0:
			yield i
			yield (n // i)
		i += 1
for t in range(int(input())):
	n = int(input())
	s = sorted(list(factors(n)))[-2]
	print(s, n - s)


from sys import stdin
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	if not n % 2:
		print(n // 2, n // 2)
	else:
		x = -1
		for i in range(3, int(n ** 0.5) + 1, 2):
			if not n % i:
				x = i
				break
		if x == -1:
			print(1, n - 1)
		else:
			print(n * (x - 1) // x, n - n * (x - 1) // x)


for _ in range(int(input())):
	n = int(input())
	ok = False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			ok = True
			print(n // i, n - n // i)
			break
	if not ok:
		print(1, n - 1)


from functools import reduce

def factors(n):
	return list(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
for _ in range(int(input())):
	n = int(input())
	nmax = float('inf')
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		x = factors(n)
		x.sort()
		print(x[-2], n - x[-2])


import sys
import math
from decimal import *

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

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

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

def solve():
	tt = I()
	for ii in range(tt):
		n = I()
		ans = 1
		xx = int(math.ceil(math.sqrt(n)))
		lcm = n - 1
		for i in range(2, xx + 1):
			x = i
			y = n // x
			if x * y == n and y > 1 and (x > 1):
				tmp = max(x, n - x)
				if tmp < lcm:
					lcm = tmp
					ans = x
				tmp = max(y, n - y)
				if tmp < lcm:
					lcm = tmp
					ans = y
		print(ans, n - ans)
		pass
solve()


def solve(n):
	min_b = n - 1
	min_a = 1
	i = 2
	while i * i <= n:
		if n % i == 0:
			a = n // i
			b = n - a
			if b % a == 0 and b < min_b:
				min_a = a
				min_b = b
		i += 1
	return (min_a, min_b)
t = int(input())
for i in range(t):
	n = int(input())
	(a, b) = solve(n)
	print(a, b)


import sys
input = sys.stdin.readline

def prime_factor(n):
	factors = []
	f = 2
	while n % 2 == 0:
		factors.append(f)
		n //= f
	f = 3
	while f * f <= n:
		if n % f == 0:
			factors.append(f)
			n //= f
		else:
			f += 2
	if n != 1:
		factors.append(n)
	return factors
for _ in range(int(input())):
	n = int(input())
	if n & 1 == 0:
		print(n // 2, n // 2)
	else:
		fact = prime_factor(n)
		fact.sort()
		val = 1
		for j in fact[1:]:
			val *= j
		if len(fact) == 1:
			print(1, fact[0] - 1)
			continue
		a = n - val
		b = val
		print(a, b)


import math

def is_prime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def prime_factors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
		break
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			break
			n = n / i
	if n > 2:
		l.append(n)
	return l
for i in range(int(input())):
	a = int(input())
	if a % 2 == 0:
		print(a // 2, a // 2)
	elif is_prime(a):
		print(1, a - 1)
	else:
		l = prime_factors(a)
		print(a // l[0], a - a // l[0])


def highest(num):
	for i in range(2, int(n ** 0.5) + 1):
		if num % i == 0:
			return num // i
	return 1
for test in range(int(input())):
	n = int(input())
	high = highest(n)
	print(high, n - high)


import math as m

def isprime(n):
	for i in range(2, int(m.sqrt(n)) + 1):
		if n % i == 0:
			return False
			break
	return True
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif isprime(n):
		print(1, n - 1)
	else:
		for i in range(3, n, 2):
			if n % i == 0:
				print(n // i, n - n // i)
				break


from math import gcd
t = int(input())
while t > 0:
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		k = 3
		while k * k <= n:
			if n % k == 0:
				print(n // k, n - n // k)
				break
			k += 2
		else:
			print(1, n - 1)
	t -= 1


import sys
input = sys.stdin.readline
import math

def make_divisors(n):
	divisors = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			divisors.append(i)
			if i != n // i:
				divisors.append(n // i)
	divisors.sort()
	return divisors

def main():
	t = int(input())
	for _ in range(t):
		N = int(input())
		if N % 2 == 0:
			print(N // 2, N // 2)
		else:
			divs = make_divisors(N)
			x = float('inf')
			for a in divs:
				if a == N:
					break
				b = N - a
				x = min(x, a * b // math.gcd(a, b))
			for a in divs:
				b = N - a
				if x == a * b // math.gcd(a, b):
					print(a, b)
					break
main()


import sys
import bisect
import math as mt
input = sys.stdin.readline
t = int(input())
mod = 10 ** 9 + 7
for _ in range(t):
	n = int(input())
	n1 = mt.ceil(mt.sqrt(n))
	i = 2
	(a, b) = (1, n - 1)
	mini = n - 1
	while i <= n1:
		if n % i == 0:
			if n - i > 0:
				if mini > i * (n - i) // mt.gcd(i, n - i):
					mini = i * (n - i) // mt.gcd(i, n - i)
					(a, b) = (i, n - i)
			if n - n // i > 0:
				x = n // i
				if mini > x * (n - x) // mt.gcd(x, n - x):
					mini = x * (n - x) // mt.gcd(x, n - x)
					(a, b) = (x, n - x)
		i += 1
	if mini != n - 1:
		print(a, b)
	else:
		print(1, n - 1)


def get_smallest_divisor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n
t = int(input())
for _ in range(t):
	n = int(input())
	a = n // get_smallest_divisor(n)
	print(f'{a} {n - a}')


import math

def main(read_in):
	out_list = []
	for n in read_in:
		out = [1, n - 1]
		for i in range(2, 1 + int(math.sqrt(n))):
			if n % i == 0:
				a = n // i
				b = n - a
				out = [a, b]
				break
		out_list.append(out)
	return out_list

def read_lines_input():
	read_in = []
	n = int(input())
	for i in range(n):
		s = input()
		read_in.append(int(s))
	return read_in

def print_list(out_list):
	[print(str(s[0]) + ' ' + str(s[1])) for s in out_list]
read_in = read_lines_input()
out_list = main(read_in)
print_list(out_list)


import math, sys, bisect, heapq
from collections import defaultdict, Counter, deque
from itertools import groupby, accumulate
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))

def Y(c):
	print(['NO', 'YES'][c])

def y(c):
	print(['no', 'yes'][c])

def Yy(c):
	print(['No', 'Yes'][c])

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

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

def isprime(n):
	n = abs(int(n))
	if n < 2:
		return False
	if n == 2:
		return True
	if not n & 1:
		return False
	for x in range(3, int(n ** 0.5) + 1, 2):
		if n % x == 0:
			return False
	return True
for _ in range(int(input())):
	N = int(input())
	if N % 2 == 0:
		print(N // 2, N // 2)
	elif isprime(N):
		print(N - 1, 1)
	else:
		for i in prime:
			if N % i == 0:
				y = i // 2
				x = N // i
				z1 = i
				z2 = N - i
				r1 = x
				r2 = N - x
				f1 = N
				f2 = N - 1
				m = lcm(z1, z2)
				n = lcm(r1, r2)
				o = lcm(f1, f2)
				mini = min(m, n, o)
				if mini == m:
					print(z1, z2)
				elif mini == n:
					print(r1, r2)
				else:
					print(f1, f2)
				break


import math
test = int(input())
i = 1
while i <= test:
	n = int(input())
	if n % 2 == 0:
		print(n // 2, end=' ')
		print(n // 2)
	else:
		a1 = 1
		a2 = n - 1
		n1 = int(math.sqrt(n))
		for j in range(2, n1 + 1):
			if n % j == 0:
				j1 = j
				j2 = n // j
				if n - j1 < a2:
					a2 = n - j1
					a1 = j1
				if n - j2 < a2:
					a2 = n - j2
					a1 = j2
		print(a1, end=' ')
		print(a2)
	i += 1


def ans(n):
	x = n // 2
	if n % 2 == 0:
		return str(x) + ' ' + str(x)
	a = 1
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			a = i
			break
	if a == 1:
		return '1 ' + str(n - 1)
	p = n // a
	q = n - p
	return str(p) + ' ' + str(q)
for _ in range(int(input())):
	n = int(input())
	print(ans(n))


import math
for _ in range(int(input())):
	n = int(input())
	ans = 1
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		for i in range(2, int(n ** 0.5) + 1):
			if math.gcd(i, n - i) == i:
				ans = n // i
				break
		print(ans, n - ans)


for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:

		def prime(n):
			i = 2
			while i * i <= n:
				if n % i == 0:
					return False
				i += 1
			return True
		if prime(n):
			print(1, n - 1)
		else:
			i = 1
			while 2 * i + 1 < n:
				if n % (2 * i + 1) == 0:
					break
				i += 1
			print(n // (2 * i + 1), n - n // (2 * i + 1))


import sys
import os
import io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return factors

def solve():
	n = int(input())
	factors = prime_factors(n)
	a = 1
	b = factors[0] - 1
	for i in range(1, len(factors)):
		a = a * factors[i]
		b = b * factors[i]
	print(a, b)
test_case = int(input())
for _ in range(test_case):
	solve()


t = int(input())
for tt in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
		continue
	g = 0
	for i in range(3, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			print(n // i, n // i * (i - 1))
			g = 1
			break
	if g == 0:
		print(1, n - 1)


import math
from collections import defaultdict
from sys import stdin, stdout
fi = stdin
fo = stdout
n_test = int(fi.readline())

def solve():
	n = int(fi.readline())
	origin_n = n
	c = defaultdict(int)
	n_sqrt = int(math.sqrt(n) + 1)
	for i in range(2, n_sqrt):
		while n % i == 0:
			n = n // i
			c[i] += 1
	if n > 1:
		c[n] += 1
	c[min(c)] -= 1

	def to_int(counter):
		result = 1
		for (k, v) in counter.items():
			result *= k ** v
		return result
	res = to_int(c)
	print(res, origin_n - res)
for i_test in range(n_test):
	solve()


from math import *
z = int(input())
for q in range(z):
	n = int(input())
	m = []
	for i in range(int(sqrt(n)) + 1, 0, -1):
		if n % i == 0:
			m.append(i)
			l = n // i
			m.append(l)
	x = abs(m[0] - n // 2)
	a = m[0]
	for i in range(1, len(m)):
		y = abs(m[i] - n // 2)
		if y < x:
			a = m[i]
			x = y
	b = n - a
	print(a, end=' ')
	print(b)


for _ in range(int(input())):
	n = int(input())
	res = []
	flag = True
	if n % 2 == 0:
		res.append(n // 2)
		res.append(n // 2)
		print(*res)
	else:
		lim = int(n ** 0.5) + 1
		for i in range(2, lim):
			if n % i == 0:
				res.append(n // i)
				res.append(n - n // i)
				flag = False
				break
		if flag:
			res.append(1)
			res.append(n - 1)
		print(*res)


import os
import sys
from io import BytesIO, IOBase

def all_divisors(n):
	divs = [1]
	if n & 1:
		(start, step) = (3, 2)
	else:
		(start, step) = (2, 1)
	for i in range(start, int(n ** 0.5) + 1, step):
		if n % i == 0:
			if n // i != i:
				divs += [i, n // i]
			else:
				divs += [i]
	return divs

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		if n & 1:
			divs = all_divisors(n)
			minans = 10 ** 9
			minpair = None
			for divisor in divs:
				k = n // divisor - 1
				if divisor * (k + 1) == n:
					if k * divisor < minans:
						minans = k * divisor
						minpair = (divisor, k * divisor)
			print(*minpair)
		else:
			a = n // 2
			print(a, a)
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.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')
main()


import math
t = int(input())
for _ in range(t):
	n = int(input())
	ans = False
	for i in range(2, int(math.sqrt(n) + 1)):
		if n % i == 0:
			print(str(n // i) + ' ' + str(n - n // i))
			ans = True
			break
	if not ans:
		print('1 ' + str(n - 1))


import math as mt
import sys, string
input = sys.stdin.readline
from collections import defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
t = I()
for _ in range(t):
	n = I()
	f = 0
	for i in range(2, int(mt.sqrt(n)) + 1):
		if n % i == 0:
			f = 1
			key = i
			break
	if f:
		print(n // key, n - n // key)
	else:
		print(1, n - 1)


from math import sqrt
t = int(input())
for i in range(t):
	ok = 1
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		for j in range(2, int(sqrt(n)) + 1):
			if n % j == 0:
				print(n // j, n - n // j)
				ok = 0
				break
		if ok:
			print(1, n - 1)


import math

def ans(n):
	if n % 2 == 0:
		return str(n // 2) + ' ' + str(n // 2)
	temp = 1
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			temp = i
			break
	if temp == 1:
		return '1 ' + str(n - 1)
	p1 = n // temp
	p2 = n - p1
	return str(p1) + ' ' + str(p2)
m = int(input())
for i in range(m):
	n = int(input())
	print(ans(n))


from __future__ import division, print_function
from sys import stdin, stdout
import bisect
import math
import heapq
i_m = 9223372036854775807

def inin():
	return int(input())

def stin():
	return input()

def spin():
	return map(int, stin().split())

def lin():
	return list(map(int, stin().split()))

def matrix(n):
	return [list(map(int, input().split())) for i in range(n)]

def count2Dmatrix(i, list):
	return sum((c.count(i) for c in list))

def modinv(n, p):
	return pow(n, p - 2, p)

def GCD(x, y):
	x = abs(x)
	y = abs(y)
	if min(x, y) == 0:
		return max(x, y)
	while y:
		(x, y) = (y, x % y)
	return x

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l
prime = []

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

def dfs(n, d, v, c):
	global q
	v[n] = 1
	x = d[n]
	q.append(n)
	j = c
	for i in x:
		if i not in v:
			f = dfs(i, d, v, c + 1)
			j = max(j, f)
	return j
for _ in range(inin()):
	n = inin()
	(a, b, lcm) = (0, 0, 0)
	temp = 10 ** 9 + 1
	(af, bf) = (0, 0)
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		l = sorted(Divisors(n))
		for i in l:
			if i <= n // 2:
				a = i
				b = n - i
				lcm = a * b // GCD(a, b)
				if lcm < temp:
					temp = lcm
					af = a
					bf = b
		print(af, bf)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	flag = False
	for i in range(2, int(n ** (1 / 2)) + 1):
		if n % i == 0:
			flag = True
			break
	if flag:
		xx = n // i
		print(xx, xx * (i - 1))
	else:
		print(1, n - 1)


for i in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		i = 3
		f = True
		while i <= n // i:
			if n % i == 0:
				print(n // i, (i - 1) * n // i)
				f = False
				break
			i += 2
		if f:
			print(1, n - 1)


t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		i = 2
		flag = 0
		while i * i <= n:
			if n % i:
				i += 1
			else:
				print(n // i, n - n // i)
				flag = 1
				break
		if flag == 0:
			print(1, n - 1)


def is_prime(n):
	if n == 2:
		return True
	if n < 2 or n % 2 == 0:
		return False
	for x in range(3, 1 + int(n ** 0.5), 2):
		if n % x == 0:
			return False
	return True
for _ in range(int(input())):
	n = int(input())
	if is_prime(n):
		print(1, n - 1)
	else:
		i = 2
		while n % i:
			i += 1
		print(n // i, n - n // i)


import sys
import math
from collections import defaultdict as dd
mod = 1000000007

def lcm(x, y):
	return x * y // math.gcd(x, y)
T = 1
T = int(sys.stdin.readline())
for _ in range(T):
	n = int(input())
	if n & 1:
		p = 1
		q = n - 1
		ans = n - 1
		sq = int(math.sqrt(n))
		for i in range(2, sq + 1):
			if n % i == 0:
				p1 = i
				q1 = n - i
				l = lcm(p1, q1)
				if l < ans:
					ans = l
					p = p1
					q = q1
				p1 = n // i
				q1 = n - p1
				l = lcm(p1, q1)
				if l < ans:
					ans = l
					p = p1
					q = q1
		print(p, q)
	else:
		print(n >> 1, n >> 1)


import math
for _ in range(int(input())):
	n = int(input())
	x = n
	ans = 10 ** 10
	t = []
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			if n // i == i:
				t.append(i)
			else:
				t.append(i)
				t.append(n // i)
	t.sort()
	if t:
		print(t[-1], n - t[-1])
	else:
		print(1, n - 1)


for _ in range(int(input())):
	n = int(input())
	ans = (1, n - 1)
	i = 2
	while i * i <= n:
		if n % i == 0:
			x = n // i
			ans = (x, n - x)
			break
		i += 1
	print(*ans)


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

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

def prime(n):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif prime(n):
		print(1, n - 1)
	else:
		for j in p:
			if n % j == 0:
				print(n // j, n - n // j)
				break


import sys
from collections import deque
import heapq
input = lambda : sys.stdin.readline().strip()
ipnut = input
pprint = lambda x: print(' '.join(map(lambda t: str(t + 1), x)))

def mex():
	used = set(a)
	for i in range(n + 1):
		if i not in used:
			return i
for _ in range(int(input())):
	n = int(input())
	f = False
	for i in range(int(n ** 0.5)):
		i += 2
		if n % i == 0:
			print(n // i, n - n // i)
			f = True
			break
	if f:
		pass
	else:
		print(1, n - 1)


for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		found = False
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				found = True
				print(n // i, n - n // i)
				break
		if found == False:
			print(1, n - 1)


from math import gcd
for _ in range(int(input())):
	n = int(input())
	div = [1]
	for i in range(2, int(n ** (1 / 2)) + 1):
		if n % i == 0:
			if i == n // i:
				div.append(i)
			else:
				div.extend([i, n // i])
	print(*sorted([(i * (n - i) // gcd(i, n - i), i, n - i) for i in div], key=lambda x: x[0])[0][1:])


t = int(input())
for q in range(t):
	a = 1
	n = int(input())
	for i in range(2, 100000):
		if n % i == 0:
			a = i
			break
	if a == 1:
		a = n
	print(n // a, n - n // a)


def solve(n, A):
	result = ''
	return result

def main():
	T = int(input())
	for i in range(1, T + 1):
		n = int(input())
		d = 2
		while n % d != 0 and d < n ** (1 / 2):
			d += 1
		if n % d == 0:
			print(n // d, n - n // d)
		else:
			print(1, n - 1)
main()


import math
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif n % 3 == 0:
		print(n // 3, 2 * (n // 3))
	else:
		a = 1
		for i in range(4, int(math.sqrt(n)) + 1):
			if n % i == 0:
				a = i
				a = n // a
				break
		print(a, n - a)


import math
t = int(input())
while t:
	n = int(input())
	if n % 2:
		max1 = 0
		i = 2
		while i <= math.sqrt(n):
			if n % i == 0:
				if n // i == i:
					max1 = max(max1, i)
				else:
					max1 = max(max1, n // i, i)
			i += 1
		if max1 == 0:
			print(1, n - 1)
		else:
			print(max1, n - max1)
	else:
		print(n // 2, n // 2)
	t -= 1


def firstPrime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return i
	return n
for _ in range(int(input())):
	n = int(input())
	fac = firstPrime(n)
	print(n // fac, n - n // fac)


import math

def is_p(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif is_p(n):
		print(1, n - 1)
	else:
		fac = []
		for i in range(2, int(n ** 0.5) + 2):
			if n % i == 0:
				fac.append(i)
				fac.append(n // i)
		fac.sort(reverse=True)
		for i in fac:
			if (n - i) % i == 0:
				print(i, n - i)
				break


def smf(x):
	for i in range(2, x):
		if i * i > x:
			break
		if x % i == 0:
			return i
	return -1
for i in range(int(input())):
	x = int(input())
	a = smf(x)
	if a == -1:
		print(1, x - 1)
	else:
		print(x // a, x - x // a)


import math
import os

def primeFactorize(n):
	factors = []
	for i in range(2, int(math.sqrt(n)) + 1):
		while n % i == 0:
			n = n // i
			factors.append(i)
	if n != 1:
		factors.append(n)
	return sorted(factors, reverse=True)
cases = int(input())
for k in range(cases):
	n = int(input())
	factors = primeFactorize(n)
	a = 1
	index = 0
	for factor in factors:
		if a * factor <= n // 2:
			a *= factor
		else:
			break
	print(f'{a} {n - a}')


import math

def s(n):
	b = n
	i = 1
	mx = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				if i > mx and i != b:
					mx = i
			else:
				if i > mx and i != b:
					mx = i
				if n // i > mx and n // i != b:
					mx = n // i
		i = i + 1
	return mx
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		ans = s(n)
		print(ans, n - ans)


def mindiv(n):
	i = 2
	while i * i <= n:
		if n % i == 0:
			return i
		i += 1
	return n

def solve(n):
	a = n // mindiv(n)
	return (a, n - a)
tests = int(input())
for test in range(tests):
	n = int(input())
	print(*solve(n))


t = int(input())
for i in range(t):
	n = int(input())
	if n % 2:
		g = 1
		for j in range(3, int(n ** 0.5) + 1):
			if n % j == 0:
				g = n // j
				break
		print(str(g) + ' ' + str(n - g))
	else:
		g = n // 2
		print('%d %d' % (g, g))


from math import gcd, ceil

def lcm(a, b):
	return a * b // gcd(a, b)
t = int(input())
for case in range(t):
	n = int(input())
	(a, b) = (n - 1, 1)
	factors = []
	for i in range(2, ceil(n ** 0.5) + 1):
		if n % i == 0:
			(a, b) = (n - n // i, n // i)
			break
	print(a, b)


import math

def main():
	n = int(input())
	a = 1
	for i in range(2, int(math.sqrt(n) + 1)):
		if n % i == 0:
			a = i
			break
	if a == 1:
		print(a, n - 1)
	else:
		print(n // a, n - n // a)
t = int(input())
for i in range(t):
	main()


def make_divisors(n):
	(lower_divisors, upper_divisors) = ([], [])
	i = 1
	while i * i <= n:
		if n % i == 0:
			lower_divisors.append(i)
			if i != n // i:
				upper_divisors.append(n // i)
		i += 1
	return lower_divisors + upper_divisors[::-1]
t = int(input())
for i in range(t):
	n = int(input())
	l = make_divisors(n)
	print(l[-2], n - l[-2])


from math import sqrt
for _ in range(int(input())):
	n = int(input())
	temp = False
	if n % 2 == 0:
		print(n // 2, n // 2)
		temp = True
		continue
	for i in range(3, int(sqrt(n)) + 1, 2):
		if n % i == 0:
			print(n // i, n - n // i)
			temp = True
			break
	if not temp:
		print(1, n - 1)


def find_res(length):
	if length % 2 != 0:
		res = (1, length - 1)
		for i in range(3, int(pow(length, 0.5)) + 1, 2):
			if n % i == 0:
				new_len = n // i
				sub_res = find_res(i)
				res = (sub_res[0] * new_len, sub_res[1] * new_len)
				break
		return res
	else:
		return (length // 2, length // 2)
t = int(input())
for _ in range(t):
	n = int(input())
	res = find_res(n)
	print(res[0], res[1])


def factor_check(n):
	if n % 2 == 0:
		return 2
	if n % 3 == 0:
		return 3
	i = 5
	while i * i <= n:
		if n % i == 0:
			return i
		if n % (i + 2) == 0:
			return i + 2
		i = i + 6

def primality_test(n):
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
for _ in range(int(input())):
	n = int(input())
	start = 1
	end = n - start
	v1 = start
	v2 = end
	no_prime = 0
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif primality_test(n):
		print(v1, v2)
	else:
		divisor = factor_check(n)
		v1 = n // divisor
		v2 = n - v1
		print(v1, v2)


import math
t = int(input())
for i in range(t):
	c = int(input())
	minans = c - 1
	ansa = 1
	ansb = c - 1
	for d in range(1, int(math.sqrt(c) + 1)):
		if c % d == 0:
			n = d - 1
			a = int(c / d)
			if a * (n + 1) == c:
				if a * n < minans and d != 1:
					minans = a * n
					ansa = a
					ansb = a * n
	print(ansa, ansb)


import sys
import math
from collections import Counter
from collections import OrderedDict
from collections import defaultdict
from functools import reduce
sys.setrecursionlimit(10 ** 6)

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

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

def listt():
	return [int(i) for i in inputt().split()]

def gcd(a, b):
	return math.gcd(a, b)

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

def factors(n):
	step = 2 if n % 2 else 1
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(math.sqrt(n)) + 1, step) if n % i == 0)))

def comb(n, k):
	factn = math.factorial(n)
	factk = math.factorial(k)
	fact = math.factorial(n - k)
	ans = factn // (factk * fact)
	return ans

def is_prime(n):
	if n <= 1:
		return False
	if n == 2:
		return True
	if n > 2 and n % 2 == 0:
		return False
	max_div = math.floor(math.sqrt(n))
	for i in range(3, 1 + max_div, 2):
		if n % i == 0:
			return False
	return True
t = int(inputt())
for _ in range(t):
	n = int(inputt())
	k = 1
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif is_prime(n):
		print(k, n - k)
	else:
		n1 = math.ceil(n / 2)
		for i in range(3, n1 + 1, 2):
			if n % i == 0:
				k = n // i
				break
		print(k, n - k)


from sys import *
from math import sqrt
input = lambda : stdin.readline()
int_arr = lambda : list(map(int, stdin.readline().strip().split()))
str_arr = lambda : list(map(str, stdin.readline().split()))
get_str = lambda : map(str, stdin.readline().strip().split())
get_int = lambda : map(int, stdin.readline().strip().split())
get_float = lambda : map(float, stdin.readline().strip().split())
mod = 1000000007
setrecursionlimit(1000)
for _ in range(int(input())):
	n = int(input())
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			print(n // i, n - n // i)
			break
	else:
		print(1, n - 1)


for t in range(int(input())):
	n = int(input())
	i = 2
	if n % 2 == 0:
		print(n // 2, n // 2)
		continue
	while i <= int(1 + n ** 0.5):
		if n % i == 0:
			print(n // i, n - n // i)
			i = 0
			break
		i += 1
	if i:
		print(1, n - 1)


for _ in range(int(input())):
	n = int(input())
	li = [1]
	i = 2
	while i * i <= n:
		if n % i == 0:
			li.append(i)
			li.append(n // i)
		i += 1
	li = sorted(li)
	li = li[::-1]
	for i in li:
		a = i
		b = n - i
		if a % b == 0 or b % a == 0:
			print(a, b)
			break


from math import gcd
from math import ceil
T = int(input())
for _ in range(T):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		rn = ceil(n ** 0.5)
		ans = 1 * (n - 1) // gcd(1, n - 1)
		move = 0
		while rn > 1:
			if n % rn == 0:
				a = n // rn
				b = n - a
				tmp_lcm = a * b // gcd(a, b)
				if tmp_lcm < ans:
					ans = tmp_lcm
					move = a
			rn -= 1
		if move == 0:
			print(1, n - 1)
		else:
			print(ans, n - ans)


def maxdel(n):
	for i in range(2, int(n ** 0.5 + 1)):
		if not n % i:
			return n // i
	return n - 1
for _ in range(int(input())):
	n = int(input())
	if not n % 2:
		print(n // 2, n // 2)
	else:
		a = maxdel(n)
		print(a, n - a)


for tc in range(int(input())):
	n = int(input())
	a = 1
	for i in range(2, int(n ** (1 / 2)) + 1):
		if n % i == 0:
			a = i
			break
	if a == 1:
		print(1, n - 1)
	else:
		print(int(n / a), n - int(n / a))


import math

def is_prime(n):
	for i in range(2, math.trunc(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True
primes = [n for n in range(2, math.trunc(math.sqrt(1000000000)) + 1) if is_prime(n)]

def solve(x):
	for p in primes:
		if x % p == 0:
			print(f'{x // p} {x - x // p}')
			return
	print(f'1 {x - 1}')
t = int(input())
for i in range(t):
	solve(int(input()))


import math
n = int(input())
for i in range(n):
	t = int(input())
	flag = False
	for j in range(2, int(math.sqrt(t)) + 1):
		if t % j == 0:
			print(t // j, t - t // j)
			flag = True
			break
	if not flag:
		print(1, t - 1)


for _ in range(int(input())):
	n = int(input())

	def factors(n):
		s = set()
		i = 1
		while i * i <= n:
			if n % i == 0:
				s.add(i)
				s.add(n // i)
			i += 1
		return sorted(list(s))
	l = factors(n)
	print(l[-2], n - l[-2])


for _ in range(int(input())):
	n = int(input())
	if n & 1:
		x = n
		(a, b) = (0, 0)
		j = 1
		l = 10000000000
		while j * j <= n:
			if n % j == 0:
				(p, q) = (j, n // j)
				if l > max(p, n - p):
					(l, a, b) = (max(p, n - p), p, n - p)
				if l > max(q, n - q):
					(l, a, b) = (max(q, n - q), q, n - q)
			j += 1
		print(a, b)
	else:
		print(n // 2, n // 2)


import sys
input = sys.stdin.readline

def main():
	for t in range(int(input())):
		n = int(input())
		if n % 2 == 0:
			print(n // 2, n // 2)
			continue
		d = 3
		while n % d != 0 and d * d < n:
			d += 2
		if n % d == 0:
			print(n // d, n - n // d)
		else:
			print(1, n - 1)
main()


import math
t = int(input())
while t:
	n = int(input())
	flag = 0
	for i in range(math.floor(math.sqrt(n)), 1, -1):
		if n % i == 0:
			flag = int(max(i, n / i))
	if flag == 0:
		print(1, n - 1)
	else:
		print(flag, n - flag)
	t -= 1


import math
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
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.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')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n
avl = AvlTree()

class SegmentTree1:

	def __init__(self, data, default='z', func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] >= k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater
for i in range(int(input())):
	n = int(input())
	min = n - 1
	a = n - 1
	b = 1
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			r = (i - 1) * (n // i)
			if r < min:
				a = r
				b = n // i
				min = r
			r = (n // i - 1) * i
			if r < min:
				a = r
				b = i
				min = r
	print(a, b)


def func(s):
	for i in range(3, int(s ** 0.5) + 1):
		if s % i == 0:
			return (s // i, i)
	else:
		return (1, s)
for _ in [0] * int(input()):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		(x, y) = func(n)
		print(x, x * (y - 1))


import math

def even(n):
	print(n // 2, n // 2)

def odd(n):
	f = 0
	for i in range(3, int(math.sqrt(n)) + 1):
		if n % i == 0:
			f = 1
			k = n // i
			print(k, n - k)
			break
	if f != 1:
		print(1, n - 1)
t = int(input())
while t:
	n = int(input())
	if n % 2 == 0:
		even(n)
	else:
		odd(n)
	t -= 1


import math

def solve():
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		a = 1
		for i in range(3, int(math.sqrt(n)) + 1, 2):
			if n % i == 0:
				a = n // i
				break
		print(a, n - a)
t = int(input())
for _ in range(t):
	solve()


from collections import Counter
import math
import sys
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

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
for i in range(INT()):
	n = INT()
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif isPrime(n):
		print(1, n - 1)
	else:
		for i in range(3, n):
			if n % i == 0:
				print(n // i, n - n // i)
				break


from math import *

def smallest_pf(n):
	for number in range(3, int(sqrt(n)) + 1):
		if n % number == 0:
			return number
	return n
for _ in range(int(input())):
	n = int(input())
	if n & 1:
		SMP = smallest_pf(n)
		print(n // SMP, n - n // SMP)
	else:
		print(n // 2, n // 2)


import sys
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		j = 1
		op = n
		while j * j <= n:
			if n % j == 0:
				op = min(op, max(j, n - j))
				op = min(op, max(n // j, n - n // j))
			j += 1
		print(op, n - op)


import sys
import math
input = sys.stdin.buffer.readline

def solution():
	for _ in range(int(input())):
		n = int(input())
		l = []
		for i in range(1, int(n ** 0.5) + 1):
			if n % i == 0:
				if n // i == i:
					l.append(i)
				else:
					l.append(i)
					l.append(n // i)
		m = 2000000000.0
		for i in range(len(l)):
			x = l[i]
			y = n - l[i]
			if x > 0 and y > 0 and (x * y // math.gcd(x, y) < m):
				ans1 = x
				ans2 = y
				m = x * y // math.gcd(x, y)
		print(ans1, ans2)
solution()


import math

def factors(x):
	result = []
	i = 1
	max = 0
	while i * i <= x:
		if x % i == 0:
			if i > max:
				max = i
			if x // i != i and x // i != x:
				if x // i > max:
					max = x // i
		i += 1
	return max
for _ in range(int(input())):
	n = int(input())
	res = factors(n)
	a = res
	b = n - a
	print(a, b)


from math import gcd

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		flag = True
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				print(n // i, n - n // i)
				flag = False
				break
		if flag:
			print(n - 1, 1)
main()


import math
t = int(input())
while t > 0:
	n = int(input())
	(a, b) = (0, 0)
	if n % 2 == 0:
		(a, b) = (n // 2, n // 2)
	else:
		i = 2
		while i <= math.pow(n, 0.5):
			if n % i == 0 and n // i > a:
				a = n // i
			i += 1
		if a == 0:
			a = 1
		b = n - a
	print(a, b)
	t -= 1


import os
import sys
from io import BytesIO, IOBase
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.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')
import math
testcases = int(input())
for j in range(testcases):
	n = int(input())
	nums = [1]
	for b in range(2, math.ceil(math.sqrt(n)) + 2):
		if n % b == 0:
			nums.append(b)
			nums.append(n // b)
	if n == 2:
		a = 1
		b = n - a
		ans = [a, b]
		print(*ans)
	else:
		nums.sort()
		a = nums[-1]
		b = n - a
		ans = [a, b]
		print(*ans)


t = int(input())
for test in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
		continue
	flag = False
	k = 3
	while k <= n // k:
		if n % k == 0:
			print(n // k, n - n // k)
			flag = True
			break
		k += 1
	if flag:
		continue
	else:
		print(1, n - 1)


import sys
T = int(sys.stdin.readline())
for _ in range(T):
	n = int(sys.stdin.readline())
	if n % 2:
		res = 1
		for i in range(1, int(n ** 0.5) + 1):
			if i == 1:
				continue
			if n % i == 0:
				res = max(res, i, n // i)
		print(res, n - res)
	else:
		print(n // 2, n // 2)


def reverseLCM(n):
	p = 0
	for i in range(2, 100000 + 1):
		if n % i == 0:
			p = i
			break
	if p == 0:
		p = n
	print(n // p, n - n // p)
t = int(input())
for i in range(t):
	n = int(input())
	reverseLCM(n)


from __future__ import division, print_function
from fractions import Fraction
import sys, bisect, heapq, copyreg, copy, statistics, os
from math import *
from collections import Counter, defaultdict, deque, OrderedDict
from itertools import combinations, permutations, accumulate
from bisect import bisect_left, bisect_right, bisect
from statistics import mode
from functools import reduce
from io import BytesIO, IOBase
from decimal import *
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

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

def graph(vertex):
	return [[] for i in range(vertex + 1)]

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

def most_frequent(List):
	return Counter(List).most_common(1)[0][0]

def most_common(List):
	return mode(List)

def chinese_remainder(a, p):
	prod = reduce(op.mul, p, 1)
	x = [prod // pi for pi in p]
	return sum((a[i] * pow(x[i], p[i] - 2, p[i]) * x[i] for i in range(len(a)))) % prod

def createMatrix(rowCount, colCount, dataList):
	mat = []
	for i in range(rowCount):
		rowList = []
		for j in range(colCount):
			if dataList[j] not in mat:
				rowList.append(dataList[j])
		mat.append(rowList)
	return mat

def readTree():
	v = int(inp())
	adj = [set() for i in range(v + 1)]
	for i in range(v - 1):
		(u1, u2) = In()
		adj[u1].add(u2)
		adj[u2].add(u1)
	return (adj, v)

def sieve():
	li = [True] * 1000001
	(li[0], li[1]) = (False, False)
	prime = []
	for i in range(2, len(li), 1):
		if li[i] == True:
			for j in range(i * i, len(li), i):
				li[j] = False
	for i in range(1000001):
		if li[i] == True:
			prime.append(i)
	return prime

def setBit(n):
	count = 0
	while n != 0:
		n = n & n - 1
		count += 1
	return count

def digitsSum(n):
	if n == 0:
		return 0
	r = 0
	while n > 0:
		r += n % 10
		n //= 10
	return r

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 factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return len(set(factors))

def prefixSum(arr):
	for i in range(1, len(arr)):
		arr[i] = arr[i] + arr[i - 1]
	return arr

def binomial_coefficient(n, k):
	if 0 <= k <= n:
		ntok = 1
		ktok = 1
		for t in range(1, min(k, n - k) + 1):
			ntok *= n
			ktok *= t
			n -= 1
		return ntok // ktok
	else:
		return 0

def powerOfK(k, max):
	if k == 1:
		return [1]
	if k == -1:
		return [-1, 1]
	result = []
	n = 1
	while n <= max:
		result.append(n)
		n *= k
	return result

def kadane(a, size):
	max_so_far = 0
	max_ending_here = 0
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_so_far < max_ending_here:
			max_so_far = max_ending_here
		if max_ending_here < 0:
			max_ending_here = 0
	return max_so_far

def divisors(n):
	result = []
	for i in range(1, ceil(sqrt(n)) + 1):
		if n % i == 0:
			if n / i == i:
				result.append(i)
			else:
				result.append(i)
				result.append(n / i)
	return result

def sumyilln(n):
	return n * (n + 1) // 2

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	for i in range(5, ceil(sqrt(n)) + 1, 6):
		if n % i == 0 or n % (i + 2) == 0:
			return False
	return True

def isPowerOf2(n):
	while n % 2 == 0:
		n //= 2
	return True if n == 1 else False

def power2(n):
	k = 0
	while n % 2 == 0:
		k += 1
		n //= 2
	return k

def sqsum(n):
	return n * (n + 1) * (2 * n + 1) // 6

def cusum(n):
	return sumn(n) ** 2

def pa(a):
	for i in range(len(a)):
		print(a[i], end=' ')
	print()

def pm(a, rown, coln):
	for i in range(rown):
		for j in range(coln):
			print(a[i][j], end=' ')
		print()

def pmasstring(a, rown, coln):
	for i in range(rown):
		for j in range(coln):
			print(a[i][j], end='')
		print()

def isPerfectSquare(n):
	return pow(floor(sqrt(n)), 2) == n

def nC2(n, m):
	return n * (n - 1) // 2 % m

def modInverse(n, p):
	return pow(n, p - 2, p)

def ncrmodp(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def reverse(string):
	return ''.join(reversed(string))

def listtostr(s):
	return ' '.join([str(elem) for elem in s])

def binarySearch(arr, l, r, x):
	while l <= r:
		mid = l + (r - l) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] < x:
			l = mid + 1
		else:
			r = mid - 1
	return -1

def isPalindrome(s):
	return s == s[::-1]

def gt(x, h, c, t):
	return (x * h + (x - 1) * c) / (2 * x - 1)

def CountFrequency(my_list):
	freq = {}
	for item in my_list:
		freq[item] = freq[item] + 1 if item in freq else 1
	return freq

def CountFrequencyasPair(my_list1, my_list2, freq):
	for item in my_list1:
		freq[item][0] = freq[item][0] + 1 if item in freq else 1
	for item in my_list2:
		freq[item][1] = freq[item][1] + 1 if item in freq else 1
	return freq

def binarySearchCount(arr, n, key):
	left = 0
	right = n
	mid = 0
	while left < right:
		mid = (right + left) // 2
		if arr[mid] == key:
			while mid + 1 < n and arr[mid + 1] == key:
				mid += 1
			break
		elif arr[mid] > key:
			right = mid
		else:
			left = mid + 1
	while mid > -1 and arr[mid] > key:
		mid -= 1
	return mid

def primes(n):
	(sieve, l) = ([True] * (n + 1), [])
	for p in range(2, n + 1):
		if sieve[p]:
			l.append(p)
			for i in range(p, n + 1, p):
				sieve[i] = False
	return l

def Next_Greater_Element_for_all_in_array(arr):
	(s, n, reta, retb) = (list(), len(arr), [], [])
	arr1 = [list([0, i]) for i in range(n)]
	for i in range(n - 1, -1, -1):
		while len(s) > 0 and s[-1][0] <= arr[i]:
			s.pop()
		if len(s) == 0:
			arr1[i][0] = -1
		else:
			arr1[i][0] = s[-1]
		s.append(list([arr[i], i]))
	for i in range(n):
		reta.append(list([arr[i], i]))
		retb.append(arr1[i][0])
	return (reta, retb)

class LRUCache:

	def __init__(self, capacity: int):
		self.cache = OrderedDict()
		self.capacity = capacity

	def get(self, key: int) -> int:
		if key not in self.cache:
			return -1
		else:
			self.cache.move_to_end(key)
			return self.cache[key]

	def put(self, key: int, value: int) -> None:
		self.cache[key] = value
		self.cache.move_to_end(key)
		if len(self.cache) > self.capacity:
			self.cache.popitem(last=False)
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')

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

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

def I():
	return inp()

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

def FI():
	return float(inp())

def SI():
	return list(str(inp()))

def MI():
	return map(int, inp().split())

def LI():
	return list(MI())

def MF():
	return map(float, inp().split())

def LF():
	return list(MF())
MOD = 10 ** 9 + 7
mod = 998244353
for _ in range(II()):
	n = II()
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		(r, s) = (factors(n), [])
		for i in range(len(r)):
			if r[i] < n:
				s.append(r[i])
		print(max(s), n - max(s))


import sys
input = sys.stdin.buffer.readline
import os
from math import *
t = int(input())
while t:
	t -= 1
	n = int(input())
	if n % 2 == 0:
		ans = n // 2
		print(ans, ans)
	else:
		dif = 10000000000
		a = 1
		b = n - 1
		z = 0
		for i in range(int(ceil(sqrt(n))), 0, -1):
			if n % i == 0:
				d1 = n // i
				d2 = n - n // i
				if dif > int(fabs(d1 - d2)):
					dif = int(fabs(d1 - d2))
					a = d1
					b = d2
				else:
					z = 1
					print(a, b)
					break
		if z == 0:
			print(1, n - 1)


import math
t = int(input())
for j in range(t):
	n = int(input())

	def is_prime(n):
		for i in range(3, int(math.sqrt(n)) + 1):
			if n % i == 0:
				return n / i
		return 1
	if n % 2 == 0:
		half = int(n / 2)
		y = int(n - half)
		print(half, y)
	else:
		x = int(is_prime(n))
		z = int(n - x)
		print(x, z)


import sys
input = sys.stdin.readline

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

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

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def upper_bound(a, x, lo=0, hi=None):
	if hi == None:
		hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

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

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
for _ in range(int(input())):
	n = int(input())
	x = 1
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			x = n // i
			break
	print(x, n - x)


from math import gcd

def lcm(a, b):
	return a * b // gcd(a, b)
for _ in range(int(input())):
	n = int(input())
	if n == 2:
		print(1, 1)
		continue
	for d in range(2, n):
		if d * d > n:
			print(1, n - 1)
			break
		if n % d == 0:
			x = n // d
			print(x, n - x)
			break


for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		i = 3
		min = n
		while i * i <= n:
			if n % i == 0:
				if i < min:
					min = i
				if n // i < min:
					min = n // i
			i += 2
		print(n // min, n // min * (min - 1))


import math
I = lambda : list(map(int, input().split(' ')))
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, end=' ')
		print(n // 2)
	elif n == 3:
		print('1 2')
	elif n == 5:
		print('1 4')
	else:
		it = int(math.sqrt(n))
		best = None
		for i in range(3, it + 1):
			if n % i == 0:
				best = i
				break
		if best:
			p = best - 1
			print(int(p * n // (p + 1)), end=' ')
			print(int(n // (p + 1)))
		else:
			print('1 ' + str(n - 1))


import io
import os
from collections import Counter, defaultdict, deque

def primeFactors(n):
	assert n >= 1
	factors = Counter()
	while n % 2 == 0:
		factors[2] += 1
		n //= 2
	x = 3
	while x * x <= n:
		while n % x == 0:
			factors[x] += 1
			n //= x
		x += 2
	if n != 1:
		factors[n] += 1
	return factors
import math
DEBUG = False

def solve(N):
	if DEBUG:
		best = (float('inf'),)
		for a in range(1, N):
			b = N - a
			lcm = a * b // math.gcd(a, b)
			best = min(best, (lcm, a, b))
	factors = primeFactors(N)
	sortedKeys = sorted(factors.keys())
	p = sortedKeys[0]
	p1 = 1
	p2 = p - 1
	p1 *= N // p
	p2 *= N // p
	if DEBUG:
		assert p1 + p2 == N
		check = p1 * p2 // math.gcd(p1, p2)
		print((check, p1, p2))
		print(N, best)
		assert best[0] == check
	return str(p1) + ' ' + str(p2)
if DEBUG:
	for i in range(2, 100):
		solve(i)
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
T = int(input())
for t in range(T):
	(N,) = [int(x) for x in input().split()]
	ans = solve(N)
	print(ans)


t = int(input())

def isPrime(x):
	if x == 3 or x == 5 or x == 7:
		return True
	for i in range(3, int(x ** 0.5) + 1):
		if x % i == 0:
			return False
	return True
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(str(int(n / 2)) + ' ' + str(int(n / 2)))
	elif isPrime(n):
		print(str(1) + ' ' + str(n - 1))
	else:
		d = 2
		while n % d != 0 and n > d ** 2:
			d += 1
		D = int(n / d)
		print(str(D) + ' ' + str(n - D))


import math as m
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		flg = 0
		for i in range(2, int(m.sqrt(n)) + 1, 1):
			if n % i == 0:
				print(n // i, n - n // i)
				flg = 1
				break
		if flg == 0:
			print(1, n - 1)


t = int(input())
for i in range(t):
	a = int(input())
	x = 1
	y = 0
	if a % 2 == 0:
		x = a / 2
		y = x
	else:
		for j in range(3, int(a ** 0.5) + 1):
			if a % j == 0:
				x = a // j
				break
		y = a - x
	print(int(x), int(y))


PRIME = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667, 10687, 10691, 10709, 10711, 10723, 10729, 10733, 10739, 10753, 10771, 10781, 10789, 10799, 10831, 10837, 10847, 10853, 10859, 10861, 10867, 10883, 10889, 10891, 10903, 10909, 10937, 10939, 10949, 10957, 10973, 10979, 10987, 10993, 11003, 11027, 11047, 11057, 11059, 11069, 11071, 11083, 11087, 11093, 11113, 11117, 11119, 11131, 11149, 11159, 11161, 11171, 11173, 11177, 11197, 11213, 11239, 11243, 11251, 11257, 11261, 11273, 11279, 11287, 11299, 11311, 11317, 11321, 11329, 11351, 11353, 11369, 11383, 11393, 11399, 11411, 11423, 11437, 11443, 11447, 11467, 11471, 11483, 11489, 11491, 11497, 11503, 11519, 11527, 11549, 11551, 11579, 11587, 11593, 11597, 11617, 11621, 11633, 11657, 11677, 11681, 11689, 11699, 11701, 11717, 11719, 11731, 11743, 11777, 11779, 11783, 11789, 11801, 11807, 11813, 11821, 11827, 11831, 11833, 11839, 11863, 11867, 11887, 11897, 11903, 11909, 11923, 11927, 11933, 11939, 11941, 11953, 11959, 11969, 11971, 11981, 11987, 12007, 12011, 12037, 12041, 12043, 12049, 12071, 12073, 12097, 12101, 12107, 12109, 12113, 12119, 12143, 12149, 12157, 12161, 12163, 12197, 12203, 12211, 12227, 12239, 12241, 12251, 12253, 12263, 12269, 12277, 12281, 12289, 12301, 12323, 12329, 12343, 12347, 12373, 12377, 12379, 12391, 12401, 12409, 12413, 12421, 12433, 12437, 12451, 12457, 12473, 12479, 12487, 12491, 12497, 12503, 12511, 12517, 12527, 12539, 12541, 12547, 12553, 12569, 12577, 12583, 12589, 12601, 12611, 12613, 12619, 12637, 12641, 12647, 12653, 12659, 12671, 12689, 12697, 12703, 12713, 12721, 12739, 12743, 12757, 12763, 12781, 12791, 12799, 12809, 12821, 12823, 12829, 12841, 12853, 12889, 12893, 12899, 12907, 12911, 12917, 12919, 12923, 12941, 12953, 12959, 12967, 12973, 12979, 12983, 13001, 13003, 13007, 13009, 13033, 13037, 13043, 13049, 13063, 13093, 13099, 13103, 13109, 13121, 13127, 13147, 13151, 13159, 13163, 13171, 13177, 13183, 13187, 13217, 13219, 13229, 13241, 13249, 13259, 13267, 13291, 13297, 13309, 13313, 13327, 13331, 13337, 13339, 13367, 13381, 13397, 13399, 13411, 13417, 13421, 13441, 13451, 13457, 13463, 13469, 13477, 13487, 13499, 13513, 13523, 13537, 13553, 13567, 13577, 13591, 13597, 13613, 13619, 13627, 13633, 13649, 13669, 13679, 13681, 13687, 13691, 13693, 13697, 13709, 13711, 13721, 13723, 13729, 13751, 13757, 13759, 13763, 13781, 13789, 13799, 13807, 13829, 13831, 13841, 13859, 13873, 13877, 13879, 13883, 13901, 13903, 13907, 13913, 13921, 13931, 13933, 13963, 13967, 13997, 13999, 14009, 14011, 14029, 14033, 14051, 14057, 14071, 14081, 14083, 14087, 14107, 14143, 14149, 14153, 14159, 14173, 14177, 14197, 14207, 14221, 14243, 14249, 14251, 14281, 14293, 14303, 14321, 14323, 14327, 14341, 14347, 14369, 14387, 14389, 14401, 14407, 14411, 14419, 14423, 14431, 14437, 14447, 14449, 14461, 14479, 14489, 14503, 14519, 14533, 14537, 14543, 14549, 14551, 14557, 14561, 14563, 14591, 14593, 14621, 14627, 14629, 14633, 14639, 14653, 14657, 14669, 14683, 14699, 14713, 14717, 14723, 14731, 14737, 14741, 14747, 14753, 14759, 14767, 14771, 14779, 14783, 14797, 14813, 14821, 14827, 14831, 14843, 14851, 14867, 14869, 14879, 14887, 14891, 14897, 14923, 14929, 14939, 14947, 14951, 14957, 14969, 14983, 15013, 15017, 15031, 15053, 15061, 15073, 15077, 15083, 15091, 15101, 15107, 15121, 15131, 15137, 15139, 15149, 15161, 15173, 15187, 15193, 15199, 15217, 15227, 15233, 15241, 15259, 15263, 15269, 15271, 15277, 15287, 15289, 15299, 15307, 15313, 15319, 15329, 15331, 15349, 15359, 15361, 15373, 15377, 15383, 15391, 15401, 15413, 15427, 15439, 15443, 15451, 15461, 15467, 15473, 15493, 15497, 15511, 15527, 15541, 15551, 15559, 15569, 15581, 15583, 15601, 15607, 15619, 15629, 15641, 15643, 15647, 15649, 15661, 15667, 15671, 15679, 15683, 15727, 15731, 15733, 15737, 15739, 15749, 15761, 15767, 15773, 15787, 15791, 15797, 15803, 15809, 15817, 15823, 15859, 15877, 15881, 15887, 15889, 15901, 15907, 15913, 15919, 15923, 15937, 15959, 15971, 15973, 15991, 16001, 16007, 16033, 16057, 16061, 16063, 16067, 16069, 16073, 16087, 16091, 16097, 16103, 16111, 16127, 16139, 16141, 16183, 16187, 16189, 16193, 16217, 16223, 16229, 16231, 16249, 16253, 16267, 16273, 16301, 16319, 16333, 16339, 16349, 16361, 16363, 16369, 16381, 16411, 16417, 16421, 16427, 16433, 16447, 16451, 16453, 16477, 16481, 16487, 16493, 16519, 16529, 16547, 16553, 16561, 16567, 16573, 16603, 16607, 16619, 16631, 16633, 16649, 16651, 16657, 16661, 16673, 16691, 16693, 16699, 16703, 16729, 16741, 16747, 16759, 16763, 16787, 16811, 16823, 16829, 16831, 16843, 16871, 16879, 16883, 16889, 16901, 16903, 16921, 16927, 16931, 16937, 16943, 16963, 16979, 16981, 16987, 16993, 17011, 17021, 17027, 17029, 17033, 17041, 17047, 17053, 17077, 17093, 17099, 17107, 17117, 17123, 17137, 17159, 17167, 17183, 17189, 17191, 17203, 17207, 17209, 17231, 17239, 17257, 17291, 17293, 17299, 17317, 17321, 17327, 17333, 17341, 17351, 17359, 17377, 17383, 17387, 17389, 17393, 17401, 17417, 17419, 17431, 17443, 17449, 17467, 17471, 17477, 17483, 17489, 17491, 17497, 17509, 17519, 17539, 17551, 17569, 17573, 17579, 17581, 17597, 17599, 17609, 17623, 17627, 17657, 17659, 17669, 17681, 17683, 17707, 17713, 17729, 17737, 17747, 17749, 17761, 17783, 17789, 17791, 17807, 17827, 17837, 17839, 17851, 17863, 17881, 17891, 17903, 17909, 17911, 17921, 17923, 17929, 17939, 17957, 17959, 17971, 17977, 17981, 17987, 17989, 18013, 18041, 18043, 18047, 18049, 18059, 18061, 18077, 18089, 18097, 18119, 18121, 18127, 18131, 18133, 18143, 18149, 18169, 18181, 18191, 18199, 18211, 18217, 18223, 18229, 18233, 18251, 18253, 18257, 18269, 18287, 18289, 18301, 18307, 18311, 18313, 18329, 18341, 18353, 18367, 18371, 18379, 18397, 18401, 18413, 18427, 18433, 18439, 18443, 18451, 18457, 18461, 18481, 18493, 18503, 18517, 18521, 18523, 18539, 18541, 18553, 18583, 18587, 18593, 18617, 18637, 18661, 18671, 18679, 18691, 18701, 18713, 18719, 18731, 18743, 18749, 18757, 18773, 18787, 18793, 18797, 18803, 18839, 18859, 18869, 18899, 18911, 18913, 18917, 18919, 18947, 18959, 18973, 18979, 19001, 19009, 19013, 19031, 19037, 19051, 19069, 19073, 19079, 19081, 19087, 19121, 19139, 19141, 19157, 19163, 19181, 19183, 19207, 19211, 19213, 19219, 19231, 19237, 19249, 19259, 19267, 19273, 19289, 19301, 19309, 19319, 19333, 19373, 19379, 19381, 19387, 19391, 19403, 19417, 19421, 19423, 19427, 19429, 19433, 19441, 19447, 19457, 19463, 19469, 19471, 19477, 19483, 19489, 19501, 19507, 19531, 19541, 19543, 19553, 19559, 19571, 19577, 19583, 19597, 19603, 19609, 19661, 19681, 19687, 19697, 19699, 19709, 19717, 19727, 19739, 19751, 19753, 19759, 19763, 19777, 19793, 19801, 19813, 19819, 19841, 19843, 19853, 19861, 19867, 19889, 19891, 19913, 19919, 19927, 19937, 19949, 19961, 19963, 19973, 19979, 19991, 19993, 19997, 20011, 20021, 20023, 20029, 20047, 20051, 20063, 20071, 20089, 20101, 20107, 20113, 20117, 20123, 20129, 20143, 20147, 20149, 20161, 20173, 20177, 20183, 20201, 20219, 20231, 20233, 20249, 20261, 20269, 20287, 20297, 20323, 20327, 20333, 20341, 20347, 20353, 20357, 20359, 20369, 20389, 20393, 20399, 20407, 20411, 20431, 20441, 20443, 20477, 20479, 20483, 20507, 20509, 20521, 20533, 20543, 20549, 20551, 20563, 20593, 20599, 20611, 20627, 20639, 20641, 20663, 20681, 20693, 20707, 20717, 20719, 20731, 20743, 20747, 20749, 20753, 20759, 20771, 20773, 20789, 20807, 20809, 20849, 20857, 20873, 20879, 20887, 20897, 20899, 20903, 20921, 20929, 20939, 20947, 20959, 20963, 20981, 20983, 21001, 21011, 21013, 21017, 21019, 21023, 21031, 21059, 21061, 21067, 21089, 21101, 21107, 21121, 21139, 21143, 21149, 21157, 21163, 21169, 21179, 21187, 21191, 21193, 21211, 21221, 21227, 21247, 21269, 21277, 21283, 21313, 21317, 21319, 21323, 21341, 21347, 21377, 21379, 21383, 21391, 21397, 21401, 21407, 21419, 21433, 21467, 21481, 21487, 21491, 21493, 21499, 21503, 21517, 21521, 21523, 21529, 21557, 21559, 21563, 21569, 21577, 21587, 21589, 21599, 21601, 21611, 21613, 21617, 21647, 21649, 21661, 21673, 21683, 21701, 21713, 21727, 21737, 21739, 21751, 21757, 21767, 21773, 21787, 21799, 21803, 21817, 21821, 21839, 21841, 21851, 21859, 21863, 21871, 21881, 21893, 21911, 21929, 21937, 21943, 21961, 21977, 21991, 21997, 22003, 22013, 22027, 22031, 22037, 22039, 22051, 22063, 22067, 22073, 22079, 22091, 22093, 22109, 22111, 22123, 22129, 22133, 22147, 22153, 22157, 22159, 22171, 22189, 22193, 22229, 22247, 22259, 22271, 22273, 22277, 22279, 22283, 22291, 22303, 22307, 22343, 22349, 22367, 22369, 22381, 22391, 22397, 22409, 22433, 22441, 22447, 22453, 22469, 22481, 22483, 22501, 22511, 22531, 22541, 22543, 22549, 22567, 22571, 22573, 22613, 22619, 22621, 22637, 22639, 22643, 22651, 22669, 22679, 22691, 22697, 22699, 22709, 22717, 22721, 22727, 22739, 22741, 22751, 22769, 22777, 22783, 22787, 22807, 22811, 22817, 22853, 22859, 22861, 22871, 22877, 22901, 22907, 22921, 22937, 22943, 22961, 22963, 22973, 22993, 23003, 23011, 23017, 23021, 23027, 23029, 23039, 23041, 23053, 23057, 23059, 23063, 23071, 23081, 23087, 23099, 23117, 23131, 23143, 23159, 23167, 23173, 23189, 23197, 23201, 23203, 23209, 23227, 23251, 23269, 23279, 23291, 23293, 23297, 23311, 23321, 23327, 23333, 23339, 23357, 23369, 23371, 23399, 23417, 23431, 23447, 23459, 23473, 23497, 23509, 23531, 23537, 23539, 23549, 23557, 23561, 23563, 23567, 23581, 23593, 23599, 23603, 23609, 23623, 23627, 23629, 23633, 23663, 23669, 23671, 23677, 23687, 23689, 23719, 23741, 23743, 23747, 23753, 23761, 23767, 23773, 23789, 23801, 23813, 23819, 23827, 23831, 23833, 23857, 23869, 23873, 23879, 23887, 23893, 23899, 23909, 23911, 23917, 23929, 23957, 23971, 23977, 23981, 23993, 24001, 24007, 24019, 24023, 24029, 24043, 24049, 24061, 24071, 24077, 24083, 24091, 24097, 24103, 24107, 24109, 24113, 24121, 24133, 24137, 24151, 24169, 24179, 24181, 24197, 24203, 24223, 24229, 24239, 24247, 24251, 24281, 24317, 24329, 24337, 24359, 24371, 24373, 24379, 24391, 24407, 24413, 24419, 24421, 24439, 24443, 24469, 24473, 24481, 24499, 24509, 24517, 24527, 24533, 24547, 24551, 24571, 24593, 24611, 24623, 24631, 24659, 24671, 24677, 24683, 24691, 24697, 24709, 24733, 24749, 24763, 24767, 24781, 24793, 24799, 24809, 24821, 24841, 24847, 24851, 24859, 24877, 24889, 24907, 24917, 24919, 24923, 24943, 24953, 24967, 24971, 24977, 24979, 24989, 25013, 25031, 25033, 25037, 25057, 25073, 25087, 25097, 25111, 25117, 25121, 25127, 25147, 25153, 25163, 25169, 25171, 25183, 25189, 25219, 25229, 25237, 25243, 25247, 25253, 25261, 25301, 25303, 25307, 25309, 25321, 25339, 25343, 25349, 25357, 25367, 25373, 25391, 25409, 25411, 25423, 25439, 25447, 25453, 25457, 25463, 25469, 25471, 25523, 25537, 25541, 25561, 25577, 25579, 25583, 25589, 25601, 25603, 25609, 25621, 25633, 25639, 25643, 25657, 25667, 25673, 25679, 25693, 25703, 25717, 25733, 25741, 25747, 25759, 25763, 25771, 25793, 25799, 25801, 25819, 25841, 25847, 25849, 25867, 25873, 25889, 25903, 25913, 25919, 25931, 25933, 25939, 25943, 25951, 25969, 25981, 25997, 25999, 26003, 26017, 26021, 26029, 26041, 26053, 26083, 26099, 26107, 26111, 26113, 26119, 26141, 26153, 26161, 26171, 26177, 26183, 26189, 26203, 26209, 26227, 26237, 26249, 26251, 26261, 26263, 26267, 26293, 26297, 26309, 26317, 26321, 26339, 26347, 26357, 26371, 26387, 26393, 26399, 26407, 26417, 26423, 26431, 26437, 26449, 26459, 26479, 26489, 26497, 26501, 26513, 26539, 26557, 26561, 26573, 26591, 26597, 26627, 26633, 26641, 26647, 26669, 26681, 26683, 26687, 26693, 26699, 26701, 26711, 26713, 26717, 26723, 26729, 26731, 26737, 26759, 26777, 26783, 26801, 26813, 26821, 26833, 26839, 26849, 26861, 26863, 26879, 26881, 26891, 26893, 26903, 26921, 26927, 26947, 26951, 26953, 26959, 26981, 26987, 26993, 27011, 27017, 27031, 27043, 27059, 27061, 27067, 27073, 27077, 27091, 27103, 27107, 27109, 27127, 27143, 27179, 27191, 27197, 27211, 27239, 27241, 27253, 27259, 27271, 27277, 27281, 27283, 27299, 27329, 27337, 27361, 27367, 27397, 27407, 27409, 27427, 27431, 27437, 27449, 27457, 27479, 27481, 27487, 27509, 27527, 27529, 27539, 27541, 27551, 27581, 27583, 27611, 27617, 27631, 27647, 27653, 27673, 27689, 27691, 27697, 27701, 27733, 27737, 27739, 27743, 27749, 27751, 27763, 27767, 27773, 27779, 27791, 27793, 27799, 27803, 27809, 27817, 27823, 27827, 27847, 27851, 27883, 27893, 27901, 27917, 27919, 27941, 27943, 27947, 27953, 27961, 27967, 27983, 27997, 28001, 28019, 28027, 28031, 28051, 28057, 28069, 28081, 28087, 28097, 28099, 28109, 28111, 28123, 28151, 28163, 28181, 28183, 28201, 28211, 28219, 28229, 28277, 28279, 28283, 28289, 28297, 28307, 28309, 28319, 28349, 28351, 28387, 28393, 28403, 28409, 28411, 28429, 28433, 28439, 28447, 28463, 28477, 28493, 28499, 28513, 28517, 28537, 28541, 28547, 28549, 28559, 28571, 28573, 28579, 28591, 28597, 28603, 28607, 28619, 28621, 28627, 28631, 28643, 28649, 28657, 28661, 28663, 28669, 28687, 28697, 28703, 28711, 28723, 28729, 28751, 28753, 28759, 28771, 28789, 28793, 28807, 28813, 28817, 28837, 28843, 28859, 28867, 28871, 28879, 28901, 28909, 28921, 28927, 28933, 28949, 28961, 28979, 29009, 29017, 29021, 29023, 29027, 29033, 29059, 29063, 29077, 29101, 29123, 29129, 29131, 29137, 29147, 29153, 29167, 29173, 29179, 29191, 29201, 29207, 29209, 29221, 29231, 29243, 29251, 29269, 29287, 29297, 29303, 29311, 29327, 29333, 29339, 29347, 29363, 29383, 29387, 29389, 29399, 29401, 29411, 29423, 29429, 29437, 29443, 29453, 29473, 29483, 29501, 29527, 29531, 29537, 29567, 29569, 29573, 29581, 29587, 29599, 29611, 29629, 29633, 29641, 29663, 29669, 29671, 29683, 29717, 29723, 29741, 29753, 29759, 29761, 29789, 29803, 29819, 29833, 29837, 29851, 29863, 29867, 29873, 29879, 29881, 29917, 29921, 29927, 29947, 29959, 29983, 29989, 30011, 30013, 30029, 30047, 30059, 30071, 30089, 30091, 30097, 30103, 30109, 30113, 30119, 30133, 30137, 30139, 30161, 30169, 30181, 30187, 30197, 30203, 30211, 30223, 30241, 30253, 30259, 30269, 30271, 30293, 30307, 30313, 30319, 30323, 30341, 30347, 30367, 30389, 30391, 30403, 30427, 30431, 30449, 30467, 30469, 30491, 30493, 30497, 30509, 30517, 30529, 30539, 30553, 30557, 30559, 30577, 30593, 30631, 30637, 30643, 30649, 30661, 30671, 30677, 30689, 30697, 30703, 30707, 30713, 30727, 30757, 30763, 30773, 30781, 30803, 30809, 30817, 30829, 30839, 30841, 30851, 30853, 30859, 30869, 30871, 30881, 30893, 30911, 30931, 30937, 30941, 30949, 30971, 30977, 30983, 31013, 31019, 31033, 31039, 31051, 31063, 31069, 31079, 31081, 31091, 31121, 31123, 31139, 31147, 31151, 31153, 31159, 31177, 31181, 31183, 31189, 31193, 31219, 31223, 31231, 31237, 31247, 31249, 31253, 31259, 31267, 31271, 31277, 31307, 31319, 31321, 31327, 31333, 31337, 31357, 31379, 31387, 31391, 31393, 31397, 31469, 31477, 31481, 31489, 31511, 31513, 31517, 31531, 31541, 31543, 31547, 31567, 31573, 31583, 31601, 31607, 31627, 31643, 31649, 31657, 31663, 31667, 31687, 31699, 31721]

def main():
	(n,) = map(int, input().split(' '))
	for z in PRIME:
		if n % z == 0:
			print(n // z, n - n // z)
			return
	print(1, n - 1)
for _ in range(int(input())):
	main()


for i in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		res = 0
		arr = []
		for i in range(3, int(n ** 0.5) + 1):
			if n % i == 0:
				res = i
				arr.append(i)
				arr.append(n // i)
		if len(arr) == 0:
			print(1, n - 1)
		else:
			arr.sort()
			res = arr[-1]
			print(res, n - res)


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():
	pass
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.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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()
import math

def large(n):
	for i in range(2, math.ceil(math.sqrt(n)) + 1):
		if n % i == 0:
			return n // i
	return 1
t = int(input())
for j in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		k = large(n)
		print(k, n - k)


for t in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		r = None
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				r = i
				break
		if r is not None:
			a = n // r
			b = a * (r - 1)
		else:
			(a, b) = (1, n - 1)
		print(a, b)


import sys
import math
from sys import stdin, stdout
from collections import deque, defaultdict
from math import ceil, floor, inf, sqrt, factorial, gcd, log2
from copy import deepcopy
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = int(1000000000.0 + 7)

def factor(n):
	m = int(n ** 0.5) + 1
	ans = []
	for i in range(1, m):
		if n % i == 0:
			ans.append(i)
			ans.append(n // i)
	return ans

def lcm(a, b):
	g = gcd(a, b)
	return a * b // g
for t in range(ii1()):
	n = ii1()
	ans = factor(n)
	ans.sort()
	l = len(ans)
	curr = inf
	for i in range(l):
		a = n - ans[i]
		if a > 0:
			a = lcm(a, ans[i])
			if a < curr:
				(l, r) = (a, ans[i])
				curr = a
	print(l, r)


import math
for _ in range(int(input())):
	n = int(input())
	f = 1
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			f = max(f, i, n // i)
	print(f, n - f)


from math import gcd

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

def main():
	for __ in [0] * int(input()):
		N = int(input())
		div = divisor(N)
		maxa = 1 << 60
		ans = N
		for d in div:
			if d == N:
				continue
			a = d * (N - d) // gcd(d, N - d)
			if maxa > a:
				maxa = a
				ans = d
		print(ans, N - ans)
main()


import math
MAX = 2 * 10 ** 5 + 10
primes = []

def seive():
	p = [True for i in range(2 * 10 ** 5 + 10)]
	for i in range(2, math.ceil(math.sqrt(MAX))):
		j = i
		while j * i < MAX:
			if not p[i * j]:
				p[i * j] = False
			j += 1
	for i in range(2, MAX):
		if p[i]:
			primes.append(i)

def solve(n):
	p = 1
	for i in primes:
		if n % i == 0:
			p = i
			break
		if i > math.ceil(math.sqrt(n)):
			break
	if p != 1:
		k = n // p
	else:
		k = 1
	return ' '.join([str(k), str(n - k)])

def read():
	t = int(input())
	for i in range(t):
		n = int(input())
		ans = solve(n)
		print(ans)
seive()
read()


t = int(input())
for i in range(t):
	n = int(input())
	for x in range(2, 10 ** 5):
		if n % x == 0:
			print(str(n // x) + ' ' + str(n - n // x))
			break
	else:
		print('1 ' + str(n - 1))


import math
t = int(input())
while t:
	t -= 1
	n = int(input())
	k = int(math.sqrt(n)) + 1
	i = 2
	s = -1
	while i <= k:
		if n % i == 0:
			s = n // i
			break
		i += 1
	if s == -1:
		print(1, n - 1)
	else:
		print(s, n - s)


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
t = int(input())
from math import sqrt

def largeDiv(n):
	factors = []
	root = int(sqrt(n))
	for x in range(2, root + 1):
		while n % x == 0:
			n = n // x
			factors.append(x)
	if n > 1:
		factors.append(n)
	return factors
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		factors = largeDiv(n)
		factors.sort(reverse=True)
		ans = 1
		for x in factors[:-1]:
			ans = ans * x
		print(ans, n - ans)


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
from decimal import *
BUFSIZE = 8192
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.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')

def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		if n % 2 == 0:
			print(n // 2, n // 2)
		elif n % 3 == 0:
			print(n // 3, 2 * n // 3)
		else:
			m = 0
			mn = 10 ** 10
			ans = [0] * 2
			for x in range(2, int(math.sqrt(n)) + 1):
				if n % x == 0:
					m = x
					if n // m + (m - 1) * n // m < mn:
						ans[0] = n // m
						ans[1] = (m - 1) * n // m
						mn = ans[0] + ans[1]
			if m == 0:
				print(1, n - 1)
			else:
				print(ans[0], ans[1])
main()


import math

def findB(n):
	for i in range(2, int(math.sqrt(n) + 1)):
		if n % i == 0:
			return n // i
	return n - 1
t = int(input())
for i in range(t):
	n = int(input())
	b = 0
	if n & 1:
		b = findB(n)
	else:
		b = n // 2
	print(n - b, b)


t = int(input())
for test in range(t):
	n = int(input())
	a = 2
	ans = n
	while a * a <= n:
		if n % a == 0:
			ans = a
			break
		a += 1
	print(n // ans, end=' ')
	print(n - n // ans)


import math
for _ in range(int(input())):
	n = int(input())
	a = 0
	b = 0
	f = 0
	if n % 2 == 0:
		print(n // 2, n // 2)
		continue
	for i in range(2, int(n ** 0.5) + 2):
		if n % i == 0:
			a = n // i
			b = n - n // i
			f = 1
			break
	if f == 1:
		print(a, b)
	else:
		print(1, n - 1)


t = int(input())
for i in range(t):
	n = int(input())
	ls = []
	if n % 2 == 0:
		ls = [n // 2, n // 2]
	else:
		for j in range(3, int(n ** 0.5) + 7, 2):
			if n % j == 0:
				ls = [n // j, n - n // j]
				break
		if len(ls) == 0:
			ls = [1, n - 1]
	print(*ls)


from math import *

def r1(t):
	return t(input())

def r2(t):
	return [t(i) for i in input().split()]
for _ in range(r1(int)):
	n = r1(int)
	i = 2
	a = 1
	b = n - 1
	while i * i <= n:
		if n % i == 0:
			t = n // i
			a = max(a, t)
			b = min(b, n - t)
		i += 1
	print(a, b)


from math import *
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		z = int(sqrt(n))
		f = 0
		for i in range(2, z + 1):
			if n % i == 0:
				f += 1
				break
		if f == 0:
			print(1, n - 1)
		else:
			l = [1]
			for i in range(2, z + 1):
				if n % i == 0:
					l.append(i)
					l.append(n // i)
			l = list(set(l))
			l.sort()
			mi = 10 ** 9
			(an, bn) = (0, 0)
			for i in l:
				a = i
				b = n - i
				lc = a * b // gcd(a, b)
				if lc < mi:
					mi = lc
					an = a
					bn = b
			print(an, bn)


import math
t = int(input())
list = []

def isprime(n):
	if n == 2 or n == 3:
		return True
	if n % 2 == 0:
		return Fase
	while d <= n ** 0.5:
		if n % d == 0:
			return False
		if n % (d + 2) == 0:
			return False
	return True
for u in range(1, t + 1):
	n = int(input())
	if n % 2 == 0:
		list.append([int(n / 2), int(n / 2)])
	else:
		u = 3
		while u <= n ** 0.5:
			if n % u != 0:
				u += 2
			else:
				list.append([int(n / u), int(n - n / u)])
				break
		if n % u != 0:
			list.append([1, n - 1])
for x in list:
	print(*x, sep=' ')


t = int(input())
for i in range(t):
	n = int(input())
	fak = 2
	while fak * fak <= n:
		if n % fak == 0:
			break
		fak += 1
	if n % fak != 0:
		fak = 1
		print('1 ' + str(n - 1))
	else:
		print(str(n // fak) + ' ' + str(n - n // fak))


import sys, math, cmath, time
start_time = time.time()

def solve():
	n = inp()
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		q = factors(n)
		if len(q) == 2:
			print(1, n - 1)
		else:
			print(q[-2], n - q[-2])

def main():
	global tt
	if not ONLINE_JUDGE:
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	t = 1
	t = inp()
	for tt in range(t):
		solve()
	if not ONLINE_JUDGE:
		print('Time Elapsed :', time.time() - start_time, 'seconds')
		sys.stdout.close()

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

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

def insr():
	return input().strip()

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

def counter(a, qw):
	q = [0] * qw
	for i in range(len(a)):
		q[a[i] - 1] = q[a[i] - 1] + 1
	return q

def counter_elements(a):
	q = dict()
	for i in range(len(a)):
		if a[i] not in q:
			q[a[i]] = 0
		q[a[i]] = q[a[i]] + 1
	return q

def string_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = (q[ord(a[i]) - 97], 1)
	return q

def factors(n):
	q = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			q.append(i)
			q.append(n // i)
	return list(sorted(list(set(q))))

def prime_factors(n):
	q = []
	while n % 2 == 0:
		q.append(2)
		n = n // 2
	for i in range(3, int(n ** 0.5) + 1, 2):
		while n % i == 0:
			q.append(i)
			n = n // i
	if n > 2:
		q.append(n)
	return list(sorted(q))

def transpose(a):
	b = [[0] * n for i in range(n)]
	for i in range(len(a)):
		for j in range(len(a)):
			b[i][j] = a[j][i]
	return b
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
	input = sys.stdin.readline
main()


from math import sqrt
t = int(input())
while t:
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		index = -1
		for i in range(2, int(sqrt(n)) + 1):
			if n % i == 0:
				print(n // i, n - n // i)
				break
		else:
			print('1', n - 1)
	t = t - 1


production = True
import sys, math, collections

def input(input_format=0, multi=0):
	if multi > 0:
		return [input(input_format) for i in range(multi)]
	else:
		next_line = sys.stdin.readline()[:-1]
		if input_format >= 10:
			use_list = False
			input_format = int(str(input_format)[-1])
		else:
			use_list = True
		if input_format == 0:
			formatted_input = [next_line]
		elif input_format == 1:
			formatted_input = list(map(int, next_line.split()))
		elif input_format == 2:
			formatted_input = list(map(float, next_line.split()))
		elif input_format == 3:
			formatted_input = list(next_line)
		elif input_format == 4:
			formatted_input = list(map(int, list(next_line)))
		elif input_format == 5:
			formatted_input = next_line.split()
		else:
			formatted_input = [next_line]
		return formatted_input if use_list else formatted_input[0]

def out(output_line, output_format=0, newline=True):
	formatted_output = ''
	if output_format == 0:
		formatted_output = str(output_line)
	elif output_format == 1:
		formatted_output = ' '.join(map(str, output_line))
	elif output_format == 2:
		formatted_output = '\n'.join(map(str, output_line))
	print(formatted_output, end='\n' if newline else '')

def log(*args):
	if not production:
		print('$$$', end='')
		print(*args)
enu = enumerate
ter = lambda a, b, c: b if a else c

def mapl(iterable, format=0):
	if format == 0:
		return list(map(int, iterable))
	elif format == 1:
		return list(map(str, iterable))
	elif format == 2:
		return list(map(list, iterable))

def solve():
	n = input(11)
	if n & 1:
		m = 0
		for i in range(3, int(n ** 0.5) + 1):
			if not n % i:
				out([n // i, n - n // i], 1)
				break
		else:
			out([1, n - 1], 1)
	else:
		out([n >> 1] * 2, 1)
	return
for i in range(input(11)):
	solve()


import math
from sys import stdin
from collections import Counter, defaultdict, deque
input = stdin.readline
mod = pow(10, 9) + 7

def factors(n):
	l1 = []
	i = 2
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				l1.append(i)
			else:
				l1.append(i)
				l1.append(n // i)
		i = i + 1
	if len(l1) == 0:
		return 1
	else:
		x = max(l1)
		return x

def solve():
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		x = factors(n)
		print(x, n - x)
for _ in range(int(input())):
	solve()


import sys
input = sys.stdin.readline
scan_int = lambda : int(input())
scan_string = lambda : input().rstrip()
read_list = lambda : list(read())
read = lambda : map(int, input().split())
read_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

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

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

def is_integer(n):
	return math.ceil(n) == math.floor(n)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

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

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

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

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(beauty, s, n, count):
	pass
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
from itertools import permutations
import math
import bisect as bis
import random
import sys
primes = sieve(10 ** 5)

def solve():
	global primes
	n = int(input())
	v = 1
	for i in range(1, int(n ** 0.5) + 1):
		if primes[i] and n % i == 0:
			v = i
			break
	if v == 1:
		print(1, n - 1)
		return
	ans = n // v
	print(n - ans, ans)
for _ in range(int(input())):
	solve()


for _ in range(int(input())):
	n = int(input())
	ans = 0
	for i in range(2, min(100000, n)):
		if n % i == 0:
			ans = i
			break
	if ans == 0:
		ans = n
	print(n // ans, n - n // ans)


from sys import stdin, stdout

def INPUT():
	return list((int(i) for i in stdin.readline().split()))

def inp():
	return stdin.readline()

def out(x):
	return stdout.write(x)
import math
for _ in range(int(input())):
	n = int(input())
	i = 2
	A = []
	while i <= int(math.sqrt(n)):
		if n % i == 0:
			if n // i == i:
				A.append(i)
			else:
				A.append(i)
				A.append(n // i)
		i += 1
	if len(A) == 0:
		print(1, n - 1)
	else:
		ans = 10 ** 12 + 1
		for k in range(len(A)):
			ans = min(ans, max(A[k], n - A[k]))
		print(min(ans, n - ans), max(ans, n - ans))


from math import *
from copy import *
from string import *
from random import *
from sys import stdin, stdout
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
import math
import math
import time
from queue import Queue

def seive(n):
	l = [True]
	l = l * (n + 1)
	for i in range(2, int(sqrt(n)) + 1):
		if l[i] == True:
			val = i * i
			while val < len(l):
				l[val] = False
				val += i
	prime = []
	for i in range(2, len(l)):
		if l[i] == True:
			prime.append(i)
	return prime

def dp(l, i, n, val, ans):
	if i >= n or val < 0:
		return 1000000
	elif val == 0:
		return 0
	else:
		if ans[i] == 1000000:
			ans[i] = min(min(1 + dp(l, i + 1, n, val - l[i], ans), 1 + dp(l, i, n, val - l[i], ans)), dp(l, i + 1, n, val, ans))
		return ans[i]
from queue import Queue

def factors(n):
	l = []
	for i in range(1, int(sqrt(n)) + 1):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def check1(s, v, x):
	while True:
		if v not in s:
			return v
		else:
			v -= 1

def check2(s, v, x):
	while True:
		if v not in s:
			return v
		else:
			v += 1

def up(n):
	j = n - 1
	while j > 0:
		if n % j == 0:
			break
		j -= 1
	return j

def fac(n):
	c = 1
	i = 1
	while i <= n:
		c *= i
		i += 1
	return c

def check_happy(n):
	ss = set()
	print(n)
	while n != 1:
		val = n
		s = 0
		print(val)
		while val != 0:
			s += (val % 10) ** 2
			val = val // 10
		print(val)
		print('hi')
		if val in ss:
			return False
		else:
			n = val
			ss.add(n)
	return True

def update(a, b):
	c = 1
	val = a
	while a < b:
		print(c, a)
		c += c
		a += a
	print(1)
	while a > b:
		print()
		a -= val
		c -= 1
	return c
import random as rand

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)
l = seive(1000000)
s = set(l)
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif n in s:
		print(1, n - 1)
	else:
		mini = 9999999999999
		a = -1
		b = -1
		for i in l:
			if n % i == 0:
				lcm = i * (n - i) // gcd(i, n - i)
				if lcm < mini:
					mini = lcm
					a = i
					b = n - i
				val = n // i
				lcm = val * (n - val) // gcd(val, n - val)
				if lcm < mini:
					mini = lcm
					a = val
					b = n - val
		if a == -1:
			print(1, n - 1)
		else:
			print(a, b)


import math
n = int(input())
for i in range(n):
	t = int(input())
	if t % 2 == 0:
		print(int(t / 2), int(t / 2))
	else:
		f = 0
		l = 0
		flag = 0
		for j in range(2, int(math.sqrt(t)) + 1):
			if t % j == 0:
				flag = 1
				print(int(t / j), t - int(t / j))
				break
		if flag == 0:
			print(1, t - 1)


import math
a = int(input())
for x in range(a):
	a = int(input())
	if a % 2 == 0:
		print(a // 2, a // 2)
	else:
		wurzel = int(math.sqrt(a))
		for x in range(3, wurzel + 1, 2):
			if a % x == 0:
				print(a // x, a - a // x)
				break
		else:
			print(1, a - 1)


from math import *
sInt = lambda : int(input())
mInt = lambda : map(int, input().split())
lInt = lambda : list(map(int, input().split()))
t = sInt()
for _ in range(t):
	n = sInt()
	y = 0
	for i in range(2, int(sqrt(n)) + 1):
		if (n / i).is_integer():
			print(n // i, n - n // i)
			y = 1
			break
	if y == 0:
		print(1, n - 1)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nsmallest
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf
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 time import perf_counter
from fractions import Fraction
from decimal import Decimal
mod = pow(10, 9) + 7
mod2 = 998244353

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

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

def outa(*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)]

def lcm(u, v):
	return u * v // gcd(u, v)
for _ in range(int(data())):
	n = int(data())
	i = 2
	f = set()
	(a, b) = (1, n - 1)
	l = lcm(a, b)
	while i * i <= n:
		if n % i == 0:
			temp = n // i
			if lcm(temp, n - temp) < l:
				(a, b) = (temp, n - temp)
				l = lcm(temp, n - temp)
			if lcm(i, n - i) < l:
				(a, b) = (i, n - i)
				l = lcm(temp, n - temp)
		i += 1
	outa(a, b)


t = int(input())
while t != 0:
	t -= 1
	n = int(input())
	i = 2
	m = 1
	while i * i <= n:
		if n % i == 0:
			print(n // i, n - n // i)
			m = 0
			break
		else:
			i += 1
	if m == 1:
		print(1, n - 1)


import math
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		c = 0
		for i in range(2, math.ceil(pow(n, 0.5)) + 1):
			if n % i == 0:
				c = i
				break
		if c:
			print(n // c, n - n // c)
		else:
			print(1, n - 1)


def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	return x * y // gcd(x, y)

def prime_factors(n):
	i = 2
	factors = {}
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors[i] = factors.get(i, 0) + 1
	if n > 1:
		factors[n] = factors.get(n, 0) + 1
	return factors

def solve(n):
	pf = prime_factors(n)
	s1 = s2 = None
	ml = float('inf')
	for (x, f) in pf.items():
		num1 = n // x * (x - 1)
		num2 = n - num1
		l = lcm(num1, num2)
		if l < ml:
			ml = l
			(s1, s2) = (num1, num2)
	return (s1, s2)
t = int(input())
for _ in range(t):
	n = int(input())
	(a, b) = solve(n)
	print(a, b)


def prime(n):
	i = 3
	rt = n ** 0.5
	while True:
		if n % i == 0:
			return i
		if i > rt:
			return n
		i += 2
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		x = n // prime(n)
		print(x, n - x)


import math
for _ in range(int(input())):
	n = int(input())
	l = []
	(p, q) = (1, n - 1)
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		for i in range(1, int(math.sqrt(n)) + 1):
			if n % i == 0:
				l.append(i)
				l.append(n // i)
		k = n - 1
		for i in l:
			c = i * (n - i) / math.gcd(i, n - i)
			if c < k and c != 0:
				k = c
				p = i
				q = n - i
		print(p, q)


import math
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif n % 2 != 0:
		flag = 0
		for i in range(2, int(math.sqrt(n)) + 1, 1):
			if n % i == 0:
				flag = 1
				break
		if flag == 0:
			print(1, n - 1)
		elif flag == 1:
			g = 2
			h = n
			for i in range(2, int(math.sqrt(n)) + 1, 1):
				if n % i == 0:
					w = n // i
					z = n - w
					y = n - i
					if y <= z and y < h:
						g = i
						h = y
					elif z <= y and z < h:
						g = w
						h = z
			print(g, h)


import math

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

def lcm(a, b):
	return a / gcd(a, b) * b
z = int(input())
for y in range(z):
	n = int(input())
	raiz = int(math.sqrt(n + 0.5))
	aux = 1
	for i in range(2, raiz + 1):
		if n % i == 0:
			aux = 0
			print(n // i, n - n // i)
			break
	if aux == 1:
		print(aux, n - 1)


import math

def main():
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
		return
	else:
		ans = math.inf
		for i in range(2, int(math.sqrt(n)) + 1):
			if n % i == 0:
				mx = max(i, n - i)
				mx2 = max(n // i, n - n // i)
				ans = min(mx, ans, mx2)
		if ans > n:
			print(1, n - 1)
		else:
			print(ans, n - ans)
		return

def test():
	t = int(input())
	while t:
		main()
		t -= 1
test()


from sys import stdin, stdout
import math
input = stdin.readline

def print(x='', y='', end='\n'):
	if y == '':
		stdout.write(str(x) + end)
	else:
		stdout.write(str(x) + ' ' + str(y) + end)

def solve():
	n = int(input())
	minn = n ** 2
	(a, b) = (0, 0)
	if not n % 2:
		print(n // 2, n // 2)
		return
	div = []
	for i in range(3, int(n ** 0.5) + 1):
		if n % i == 0:
			div.append(i)
			if n // i != i:
				div.append(n // i)
	if div:
		m = max(div)
		print(m, n - m)
	else:
		print(1, n - 1)
tt = 1
tt = int(input())
for __ in range(tt):
	solve()


def crives(n):
	p = 2
	while p * p <= n:
		if n % p == 0:
			return p
		p += 1
	return n
t = int(input())
for e in range(t):
	n = int(input())
	x = crives(n)
	a = n / x
	print('%d %d' % (a, a * (x - 1)))


import os, io
from sys import stdout
import collections
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
import sys

def primes(n):
	sieve = [True] * n
	for i in range(3, int(n ** 0.5) + 1, 2):
		if sieve[i]:
			sieve[i * i::2 * i] = [False] * ((n - i * i - 1) // (2 * i) + 1)
	return [2] + [i for i in range(3, n, 2) if sieve[i]]

def binomial_coefficient(n, k):
	if 0 <= k <= n:
		ntok = 1
		ktok = 1
		for t in range(1, min(k, n - k) + 1):
			ntok *= n
			ktok *= t
			n -= 1
		return ntok // ktok
	else:
		return 0

def powerOfK(k, max):
	if k == 1:
		return [1]
	if k == -1:
		return [-1, 1]
	result = []
	n = 1
	while n <= max:
		result.append(n)
		n *= k
	return result

def divisors(n):
	i = 1
	result = []
	while i * i <= n:
		if n % i == 0:
			if n / i == i:
				result.append(i)
			else:
				result.append(i)
				result.append(n / i)
		i += 1
	return result

def distance(xa, ya, xb, yb):
	return ((ya - yb) ** 2 + (xa - xb) ** 2) ** 0.5

def digitsSum(n):
	if n == 0:
		return 0
	r = 0
	while n > 0:
		r += n % 10
		n //= 10
	return r

def isValid(i, j, n, m):
	return i >= 0 and i < n and (j >= 0) and (j < m)

def print_grid(grid):
	for line in grid:
		print(' '.join(map(str, line)))

def kadane(a, size):
	max_so_far = 0
	max_ending_here = 0
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_so_far < max_ending_here:
			max_so_far = max_ending_here
		if max_ending_here < 0:
			max_ending_here = 0
	return max_so_far

def prefixSum(arr):
	for i in range(1, len(arr)):
		arr[i] = arr[i] + arr[i - 1]
	return arr

def ceil(n, d):
	if n % d == 0:
		return n // d
	else:
		return n // d + 1

def _abs(a, b):
	return int(abs(a - b))

def evenodd(l):
	even = [e for e in l if e & 1 == 0]
	odd = [e for e in l if e & 1]
	return (even, odd)

def largest_prime_factor(n):
	i = 2
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
	return n
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		m = None
		i = 2
		while i * i <= n:
			if n % i == 0:
				m = n // i
				break
			i += 1
		if not m:
			print(1, n - 1)
		else:
			times = n // m
			if times % 2 == 0:
				print(int(m * times // 2), int(m * times // 2))
			else:
				print(int(m), int((times - 1) * m))


import sys
input = sys.stdin.readline
MOD = 1000000007
MOD2 = 998244353
ii = lambda : int(input().strip('\n'))
si = lambda : input().strip('\n')
dgl = lambda : list(map(int, input().strip('\n')))
f = lambda : map(int, input().strip('\n').split())
il = lambda : list(map(int, input().strip('\n').split()))
ls = lambda : list(input().strip('\n'))
lsc = lambda : list(input().strip('\n').split(' '))
lsi = lambda : [int(i) for i in ls()]
let = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(ii()):
	n = ii()
	mn = 100000000000000
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			mn = min(mn, max(i, n - i), max(n - n // i, n // i))
	if mn > 10 ** 10:
		print(1, n - 1)
	else:
		print(n - mn, mn)


from math import sqrt

def primes(n):
	factors = list()
	while not n % 2:
		factors.append(2)
		n //= 2
	for i in range(3, int(sqrt(n)) + 3, 2):
		while not n % i:
			factors.append(i)
			n //= i
	if n > 2:
		factors.append(n)
	return list(set(factors))
for _ in range(int(input())):
	m = int(input())
	if m % 2 == 0:
		print(m // 2, m // 2)
	else:
		k = min(primes(m))
		print(m // k, m - m // k)


import math
n = int(input())
for _ in range(n):
	a = int(input())
	k = int(math.sqrt(a)) + 1
	i = 2
	s = -1
	while i <= k:
		if a % i == 0:
			s = a // i
			break
		i += 1
	if s == -1:
		print(1, a - 1)
	else:
		print(s, a - s)


import sys

def rs():
	return sys.stdin.readline().rstrip()

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

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

def ws(s):
	sys.stdout.write(s)
	sys.stdout.write('\n')

def wi(n):
	sys.stdout.write(str(n))
	sys.stdout.write('\n')

def wia(a, sep=' '):
	sys.stdout.write(sep.join([str(x) for x in a]))
	sys.stdout.write('\n')

def solve(n):
	s = int(n ** 0.5) + 1
	prime = True
	best = n
	for i in range(2, s):
		if n % i == 0:
			prime = False
			d = n // i
			best = min(best, min(max(i * (d - 1), i), max(d * (i - 1), d)))
	if prime:
		return [1, n - 1]
	return [best, n - best]

def main():
	for _ in range(ri()):
		n = ri()
		wia(solve(n))
main()


import math
t = int(input())
while t != 0:
	n = int(input())
	maxi = -1
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			maxi = max(i, n // i, maxi)
	if maxi == -1:
		print(1, n - 1)
	else:
		print(maxi, n - maxi)
	t -= 1


t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		res = n // 2
		print(res, res)
	else:
		res1 = 1
		res2 = n - 1
		i = 3
		while i ** 2 <= n:
			if n % i == 0:
				res1 = n // i
				res2 = n - res1
				break
			i += 2
		print(res1, res2)


import sys
mod = 10 ** 9 + 7
INF = float('inf')

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

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

def make_divisors(n):
	divisors = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			divisors.append(i)
			if i != n // i:
				divisors.append(n // i)
	divisors.sort()
	return divisors[-2]
t = inp()
for _ in range(t):
	n = inp()
	a = make_divisors(n)
	print(a, n - a)


def solve():
	n = int(input())
	for d in range(2, int(n ** 0.5) + 1):
		if n % d == 0:
			print(n // d, n - n // d)
			return
	print(1, n - 1)
for _ in range(int(input())):
	solve()


import sys
input = sys.stdin.readline
t = int(input())
primes = []
for n in range(2, 50000):
	ok = 1
	for k in range(2, 250):
		if n != k and n % k == 0:
			ok = 0
			break
	if ok == 1:
		primes.append(n)
for _ in range(t):
	a = int(input())
	ok = 0
	for p in primes:
		if a % p == 0 and a != p:
			print(a // p, a - a // p)
			ok = 1
			break
	if ok == 0:
		print(a - 1, 1)


from fractions import gcd
import math
T = int(input())

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

def solve(N):
	for div in range(2, int(math.sqrt(N) + 3)):
		if N % div == 0:
			return (N // div, N - N // div)
	return (1, N - 1)
for _ in range(T):
	N = int(input())
	print(*solve(N))


import sys, math
input = lambda : sys.stdin.readline().rstrip()

def ch(n):
	for i in range(2, 100000):
		if n % i == 0:
			return i
	return 1
mas = []
for i in range(int(input())):
	b = int(input())
	c = ch(b)
	if c != 1:
		print(b // c, b - b // c)
	else:
		print(1, b - 1)


from math import gcd

def make_divisors(n):
	divisors = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			divisors.append(i)
			if i != n // i:
				divisors.append(n // i)
	divisors.sort()
	return divisors
(T,) = map(int, input().split())
for _ in range(T):
	(N,) = map(int, input().split())
	L = make_divisors(N)
	if len(L) != 2:
		for l in L[:-1][::-1]:
			print(N - l, l)
			break
	else:
		print(N - 1, 1)


def fun(n):
	h = int(n ** 0.5) + 1
	for i in range(2, h):
		if n % i == 0:
			return n // i
	return 1
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		h = fun(n)
		s = n - h
		print(h, s)


import math

def pd(n):
	i = 2
	flag = 0
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				t1 = i
				flag = 1
				break
			else:
				t1 = i
				flag = 1
				break
		i = i + 1
	if flag == 0:
		return 0
	else:
		return t1
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif pd(n) == 0:
		print(1, n - 1)
	else:
		print(n // pd(n), n - n // pd(n))


from math import sqrt, ceil
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(int(n / 2), int(n / 2))
	elif n % 3 == 0:
		print(int(n / 3), int(2 * n / 3))
	else:
		a = ceil(sqrt(n))
		while n % a != 0 and a > 1:
			if n % a == 0:
				ans = a
			a -= 1
		ans = 1
		while a > 1:
			if n % a == 0:
				ans = a
			a -= 1
		if ans > 1:
			print(int(n / ans), (ans - 1) * int(n / ans))
		else:
			print(n - ans, ans)


from math import *
from collections import *
from operator import itemgetter
import bisect
from heapq import *
i = lambda : input()
ii = lambda : int(input())
iia = lambda : list(map(int, input().split()))
isa = lambda : list(input().split())
I = lambda : list(map(int, input().split()))
chrIdx = lambda x: ord(x) - 96
idxChr = lambda x: chr(96 + x)
t = ii()
for _ in range(t):
	n = ii()
	f = 1
	a = 1
	b = n - 1
	lcm = 10 ** 9
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			if i * (n - i) / gcd(i, n - i) < lcm:
				a = i
				b = n - i
				lcm = i * (n - i) / gcd(i, n - i)
			k = n // i
			if k * (n - k) / gcd(k, n - k) < lcm:
				a = k
				b = n - k
				lcm = k * (n - k) / gcd(k, n - k)
	print(a, b)


from sys import stdout, stdin
(_input, _print) = (stdin.readline, stdout.write)
(_range, _int) = (range, int)

def solution():
	for _ in _range(_int(_input())):
		n = _int(_input())
		l = 2
		r = _int(n ** 0.5) + 1
		while l < r:
			if n % l == 0:
				break
			l += 1
		if l == r:
			print(1, n - 1)
		else:
			print(n // l, n // l * (l - 1))
solution()


import math
t = int(input(''))
while t > 0:
	n = int(input(''))
	for x in range(2, math.ceil(n ** 0.5) + 1):
		if n % x == 0:
			ans = n // x
			break
	else:
		ans = 1
	print(ans, end=' ')
	print(n - ans)
	t -= 1


from math import sqrt
from math import gcd

def lcm(a, b):
	return a * b // gcd(a, b)
for _ in range(int(input().strip())):
	n = int(input().strip())
	facts = [1]
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		for i in range(2, int(sqrt(n) + 1)):
			if n % i == 0:
				facts.append(i)
				if i != n // i:
					facts.append(n // i)
		mls = n - 1
		ans = (1, n - 1)
		for f in facts:
			lc = lcm(f, abs(n - f))
			if lc < mls:
				ans = (f, abs(n - f))
				mls = lc
		for a in ans:
			print(a, end=' ')
		print()


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	divs = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			divs.append(i)
			if i != n // i:
				divs.append(n // i)
	divs.sort()
	a = divs[-2]
	b = n - divs[-2]
	print(min(a, b), max(a, b))


from sys import stdin, stdout
from math import sqrt
test = int(stdin.readline())
for _ in range(test):
	N = int(stdin.readline())
	if N & 1 ^ 1:
		print(N // 2, N // 2)
		continue
	(ax, ay) = (1, N - 1)
	for i in range(2, int(sqrt(N)) + 1):
		if not N % i:
			if N - i < ay:
				ax = i
				ay = N - i
			n2 = N // i
			if N - n2 < ay:
				ax = N // i
				ay = N - n2
	print(ax, ay)


from sys import stdin

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

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

def linput():
	return list(map(int, stdin.readline().split()))
from math import sqrt
t = iinput()
while t:
	t -= 1
	n = iinput()
	if n & 1 == 0:
		print(n // 2, n // 2)
	else:
		(a, b) = (1, n - 1)
		for i in range(3, int(sqrt(n)) + 1):
			if n % i == 0:
				x = n // i
				a = x
				b = n - a
				break
		print(a, b)


import math
for t in range(int(input())):
	n = int(input())
	x = n
	z = 1
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			x = i
			z = n // i
			break
	print(1 * z, (x - 1) * z)


from math import sqrt

def gcd(n1, n2):
	if n1 == 0:
		return n2
	return gcd(n2 % n1, n1)

def lcm(n1, n2):
	return n1 * n2 // gcd(n1, n2)
t = int(input())
for e in range(t):
	n = int(input())
	if n % 2 == 0:
		a = n // 2
		b = a
	else:
		a = 1
		b = n - a
		sa = 1
		sb = n - a
		menor = lcm(a, b)
		while a <= sqrt(n):
			if n % a == 0 and a != n:
				calc = lcm(a, n - a)
				if calc < menor:
					menor = calc
					sa = a
					sb = n - a
				if n // a != a:
					calc = lcm(n // a, n - n // a)
					if calc < menor and n - n // a != 0:
						menor = calc
						sa = n // a
						sb = n - n // a
			a += 1
		a = sa
		b = sb
	print(a, b)


import sys
input = sys.stdin.readline
import math
Q = int(input())
Query = [int(input()) for _ in range(Q)]
for N in Query:
	tmp = N - 1
	a = N - 1
	b = 1
	for t in range(2, int(math.sqrt(N)) + 2):
		if N % t == 0:
			x = t
			y = N // t
			l = (x - 1) * y
			if l != 0 and l < tmp:
				tmp = l
				a = (x - 1) * y
				b = y
			k = (y - 1) * x
			if k != 0 and k < tmp:
				tmp = k
				a = x
				b = (y - 1) * x
	print(a, b)


import os
import sys
from io import BytesIO, IOBase
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.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')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())

def comb(n, m):
	return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0

def perm(n, m):
	return factorial(n) // factorial(n - m) if n >= m else 0

def mdis(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)
mod = 998244353
INF = float('inf')
from math import factorial, sqrt, ceil
from collections import Counter, defaultdict, deque
from heapq import heapify, heappop, heappush

def prim(num):
	up = ceil(sqrt(num))
	res = []
	if num == 1:
		return res
	for i in range(2, up + 1):
		if num % i == 0:
			while num % i == 0:
				num //= i
			res.append(i)
			if num == 1:
				break
	else:
		res.append(num)
	return res

def main():
	for _ in range(N()):
		n = N()
		if n % 2 == 0:
			print(n // 2, n // 2)
		else:
			pr = prim(n)
			print(n // pr[0], n - n // pr[0])
main()


from sys import stdin

def firstDiv(n):
	if n <= 1:
		return False
	if n <= 3:
		return 2
	if n % 2 == 0:
		return 2
	elif n % 3 == 0:
		return 3
	i = 5
	while i * i <= n:
		if n % i == 0:
			return i
		elif n % (i + 2) == 0:
			return i + 2
		i = i + 6
	return 10000000000.0 + 1
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		x = firstDiv(n)
		y = n // x
		if x == 10000000000.0 + 1:
			print(1, n - 1)
		else:
			print(y, n - y)


from math import gcd, sqrt

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

def factors(x):
	result = []
	i = 1
	while i * i <= x:
		if x % i == 0:
			result.append(i)
			if x // i != i:
				result.append(x // i)
		i += 1
	return result
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		p = list(set(factors(n)))
		p.append(1)
		maxx = 10 ** 18
		pair = []
		for x in p:
			kk = lcm(x, n - x)
			if kk < maxx and x != n:
				maxx = kk
				pair = [x, n - x]
		print(pair[0], pair[1])


from random import randint

def sieve(n):
	maxi = 1
	for i in range(3, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			first = i
			second = n // i
			if (n - second) % second == 0:
				if second > maxi:
					maxi = second
			elif (n - first) % first == 0:
				if first > maxi:
					maxi = first
	return maxi
for _ in range(int(input())):
	n = int(input())
	sieve(n)
	if n % 2 == 0:
		print(f'{n // 2} {n // 2}')
	else:
		x = sieve(n)
		if x == 1:
			print(f'1 {n - 1}')
		else:
			print(f'{x} {n - x}')


from math import sqrt
for i in range(int(input())):
	(a, b) = (1, int(input()) - 1)
	for i in range(2, int(sqrt(a + b)) + 1):
		if (a + b) % i == 0:
			a = (a + b) // i
			b = b + 1 - a
			break
	print(a, b)


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

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

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

def li():
	return [int(i) for i in input().split()]

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

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=2):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	new_number = 0
	while number > 0:
		new_number += number % base
		number //= base
	return new_number

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True
for i in range(ii()):
	n = ii()
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif prime(n):
		print(n - 1, 1)
	else:
		r = sieve(int(math.sqrt(n)))
		for i in r:
			if n % i == 0:
				i = n // i
				print(i, n - i)
				break


def solve(n):
	p = n
	for i in range(2, n):
		if i * i > n:
			break
		if n % i == 0:
			p = i
			break
	a = n // p
	b = (p - 1) * a
	return [a, b]

def main(istr, ostr):
	t = int(istr.readline())
	for _ in range(t):
		n = int(istr.readline())
		[a, b] = solve(n)
		print(f'{a} {b}', file=ostr)

def main_submit():
	import sys
	main(sys.stdin, sys.stdout)
main_submit()


def prime(n):
	f = 0
	for i in range(2, n - 1):
		if n % i == 0:
			f = 1
			break
	if f == 0:
		return 1
	else:
		return 0
for p in range(int(input())):
	n = int(input())
	if n % 2:
		f = 0
		for i in range(2, int(n ** (1 / 2)) + 1):
			if n % i == 0 and prime(i):
				f = 1
				break
		if f == 0:
			print(1, n - 1)
		else:
			v = n // i
			l = [v, n - v]
			l.sort()
			print(*l)
	else:
		print(n // 2, n // 2)


import math
t = int(input())
for k in range(t):
	n = int(input())
	d = [-1]
	for i in range(2, int(n ** 0.5 + 1)):
		if not n % i:
			d.append(i)
	if len(d) == 1:
		print(1, n - 1)
		continue
	for i in range(1, len(d)):
		d.append(int(n / d[i]))
	d.append(int(n / d[-1]))
	d = list(set(d))
	d.remove(-1)
	d.sort()
	print(d[-1], n - d[-1])


import math
for _ in range(int(input())):
	n = int(input())
	res = [1, n - 1]
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		i = 3
		while i * i <= n:
			if n % i == 0:
				res = [n // i, n - n // i]
				break
			i += 2
		print(*res)


def isprime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def smallestDivisor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(str(n // 2) + ' ' + str(n // 2))
	elif isprime(n):
		print('1 ' + str(n - 1))
	else:
		first = n // smallestDivisor(n)
		print(str(first) + ' ' + str(n - first))


import math
for _ in range(int(input())):
	n = int(input())
	x = []
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			x.append(i)
	if not x:
		print(1, n - 1)
	else:
		print(int(n / x[0]), int(n - n / x[0]))


import math
from collections import deque
from sys import stdin, stdout
input = stdin.readline
for _ in range(int(input())):
	x = int(input())
	ind = 2
	mn = 99999999999999
	while ind * ind <= x:
		if x % ind == 0:
			mn = min(mn, ind)
			mn = min(mn, x // ind)
		ind += 1
	if mn == 99999999999999:
		mn = x
	print(x // mn, x - x // mn)


for tc in range(eval(input())):
	N = eval(input())
	factor = []
	i = 2
	while i * i <= N:
		while N % i == 0:
			factor.append(i)
			N //= i
		i += 1
	if N > 1:
		factor.append(N)
	factor = sorted(factor)[::-1]
	least = factor.pop()
	n1 = n2 = 1
	for i in factor:
		n1 *= i
		n2 *= i
	n1 *= 1
	n2 *= least - 1
	print(n1, n2)


def find_factor(n):
	for i in range(3, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return i
	return 1

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		if n % 2 == 0:
			print(n // 2, n // 2)
		else:
			factor = find_factor(n)
			if factor == 1:
				print(1, n - 1)
			else:
				a = n // factor
				b = n - a
				print(int(a), int(b))
main()


from typing import Generator, List
Vector = List[int]

def primes_sieve(bound: int) -> Generator[int, None, None]:
	primes = [i for i in range(bound + 1)]
	for p in primes:
		if p < 2:
			continue
		yield p
		i = p + p
		while i <= bound:
			primes[i] = 0
			i += p
primes: Vector = [p for p in primes_sieve(31623)]
for _ in range(int(input())):
	n = int(input())
	a = next((n // p for p in primes if n % p == 0), 1)
	print(f'{a} {n - a}')


import math
for _ in range(int(input())):
	n = int(input())
	a = [1]
	x = math.sqrt(n)
	num = 0
	flag = 0
	for i in range(2, int(x) + 1):
		if n % i == 0:
			q = n // i
			num = q
			flag = 1
			break
	if flag == 1:
		print(num, n - num)
	else:
		print(1, n - 1)


import math
from collections import defaultdict, deque
from itertools import permutations
ml = lambda : map(int, input().split())
ll = lambda : list(map(int, input().split()))
ii = lambda : int(input())
ip = lambda : list(input())
ips = lambda : input().split()
t = ii()
for _ in range(t):
	n = ii()
	k = 1
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			k = max(k, i)
			if n // i != i:
				k = max(n // i, k)
	print(k, n - k)


def solve(n):
	i = 2
	while i * i <= n and n % i != 0:
		i += 1
	if n % i != 0:
		i = n
	return (n // i, n // i * (i - 1))
for _ in range(int(input())):
	n = int(input())
	print(*solve(n))


from math import gcd

def div(n):
	arr = []
	while n % 2 == 0:
		arr.append(2)
		n = n // 2
	p = n ** 0.5
	p = int(p) + 1
	for i in range(3, p, 2):
		while n % i == 0:
			arr.append(i)
			n = n // i
	if n > 1:
		arr.append(n)
	return arr
for _ in range(int(input())):
	n = int(input())
	arr = div(n)
	a = 0
	b = 0
	a = arr[0] - 1
	b = 1
	for i in range(1, len(arr)):
		a = a * arr[i]
		b = b * arr[i]
	print(a, b)


def solve():
	t = int(input())
	for _ in range(t):
		n = int(input())
		p = 0
		for i in range(2, 100000):
			if n % i == 0:
				p = i
				break
			if p == 0:
				p = n
		print(n // p, n - n // p)
solve()


import copy, math

def main():
	for _ in range(int(input())):
		n = int(input())
		if n % 2 == 0:
			print(n // 2, n // 2)
		else:
			l = []
			for i in range(math.ceil(math.sqrt(n)), 1, -1):
				if n % i == 0:
					l.append(i)
					l.append(n // i)
			if l:
				print(max(l), n - max(l))
			else:
				print(1, n - 1)
main()


t = int(input())
for i in range(t):
	n = int(input())
	r = 1
	if n % 2 == 0:
		r = 2
	else:
		q = int(n ** 0.5) + 1
		for i in range(3, q, 2):
			if n % i == 0:
				r = i
				break
	if r != 1:
		a = n // r
		print(a, n - a)
	else:
		print(1, n - 1)


import math

def solution(numero):
	if numero % 2 == 0:
		print('%d %d' % (numero / 2, numero / 2))
	else:
		divisores = geradivisores(numero)
		print('%d %d' % (divisores[-1], (numero / divisores[-1] - 1) * divisores[-1]))

def geradivisores(numero):
	divisores = [1]
	divisoresfinal = []
	for i in range(2, int(math.sqrt(numero)) + 1):
		if numero % i == 0:
			if numero / i != i:
				divisoresfinal.append(numero / i)
			divisores.append(int(i))
	divisoresfinal.reverse()
	divisores.extend(divisoresfinal)
	return divisores
n_casos = int(input())
casos = []
for i in range(n_casos):
	casos.append(int(input()))
for caso in casos:
	solution(caso)


import math
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		p = 0
		for i in range(2, 100001):
			if n % i == 0:
				p = i
				break
		if p == 0:
			p = n
		print(n // p, n - n // p)


for T in range(int(input())):
	n = int(input())
	ans = [0, 0]
	if n % 2 == 0:
		ans = [n // 2, n // 2]
	elif n > 3:
		div = 3
		flag = True
		while div * div <= n:
			if n % div == 0:
				flag = False
				break
			div += 1
		if flag:
			ans = [n - 1, 1]
		else:
			ans = [n // div * (div - 1), n // div]
	else:
		ans = [n - 1, 1]
	print(*ans)


import os
from io import BytesIO, IOBase
import sys

def main():
	for _ in range(int(input())):
		n = int(input())
		i = 1
		ans = 0
		while i * i <= n:
			if n % i == 0:
				if i != n:
					ans = max(ans, i)
				if n // i != n:
					ans = max(ans, n // i)
			i += 1
		m = n // ans
		print(1 * ans, (m - 1) * ans)
	return
BUFSIZE = 1048576

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

def input():
	return sys.stdin.readline().rstrip('\r\n')
main()


import math
t = int(input())
for w in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		c = 1
		m1 = 0
		t = (1, n - 1)
		for i in range(int(math.sqrt(n)), 1, -1):
			if n % i == 0:
				if m1 == 0:
					m1 = i
				if (n - n // i) % (n // i) == 0:
					c = 0
					t = (n // i, n - n // i)
		print(t[0], t[1])


test = int(input())
for i in range(test):
	n = int(input())
	i = 2
	arr = []
	while i ** 2 <= n:
		if n % i == 0:
			arr.append(i)
			arr.append(n / i)
		i += 1
	if arr:
		k = max(arr)
		print(int(k), int(n - k))
	else:
		print(1, n - 1)


from collections import Counter
import math

def cal(n):
	if n % 2 == 0:
		return (n // 2, n // 2)
	else:
		fans = None
		mn = 10 ** 9
		for i in range(int(math.sqrt(n)) + 1, 1, -1):
			if n % i == 0:
				m = n // i
				arr = cal(m)
				a = i * arr[0]
				b = i * arr[1]
				ans = a * b // math.gcd(a, b)
				if ans < mn:
					mn = ans
					fans = (a, b)
				m = n // i
				arr = cal(i)
				a = m * arr[0]
				b = m * arr[1]
				ans = a * b // math.gcd(a, b)
				if ans < mn:
					mn = ans
					fans = (a, b)
		if fans:
			return fans
		return (1, n - 1)
for i in range(int(input())):
	n = int(input())
	ans = cal(n)
	print(ans[0], ans[1])


import math

def printDivisors(n):
	res = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				res.append([i, i])
			else:
				res.append([i, n // i])
		i = i + 1
	return res
for _ in range(0, int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		r = printDivisors(n)
		r = r[1:]
		if len(r) == 0:
			print(1, n - 1)
		else:
			t = r[0]
			ans1 = [t[0], t[1], t[0] * (t[1] - 1)]
			ans2 = [t[0], t[1], t[1] * (t[0] - 1)]
			if ans1[2] < ans2[2]:
				print(ans1[0], ans1, 2)
			else:
				print(ans2[1], ans2[2])


import sys

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

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())

def solve():
	n = mint()
	for i in range(2, n):
		if i * i > n:
			break
		if n % i == 0:
			print(n // i, n - n // i)
			return
	print(1, n - 1)
for i in range(mint()):
	solve()


import sys
import math
import collections
import operator as op
from collections import deque
from math import gcd, inf, sqrt, pi, cos, sin
from bisect import bisect_right, bisect_left
from functools import reduce
from sys import stdin, stdout, setrecursionlimit
setrecursionlimit(2 ** 20)

def factorial(n):
	if n == 0:
		return 1
	return n * factorial(n - 1)

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 prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return len(set(factors))

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def printAllSubstrings(s, n):
	l = {}
	for i in range(n):
		temp = ''
		for j in range(i, n):
			temp += s[j]
			if temp not in l:
				l[temp] = 0
			l[temp] += 1
	return l
MOD = 1000000007
PMOD = 998244353
T = 1
T = int(stdin.readline())
for _ in range(T):
	n = int(stdin.readline())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		k = -1
		for i in range(2, int(sqrt(n)) + 1):
			if n % i == 0:
				k = i
				break
		if k == -1:
			print(1, n - 1)
			continue
		a = n // k
		b = (k - 1) * n // k
		print(a, b)


from math import *
from collections import *
from bisect import *
import sys
input = sys.stdin.readline
t = int(input())
while t:
	t -= 1
	n = int(input())
	fac = set()
	for i in range(2, int(pow(n, 0.5)) + 1):
		if n % i == 0:
			fac.add(i)
			fac.add(n // i)
	fac.add(1)
	lcm = float('inf')
	(a, b) = (0, 0)
	for i in fac:
		if i * (n - i) // gcd(i, n - i) < lcm:
			lcm = i * (n - i) // gcd(i, n - i)
			(a, b) = (i, n - i)
	print(a, b)


import math

def pr(n):
	a = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				a.append(i)
			else:
				a.extend([int(i), n // i])
		i = i + 1
	return sorted(a, reverse=True)
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		a = pr(n)
		for i in range(len(a)):
			if a[i] != n:
				print(min(a[i], n - a[i]), max(a[i], n - a[i]))
				break


t = int(input())
for q in range(t):
	n = int(input())
	champ = n
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		for i in range(2, int(n ** 0.5) + 2):
			if n % i == 0:
				champ = i
				break
		print(n // champ, n - n // champ)


for _ in range(int(input())):
	n = int(input())
	x = 2
	ans = False
	while x * x <= n:
		if n % x == 0:
			print(n // x, n - n // x)
			ans = True
			break
		x += 1
	if not ans:
		print(1, n - 1)


import sys
import math
import collections

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_string():
	return sys.stdin.readline().strip()

def printDivisors(n):
	ans = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				ans.append(i)
			else:
				ans.append(i)
				ans.append(n // i)
		i = i + 1
	return ans
for t in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		div = printDivisors(n)
		lcm = 10 ** 10
		ans = [10 ** 10, 10 ** 10]
		for i in div:
			no1 = i
			no2 = n - i
			if no2 == 0:
				continue
			l = no1 * no2 // math.gcd(no1, no2)
			if l < lcm:
				lcm = l
				ans = [no1, no2]
		print(*ans)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	pr = True
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			print(n // i, n - n // i)
			pr = False
			break
	if pr:
		print(1, n - 1)


from math import *
for uhnpnewrungppwieurnpifwnipwcunidnpuogewuygrbcuiqjiof3nmdilk in range(int(input())):
	num = int(input())
	for i in list(range(2, int(sqrt(num)) + 1)) + [num]:
		if num % i == 0:
			print(num // i, num - num // i)
			break


from sys import stdin, stdout
import math, queue, heapq
fastinput = stdin.readline
fastout = stdout.write
t = int(fastinput())

def isprime(a):
	if a % 2 == 0:
		return (a // 2, a // 2)
	if a % 3 == 0:
		return (a // 3, 2 * (a // 3))
	i = 5
	while i * i <= a:
		if a % i == 0:
			return (a // i, (i - 1) * a // i)
		if a % (i + 2) == 0:
			return (a // (i + 2), (i + 1) * a // (i + 2))
		i += 6
	return (1, a - 1)
while t:
	t -= 1
	a = int(fastinput())
	x = isprime(a)
	print(x[0], x[1])


from math import sqrt

def minfact(n):
	lim = int(sqrt(n)) + 1
	for i in range(2, lim):
		if n % i == 0:
			return i
	return 1
t = int(input())
for _ in range(t):
	n = int(input())
	mi = minfact(n)
	if mi == 1:
		print(1, n - 1)
	else:
		print(n // mi, n - n // mi)


from math import sqrt

def solve():
	n = int(input())
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			x = n // i
			print(x, x * (i - 1))
			return
	print(n - 1, 1)
for i in range(int(input())):
	solve()


import sys
from math import sqrt
from math import gcd
sys.setrecursionlimit(10 ** 6)

def g(n):
	a = []
	nn = n
	i = 3
	while nn != 1:
		if 0 == nn % i:
			a.append(i)
			while 0 == nn % i:
				nn = nn / i
		i = i + 1
		if i * i > n:
			break
	return a

def f(n):
	if n % 2 == 0:
		return (n // 2, n // 2)
	a = g(n)
	if not a:
		return (1, n - 1)
	t = a[0]
	return (n // a[0], n - n // a[0])
nofkase = int(input())
for kase in range(nofkase):
	n = int(input())
	(a, b) = f(n)
	print(a, b)


t = int(input())
for test in range(t):
	n = int(input())
	p = 2
	r = False
	while p * p <= n and (not r):
		if n % p == 0:
			r = True
		else:
			p += 1
	if r:
		d = n // p
		x = d
		y = (p - 1) * d
	else:
		x = 1
		y = n - 1
	print(str(x) + ' ' + str(y))


from sys import stdin, stdout
from math import gcd, log2, log10, floor
import math
from collections import defaultdict, OrderedDict
from bisect import bisect_left

def fun(n):
	fac = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			fac.append(i)
			fac.append(n // i)
	maxa = []
	for i in fac:
		if i <= n // 2:
			maxa.append(i)
	return max(maxa)
for i in range(int(input())):
	n = int(input())
	a = fun(n)
	print(a, n - a)


from math import sqrt

def isprime(num):
	if num == 2 or num == 3:
		return True
	else:
		for i in range(2, int(sqrt(num)) + 1):
			if num % i == 0:
				return False
		return True

def solution():
	num = int(input())
	if num % 2 == 0:
		return (num // 2, num // 2)
	else:
		for i in range(2, int(sqrt(num)) + 1):
			if num % i == 0 and isprime(i):
				return (num // i, num - num // i)
		return (1, num - 1)
for _ in range(int(input())):
	print(*solution())


t = int(input())
for i in range(t):
	n = int(input())
	p = []
	x = 1
	while x * x <= n:
		if n % x == 0:
			p.append(n // x)
			p.append(x)
		x += 1
	p.sort()
	print(p[len(p) - 2], n - p[len(p) - 2])


def isprime(n):
	f = 0
	v = int(n ** 0.5) + 1
	for i in range(2, v):
		if n % i == 0:
			return (False, n // i)
	return (True, n)
cases = int(input())
for t in range(cases):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		(boolv, div) = isprime(n)
		if boolv:
			print(1, n - 1)
		else:
			a = div
			b = n - a
			o2 = max(a, b)
			o1 = min(a, b)
			print(o1, o2)


def minfactor(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return i
	return n
t = int(input())
for i in range(t):
	n = int(input())
	sm = minfactor(n)
	print(n // sm, n - n // sm)


import math
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		dels = []
		max_ = 1
		for i in range(2, math.ceil(n ** (1 / 2) + 1)):
			if n % i == 0:
				if i > max_:
					max_ = i
				if n // i > max_:
					max_ = n // i
		if max_ == 1:
			print(1, n - 1)
			continue
		print(max_, n - max_)


import math

def printDivisors(n):
	i = 2
	while i <= math.sqrt(n):
		if n % i == 0:
			return i
		i += 1
	return -1
t = int(input())
while t > 0:
	num = int(input())
	if num % 2 == 0:
		print(num // 2, num // 2)
	else:
		temp = printDivisors(num)
		if temp != -1:
			tempo = num // temp
			print(tempo, tempo * (temp - 1))
		else:
			print(1, num - 1)
	t -= 1


import math
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, ' ', n - n // 2)
	else:
		ans = n - 1
		for i in range(2, int(math.floor(math.sqrt(n))) + 1):
			if n % i == 0:
				ans = min(ans, (i - 1) * n // i)
		print(ans, ' ', n - ans)


from math import sqrt
from math import gcd
__MULTITEST = True

def solve():
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		least = n - 1
		a = 1
		b = n - 1
		sn = int(sqrt(n))
		for i in range(3, sn + 2):
			if n % i == 0:
				acan = i
				bcan = n - acan
				lcm = acan * bcan // gcd(acan, bcan)
				if lcm < least:
					least = lcm
					a = acan
					b = bcan
				acan = n // i
				bcan = n - acan
				lcm = acan * bcan // gcd(acan, bcan)
				if lcm < least:
					least = lcm
					a = acan
					b = bcan
		print(a, b)
t = int(input()) if __MULTITEST else 1
for tt in range(t):
	solve()


import math

def printDivisors(n):
	ls = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				ls.append(i)
			else:
				ls.append(i)
				ls.append(n // i)
		i = i + 1
	return ls

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

def lcm(a, b):
	return a * b / gcd(a, b)
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		tem = n // 2
		print(tem, tem)
	else:
		ls = printDivisors(n)
		if len(ls) == 2:
			print(1, n - 1)
		else:
			mi = float('inf')
			ans1 = 0
			ans2 = 0
			for i in ls:
				if i != n:
					tem = lcm(i, n - i)
					if tem < mi:
						ans1 = i
						ans2 = n - i
						mi = tem
			print(ans1, ans2)


import math
test = int(input())
for j in range(test):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		flag = 0
		a = 0
		b = 0
		n1 = math.ceil(math.sqrt(n))
		for i in range(2, n1 + 1):
			if n % i == 0:
				a = n // i
				b = n - n // i
				flag = 1
				break
		if flag == 1:
			print(a, b)
		else:
			print(1, n - 1)


import math

def numpair(n):
	for i in range(2, int(math.sqrt(n)) + 2):
		if n % i == 0:
			return int(n / i)
	return 1
t = int(input())
for i in range(t):
	n = int(input())
	a = numpair(n)
	print('{} {}'.format(a, n - a))


for _ in range(int(input())):
	n = int(input())
	if n == 2:
		print(1, 1)
		continue
	for i in range(2, n):
		if i * i > n:
			print(1, n - 1)
			break
		if n % i == 0:
			print(n // i, n - n // i)
			break


import math
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		g = -1
		for i in range(3, int(math.sqrt(n)) + 1):
			if n % i == 0:
				g = i
				break
		if g != -1:
			print(n // g, n - n // g)
			continue
		else:
			print(1, n - 1)
			continue


import math
for test in range(int(input())):
	n = int(input())
	m = int(math.sqrt(n + 0.5))
	(best, A, B) = (10 ** 18, 0, 0)
	divisor = [1]
	for d in range(2, m + 1):
		if n % d == 0:
			divisor.append(d)
			if d * d != n:
				divisor.append(n // d)
	for d in divisor:
		n_prime = n // d
		a_prime = 1
		b_prime = n_prime - a_prime
		a = a_prime * d
		b = b_prime * d
		lcm = a * b // math.gcd(a, b)
		if lcm < best:
			best = lcm
			A = a
			B = b
	print(A, B)


import math
t = int(input())
for p in range(t):
	n = int(input())
	c = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				c.append(n // i)
			else:
				c.append(i)
				c.append(n // i)
		i += 1
	c.pop(0)
	k = min(c)
	print(n // k, n * (k - 1) // k)


sieve = []
for i in range(10 ** 5):
	sieve.append(False)
for i in range(2, len(sieve)):
	if sieve[i] == False:
		for j in range(2 * i, len(sieve), i):
			sieve[j] = True

def prime_factors(x):
	factors = []
	for i in range(2, int(x ** 0.5) + 1):
		if sieve[i] == False:
			while x % i == 0:
				x = x // i
				factors.append(i)
	if x != 1:
		factors.append(x)
	return factors

def solve():
	n = int(input())
	factors = prime_factors(n)
	sm_factor = n
	for x in factors:
		if x < sm_factor:
			sm_factor = x
	a = n // sm_factor
	b = n - a
	print(a, b)
t = int(input())
for i in range(t):
	solve()


import sys

def solve(n):
	if n % 2 == 0:
		return (n // 2, n // 2)
	best = 10 ** 10
	for i in range(int(n ** 0.5), 1, -1):
		if n % i == 0:
			if n - n // i < best:
				best_pair = (n // i, n - n // i)
				best = n - n // i
	if best == 10 ** 10:
		return (1, n - 1)
	return best_pair
caseCount = int(next(sys.stdin))
for i in range(caseCount):
	n = int(next(sys.stdin))
	print(' '.join([str(i) for i in solve(n)]))


import math
import sys

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

def lcm(a, b):
	return a * b / gcd(a, b)
t = int(input())
while t > 0:
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		factors = []
		for i in range(1, int(math.sqrt(n)) + 1):
			if i * int(n // i) == n:
				if i != i * int(n // i):
					factors.append(i)
					factors.append(n // i)
				else:
					factors.append(i)
		factors.remove(n)
		mini = sys.maxsize
		for ele in factors:
			val = lcm(ele, n - ele)
			if val < mini:
				mini = val
				x = ele
				y = n - ele
		print(x, y)
	t -= 1


T = int(input())

def md(n):
	(divisors1, divisors2) = ([], [])
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			divisors1.append(i)
			divisors2.append(n // i)
	divisors1.sort()
	divisors2.sort(reverse=True)
	return (divisors1, divisors2)
for _ in range(T):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		(a, b) = md(n)
		if len(a) == 1:
			print(1, n - 1)
		else:
			print(b[1], b[1] * (a[1] - 1))


import sys
import math
import bisect
from sys import stdin
from itertools import groupby
from heapq import heapify, heappop, heappush
from collections import deque, Counter, OrderedDict

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

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

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
for _ in range(int(input())):
	N = int(input())
	if isPrime(N):
		print(1, N - 1)
	elif N % 2 == 0:
		print(N // 2, N // 2)
	else:
		x = 2
		while x <= int(N ** 0.5) + 1:
			if (N - x) % x == 0:
				break
			x += 1
		k = N // x
		print(k, N - k)


import sys
import math
from functools import reduce
import bisect

def getN():
	return int(input())

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

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

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

def index(a, x):
	i = bisect.bisect_left(a, x)
	if i != len(a) and a[i] == x:
		return i
	return False

def find_dividers(x):
	dividers = []
	for i in range(2, int(math.sqrt(x)) + 1):
		if x % i == 0:
			dividers.append(i)
			if i * i != x:
				dividers.append(x // i)
	return dividers
for _ in range(int(input())):
	n = getN()
	if not n & 1:
		print(n // 2, n // 2)
		continue
	(a, b) = (n - 1, 1)
	nok = n - 1
	divisors = find_dividers(n)
	for x in divisors:
		if x * (n - x) // math.gcd(x, n - x) < nok:
			(a, b) = (x, n - x)
			nok = x * (n - x) // math.gcd(x, n - x)
	print(a, b)


from sys import *
t = int(stdin.readline())
while t > 0:
	n = int(stdin.readline())
	ans = 0
	for i in range(2, 100000):
		if n % i == 0:
			ans = i
			break
	if ans == 0:
		ans = n
	print(n // ans, n - n // ans)
	t -= 1


from sys import stdin, stdout
import math
from collections import Counter, defaultdict
LI = lambda : list(map(int, input().split()))
MAP = lambda : map(int, input().split())
IN = lambda : int(input())
S = lambda : input()

def case():
	n = IN()
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			print(n // i, n - n // i)
			return
	print(1, n - 1)
for _ in range(IN()):
	case()


from sys import stdin
input = stdin.readline
a = [0] * 100001
for x in range(1, 100001):
	for y in range(x, 100001, x):
		a[y] += 1
for _ in range(int(input())):
	n = int(input())
	sq = int(pow(n, 1 / 2)) + 1
	now = 0
	if n <= 100000 and a[n] == 2:
		print(1, n - 1)
		continue
	for x in range(1, sq):
		if a[x] == 2 and n % x == 0:
			now = x
			break
	if now > 0:
		print(n // x, n - n // x)
	else:
		print(1, n - 1)


from math import gcd
T = int(input())
for _ in range(T):
	N = int(input())
	divs = set()
	m = 1
	while m * m <= N:
		if N % m == 0:
			divs.add(m)
			divs.add(N // m)
		m += 1
	ans = float('inf')
	for d in divs:
		if d == N:
			continue
		e = N - d
		lcm = d // gcd(d, e) * e
		ans = min(ans, lcm)
	print(ans, N - ans)


import math

def func(n):
	if n % 2 == 0:
		return '{0} {0}'.format(int(n / 2))
	else:
		max_div = math.floor(math.sqrt(n))
		for i in range(2, max_div + 1):
			if n % i == 0:
				return '{0} {1}'.format(int(n / i), int(n / i * (i - 1)))
		return '{0} {1}'.format(1, n - 1)
test_case = int(input())
output = []
for i in range(test_case):
	a = int(input())
	output.append(a)
for i in output:
	print(func(i))


from sys import stdin

def smallest_divisor(n):
	for i in [2, 3, 5]:
		if n % i == 0:
			return i
	increments = [4, 2, 4, 2, 4, 6, 2, 6]
	d = 7
	inc = 0
	while d * d <= n:
		if n % d == 0:
			return d
		d += increments[inc]
		inc += 1
		if inc == 8:
			inc = 0
	return n
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	sm = smallest_divisor(n)
	t = n // sm
	print((sm - 1) * t, t)


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
from collections import defaultdict
from itertools import permutations
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.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 t in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		a = 1
		for i in range(2, int(math.sqrt(n)) + 1):
			if n % i == 0:
				a = i
				break
		n1 = n // a
		n2 = n1 * (a - 1)
		if n2 == 0:
			n1 = 1
			n2 = n - 1
		print(n1, n2)


import sys, math, random
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	N = int(input())
	(v1, v2) = (1, 1)
	if N % 2 == 0:
		(v1, v2) = (N // 2, N // 2)
	else:
		i = 2
		v = N - 1
		while i * i <= N:
			if N % i == 0:
				N1 = N // i
				N1 = max(N - N1, N1)
				if N1 < v:
					v = N1
			i = i + 1
		(v1, v2) = (v, N - v)
	print(v1, v2)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			dv = int(n / i)
			print(dv, dv * (i - 1))
			break
	else:
		print(1, n - 1)


from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math

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

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

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

def all_factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def solve():
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		st = all_factors(n)
		st.remove(n)
		x = max(st)
		print(x, n - x)

def main():
	solve()
TestCases = True
if TestCases:
	for i in range(get_int()):
		main()
else:
	main()


def omkar_and_last(n):
	if n < 4:
		print(1, n - 1)
		return
	if n % 2 == 0:
		print(n // 2, n // 2)
		return
	else:
		res = []
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				if n // i == i:
					res.append(n // i)
				else:
					res.append(i)
					res.append(n // i)
		res.sort()
		if len(res) != 0:
			print(res[-1], n - res[-1])
		else:
			print(1, n - 1)
t = int(input())
for _ in range(t):
	n = int(input())
	omkar_and_last(n)


from math import gcd

def get_int():
	from sys import stdin
	return int(stdin.readline().replace('\n', ''))

def get_int_list():
	from sys import stdin
	return [int(x) for x in stdin.readline().replace('\n', '').split(' ')]

def get_str():
	from sys import stdin
	return stdin.readline().replace('\n', '')

def count_divisors(b):
	n_div_b = 0
	i = 1
	while i ** 2 <= b:
		if b % i == 0:
			n_div_b += 1
			if i ** 2 != b:
				n_div_b += 1
		i += 1
	return n_div_b

def is_prime(n):
	return count_divisors(n) == 2

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

def primeFactors(n):
	from math import sqrt
	prime_factors = []
	while n % 2 == 0:
		prime_factors += [2]
		n = n / 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			prime_factors += [int(i)]
			n = n / i
	if n > 2:
		prime_factors += [int(n)]
	return prime_factors

def math_class(n):
	if n % 2 == 0:
		return [int(n / 2), int(n / 2)]
	pf = primeFactors(n)
	if len(pf) != 1:
		a = int(n / pf[0])
		b = a * (pf[0] - 1)
		return [a, b]
	return [1, n - 1]
outputs = []
for i in range(get_int()):
	outputs += [math_class(get_int())]
for out in outputs:
	print(str(out[0]) + ' ' + str(out[1]))


from math import gcd

def lcm(x, y):
	return x * y // gcd(x, y)

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

def divisor(n):
	d = []
	for x in range(1, 1 + int(n ** 0.5)):
		if n % x == 0:
			d.append(x)
			y = n // x
			if y != x:
				d.append(y)
	return d
for t in range(int(input())):
	n = int(input())
	if n % 2:
		if is_prime(n):
			print(1, n - 1)
		else:
			ans = (1, n - 1)
			l = n - 1
			d = divisor(n)
			for i in d:
				if i != n:
					L = lcm(i, n - i)
					if L < l:
						ans = (i, n - i)
						l = L
			print(*ans)
	else:
		a = n // 2
		print(a, a)


def smallest_divisor(n):
	if n % 2 == 0:
		return 2
	if n % 3 == 0:
		return 3
	d = 5
	while d * d <= n:
		if n % d == 0:
			return d
		d += 2
		if n % d == 0:
			return d
		d += 4
	return n
for _ in range(int(input())):
	n = int(input())
	d = smallest_divisor(n)
	print(n // d, n // d * (d - 1))


from collections import Counter
from collections import deque
from sys import stdin
from bisect import *
from heapq import *
import math
g = lambda : stdin.readline().strip()
gl = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs = lambda : [int(var) for var in g()]
mod = int(1000000000.0) + 7
inf = float('inf')
(t,) = gil()
for _ in range(t):
	(n,) = gil()
	i = 2
	ans = n - 1
	while i <= math.sqrt(n):
		if n % i == 0:
			ans = min(max(n - i, i), max(n // i, n - n // i), ans)
		i += 1
	print(ans, n - ans)


import math
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(str(n // 2) + ' ' + str(n // 2))
	else:
		a = 0
		for i in range(3, math.floor(n ** 0.5) + 1, 2):
			if n % i == 0:
				a = n // i
				print(str(a) + ' ' + str(n - a))
				break
		else:
			print('1 ' + str(n - 1))


import sys
import math
primes = []

def gen_primes(n):
	global primes
	upto = int(math.ceil(math.sqrt(n))) + 1
	isprime = [True] * (upto + 1)
	isprime[0] = False
	isprime[1] = False
	for i in range(2, upto):
		if not isprime[i]:
			continue
		else:
			for j in range(i * 2, upto, i):
				isprime[j] = False
	primes = [i for i in range(upto) if isprime[i]]

def solve(n):
	global primes
	(a, b) = (n, n + 1)
	factors = {}
	rem = n
	isprime = True
	for p in primes:
		while rem % p == 0:
			isprime = False
			if not p in factors:
				factors[p] = 0
			factors[p] += 1
			rem //= p
		if rem == 1:
			break
	if isprime or (len(factors) == 1 and n in factors):
		(a, b) = (1, n - 1)
	else:
		flist = sorted(factors.keys())
		f = flist[0]
		f2 = n // f
		f1 = n - f2
		(a, b) = sorted([f1, f2])
	return (a, b)
IN = [x.strip() for x in sys.stdin.readlines()]
T = int(IN[0])
vals = []
cur = 1
for ti in range(T):
	vals.append(int(IN[cur]))
	cur += 1
gen_primes(max(vals))
for v in vals:
	(a, b) = solve(v)
	print(a, b)


for _ in range(int(input())):
	n = int(input())
	if n == 2:
		print(1, 1)
		continue
	j = 2
	while j * j <= n and n % j:
		j += 1
	if j * j > n:
		j = n - 1
	print(n // j, n - n // j)


import math
t = int(input())
for i in range(0, t):
	n = int(input())
	m = 0
	max = 0
	a = 0
	if n % 2 == 0:
		print(n // 2, end=' ')
		print(n // 2)
		print()
	else:
		for j in range(2, int(math.sqrt(n)) + 1):
			if n % j == 0:
				m = 1
				a = n // j
				break
		if m == 0:
			print(1, end=' ')
			print(n - 1)
			print()
		else:
			print(a, end=' ')
			print(n - a)
			print()


t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		ans = 1
		tmp = float('inf')
		i = 2
		while i * i <= n:
			if n % i == 0:
				if n - i - i < tmp:
					tmp = n - i - i
					ans = i
				if n - n // i - n // i < tmp:
					tmp = n - n // i - n // i
					ans = n // i
			i += 1
		print(ans, n - ans)


t = int(input())
while t > 0:
	n = int(input())
	res = n - 1
	res_a = 1
	res_b = n - 1
	d = 2
	while d * d <= n:
		if n % d == 0:
			if res > n - d:
				res = n - d
				res_a = d
				res_b = n - d
			if res > n - int(n / d):
				res = n - int(n / d)
				res_a = int(n / d)
				res_b = n - int(n / d)
		d += 1
	print(res_a, res_b)
	t -= 1


import math

def getFact(n):
	i = 1
	arr = []
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				arr.append(i)
			else:
				arr.append(i)
				arr.append(n // i)
		i = i + 1
	arr.remove(n)
	return arr
for i in range(int(input())):
	n = int(input())
	x = max(getFact(n))
	print(min(x, n - x), max(x, n - x))


def factorise(n):
	org = n
	s = []
	while n % 2 == 0:
		s.append(2)
		n = n // 2
	start = 3
	while n > 1 and start <= org ** (1 / 2):
		while n % start == 0:
			s.append(start)
			n = n // start
		start += 1
	if n > 1:
		s.append(n)
	return s
t = int(input())
for ii in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		fact = factorise(n)
		fact.sort(reverse=True)
		sm = 1
		for i in fact[:-1]:
			sm *= i
		if (n - sm) % sm != 0:
			print('NO')
		print(sm, n - sm)


from math import gcd
lcm = lambda x, y: x * y // gcd(x, y)
t = int(input())
for _ in range(t):
	n = int(input())
	(u, v) = (1, n - 1)
	for i in range(1, n):
		if i * i > n:
			break
		x = i
		y = n - x
		if x and y and (lcm(x, y) < lcm(u, v)):
			(u, v) = (x, y)
		x = n // i
		y = n - x
		if x and y and (lcm(x, y) < lcm(u, v)):
			(u, v) = (x, y)
	print(u, v)


import math
for _ in range(int(input())):
	n = int(input())
	(s, k) = (int(math.sqrt(n)), False)
	for i in range(2, s + 1):
		if n % i == 0:
			x = n // i
			print(x, n - x)
			k = True
			break
	if k == False:
		print(1, n - 1)


import math
el = int(input())
for x in range(el):
	num = int(input())
	res = []
	for i in range(1, math.ceil(pow(num, 0.5)) + 5):
		if num % i == 0:
			res.append([i, num - i])
			res.append([num // i, num - num // i])
	resMin = num - 1
	for i in res:
		if max(i) < resMin:
			resMin = max(i)
	print(num - resMin, resMin)


import sys
import math
import heapq
import collections

def inputnum():
	return int(input())

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

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

def inputstring():
	return [x for x in input()]

def inputmatrixchar(rows):
	arr2d = [[j for j in input().strip()] for i in range(rows)]
	return arr2d

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d
t = int(input())
for q in range(t):
	n = inputnum()
	if n % 2 == 0:
		print(n // 2, n // 2)
		continue
	i = 3
	fac = 0
	while i * i <= n:
		if n % i == 0:
			fac = i
			break
		i += 2
	if fac == 0:
		fac = n
	print((fac - 1) * n // fac, n // fac)


import math
t = int(input())
for j in range(t):
	n = int(input())
	if n & 1:
		z = 1
		p = int(math.sqrt(n))
		for i in range(3, p + 1, 2):
			if n % i == 0:
				z = 0
				k = n // i
				print(k, n - k)
				break
		if z == 1:
			print(1, n - 1)
	else:
		print(n // 2, n // 2)


import math
t = int(input())
while t:
	n = int(input())
	if n % 2 == 0:
		print(int(n / 2), int(n / 2))
	else:
		i = 3
		check = 0
		while i <= int(math.sqrt(n)):
			if n % i == 0:
				j = max(i, n // i)
				p = min(i, n // i)
				p = p - 1
				print(j, j * p)
				check = 1
				break
			i = i + 2
		if check == 0:
			print(1, n - 1)
	t = t - 1


T = int(input())
while T > 0:
	n = int(input())
	res = n - 1
	for x in range(2, int(n ** 0.5) + 1):
		if n % x == 0:
			res = (x - 1) * n // x
			break
	print(str(n - res) + ' ' + str(res))
	T -= 1


def sdiv(n):
	i = 2
	while i * i <= n:
		if n % i == 0:
			return i
		i += 1
	return n
for _ in range(int(input())):
	n = int(input())
	print(n - n // sdiv(n) * (sdiv(n) - 1), n // sdiv(n) * (sdiv(n) - 1))


import math
from collections import defaultdict, Counter
import sys

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
import math

def pd(n):
	i = 1
	l = [1]
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(n // i)
				l.append(i)
		i = i + 1
	return l
if 1:
	for _ in range(int(input())):
		n = int(input())
		if n % 2 == 0:
			print(n // 2, n // 2)
		elif isPrime(n):
			print(n - 1, 1)
		else:
			l = pd(n)
			ma = 10000000000
			x = 1
			y = 1
			for i in l:
				if i != n:
					if ma > (n - i) * i / math.gcd(n - i, i):
						ma = (n - i) * i / math.gcd(n - i, i)
						(x, y) = (n - i, i)
			print(x, y)


import sys
import math
inpy = [int(x) for x in sys.stdin.read().split()]
t = inpy[0]
for _t in range(t):
	n = inpy[_t + 1]
	if n % 2 == 0:
		print(n // 2, n // 2)
		continue
	s = math.sqrt(n)
	i = 3
	while i <= s:
		if n % i == 0:
			print(n // i, n - n // i)
			break
		i += 2
	if n % i != 0:
		print(1, n - 1)


from sys import stdin
stdin.readline

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

def it():
	return int(stdin.readline().strip())
for _ in range(it()):
	n = it()
	i = 1
	v = []
	while i * i <= n:
		if n % i == 0:
			if i == n // i:
				v.append(i)
			else:
				v.append(i)
				v += [n // i]
		i += 1
	v.sort()
	print(v[-2], n - v[-2])


t = int(input())
while t > 0:
	n = int(input())
	(flag, k) = (0, 1)
	while k * k <= n:
		if n % (k + 1) == 0:
			flag = 1
			break
		k += 1
	(a, b) = (n / (k + 1), k * n / (k + 1))
	if flag == 1:
		print('{} {}'.format(int(a), int(b)))
	else:
		print('{} {}'.format(1, n - 1))
	t -= 1


import math
for t in range(int(input())):
	n = int(input())
	flag = 0
	ans = 0
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			ans = n // i
			flag = 1
			break
	if flag == 0:
		ans = 1
	L = [ans, n - ans]
	for i in range(2):
		if i == 0:
			print(L[0], end=' ')
		else:
			print(L[1])


import os
import heapq
import sys
import math
import bisect
import operator
from collections import defaultdict
from io import BytesIO, IOBase

def prime_factors(n):
	i = 2
	factors = set()
	while i * i <= n:
		if n % i:
			i += 1
		else:
			factors.add(n // i)
			n = n // i
			factors.add(i)
	if n > 1:
		factors.add(n)
	return factors

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

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

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

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

def main():
	for _ in range(int(input())):
		n = int(input())
		ans = [0, 0]
		lcm = 10 ** 18
		for i in range(1, int(math.sqrt(n) + 1)):
			if n % i == 0:
				res = lcmm(i, n - i)
				if res < lcm:
					ans = [i, n - i]
					lcm = res
				if n // i != n:
					res = lcmm(n // i, n - n // i)
					if res < lcm:
						ans = [n // i, n - n // i]
						lcm = res
		print(*ans)
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.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')
main()


def foo():
	n = int(input())
	p = 0
	for i in range(2, 100001, 1):
		if n % i == 0:
			p = i
			break
	if p == 0:
		p = n
	print(n // p, n - n // p)
for _ in range(int(input())):
	foo()


import sys, math
import io, os
from collections import defaultdict as dd, deque, Counter

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

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write(' '.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
mod = int(1000000000.0) + 7
for t in range(int(data())):
	n = int(data())
	m = n - 1
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			m = min(m, i - 1, n // i - 1)
	print(m * (n // (m + 1)), n // (m + 1))


import math

def get_divisor(n):
	res = []
	x = 1
	while n >= x * x:
		if n % x == 0:
			res.append(x)
			if n != x * x:
				res.append(n // x)
		x += 1
	return sorted(res)
t = int(input())
for _ in range(t):
	n = int(input())
	maxgcd = 1
	(a, b) = (1, n - 1)
	for d in get_divisor(n)[1:-1]:
		if math.gcd(d, n - d) > maxgcd:
			(a, b) = (d, n - d)
			maxgcd = math.gcd(d, n - d)
	print(a, b)


import math
import sys
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		minimum = sys.maxsize
		temp = n
		for j in range(1, int(math.sqrt(n)) + 1, 2):
			if n % j == 0:
				a = j
				b = n // j
				minimum = min(minimum, max(a, n - a), max(b, n - b))
		print(temp - minimum, minimum)


from collections import defaultdict
import sys, math
f = None
try:
	f = open('q1.input', 'r')
except IOError:
	f = sys.stdin
if 'xrange' in dir(__builtins__):
	range = xrange
sys.setrecursionlimit(10 ** 2)

def print_case_iterable(case_num, iterable):
	print('Case #{}: {}'.format(case_num, ' '.join(map(str, iterable))))

def print_case_number(case_num, iterable):
	print('Case #{}: {}'.format(case_num, iterable))

def print_iterable(A):
	print(' '.join(A))

def read_int():
	return int(f.readline().strip())

def read_int_array():
	return [int(x) for x in f.readline().strip().split(' ')]

def rns():
	a = [x for x in f.readline().split(' ')]
	return (int(a[0]), a[1].strip())

def read_string():
	return list(f.readline().strip())

def ri():
	return int(f.readline().strip())

def ria():
	return [int(x) for x in f.readline().strip().split(' ')]

def rns():
	a = [x for x in f.readline().split(' ')]
	return (int(a[0]), a[1].strip())

def rs():
	return list(f.readline().strip())

def bi(x):
	return bin(x)[2:]
from collections import deque
import math
NUMBER = 10 ** 9 + 7

def factorial(n):
	M = NUMBER
	f = 1
	for i in range(1, n + 1):
		f = f * i % M
	return f

def mult(a, b):
	return a * b % NUMBER

def minus(a, b):
	return (a - b) % NUMBER

def plus(a, b):
	return (a + b) % NUMBER

def egcd(a, b):
	if a == 0:
		return (b, 0, 1)
	else:
		(g, y, x) = egcd(b % a, a)
		return (g, x - b // a * y, y)

def modinv(a):
	m = NUMBER
	(g, x, y) = egcd(a, m)
	if g != 1:
		raise Exception('modular inverse does not exist')
	else:
		return x % m

def choose(n, k):
	if n < k:
		assert false
	return mult(factorial(n), modinv(mult(factorial(k), factorial(n - k)))) % NUMBER
from collections import deque, defaultdict
import heapq
from types import GeneratorType

def bootstrap(f, stack=[]):

	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to
	return wrappedfunc

def dfs(g, timeIn, timeOut, depths, parents):
	cnt = 0
	stack = [[1, 0, 0, 0]]
	while stack:
		(v, neig_i, parent, depth) = stack[-1]
		parents[v] = parent
		depths[v] = depth
		if neig_i == 0:
			timeIn[v] = cnt
			cnt += 1
		while neig_i < len(g[v]):
			u = g[v][neig_i]
			if u == parent:
				neig_i += 1
				continue
			stack[-1][1] = neig_i + 1
			stack.append([u, 0, v, depth + 1])
			break
		if neig_i == len(g[v]):
			stack.pop()
			timeOut[v] = cnt
			cnt += 1
cnt = 0

@bootstrap
def dfs(v, adj, timeIn, timeOut, depths, parents, parent=0, depth=0):
	global cnt
	parents[v] = parent
	depths[v] = depth
	timeIn[v] = cnt
	cnt += 1
	for u in adj[v]:
		if u == parent:
			continue
		yield dfs(u, adj, timeIn, timeOut, depths, parents, v, depth + 1)
	timeOut[v] = cnt
	cnt += 1
	yield

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

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

def get_num_2_5(n):
	twos = 0
	fives = 0
	while n > 0 and n % 2 == 0:
		n //= 2
		twos += 1
	while n > 0 and n % 5 == 0:
		n //= 5
		fives += 1
	return (twos, fives)

def shift(a, i, num):
	for _ in range(num):
		(a[i], a[i + 1], a[i + 2]) = (a[i + 2], a[i], a[i + 1])

def equal(x, y):
	return abs(x - y) <= 1e-09

def getAngle(a, b, c):
	ang = math.degrees(math.atan2(c[1] - b[1], c[0] - b[0]) - math.atan2(a[1] - b[1], a[0] - b[0]))
	return ang + 360 if ang < 0 else ang

def getLength(a, b):
	return math.sqrt((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2)
from heapq import heapify, heappush, heappop

def solution(n):
	i = 2
	while i * i <= n:
		if n % i == 0:
			return f'{(i - 1) * n // i} {n // i}'
		i += 1
	return f'1 {n - 1}'

def main():
	T = 1
	T = ri()
	for i in range(T):
		n = ri()
		x = solution(n)
		if 'xrange' not in dir(__builtins__):
			print(x)
		else:
			(print >> output, str(x))
	if 'xrange' in dir(__builtins__):
		print(output.getvalue())
		output.close()
if 'xrange' in dir(__builtins__):
	import cStringIO
	output = cStringIO.StringIO()
main()


def isprime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

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

def lcm(a, b):
	return a * b / gcd(a, b)
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif isprime(n):
		print(1, n - 1)
	else:
		for i in range(3, n // 2 + 1, 2):
			if n % i == 0:
				break
		a = n
		a = a // i
		a = a * (i - 1)
		print(a, n - a)


cases = int(input())
for i in range(cases):
	n = int(input())
	amax = 1
	bmax = n - 1
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			a = int(n / i)
			b = int(n - a)
			if b < bmax:
				amax = a
				bmax = b
	print(amax, bmax)


def l(n):
	i = 2
	while i * i <= n:
		if n % i == 0:
			return i
		i += 1
	return 1
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		t1 = l(n)
		if t1 == 1:
			print(1, n - 1)
		else:
			tp = n // t1 * (t1 - 1)
			print(tp, n - tp)


for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		i = 2
		x = False
		ss = 0
		while i * i <= n:
			if n % i == 0:
				x = True
				ss = i
				break
			i += 1
		if x:
			print(n // ss, n - n // ss)
		else:
			print(1, n - 1)


import sys
from math import gcd, ceil, sqrt
INF = float('inf')
MOD = 998244353
mod = 10 ** 9 + 7
from collections import Counter, defaultdict as df
from functools import reduce

def counter(l):
	return dict(Counter(l))

def printm(l):
	for i in range(len(l[0])):
		print(*l[i])

def so(x):
	return {k: v for (k, v) in sorted(x.items(), key=lambda item: item[1])}

def rev(l):
	return list(reversed(l))

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

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

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

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

def inputm(n, m):
	return [li() for i in range(m)]
for i in range(ini()):
	n = ini()
	i = 2
	for i in range(2, int(sqrt(n)) + 1):
		if not n % i:
			print(n // i, n - n // i)
			break
	else:
		print(1, n - 1)


t = int(input())
while t:
	n = int(input())
	ans = n
	for i in range(2, n):
		if i * i > n:
			break
		if n % i == 0:
			ans = i
			break
	print('{} {}'.format(int(n - n / ans), int(n / ans)))
	t -= 1


import sys, math
input = lambda : sys.stdin.readline()
lcm = lambda a, b: a * b // math.gcd(a, b)
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		div = []
		for i in range(1, int(math.sqrt(n)) + 1):
			if n % i == 0:
				if n // i == i:
					div.append(i)
				else:
					div.append(i)
					div.append(n // i)
		div = sorted(div)[:-1]
		ans = []
		for i in range(len(div)):
			ans.append([div[i], n - div[i], lcm(div[i], n - div[i])])
		ans.sort(key=lambda i: i[2])
		print(ans[0][0], ans[0][1])


for nt in range(int(input())):
	n = int(input())
	if not n % 2:
		print(n // 2, n // 2)
	else:
		ind = -1
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				ind = max(ind, i, n // i)
		if ind == -1:
			print(1, n - 1)
		else:
			print(ind, n - ind)


import sys
import heapq, functools, collections
import math, random
from collections import Counter, defaultdict
import math

def prime_factors(nr):
	i = 2
	factors = []
	while i <= nr:
		if i > math.sqrt(nr):
			i = nr
		if nr % i == 0:
			factors.append(i)
			nr = nr / i
		elif i == 2:
			i = 3
		else:
			i = i + 2
	return factors

def solve(k):
	console('----- solving ------')
	if k % 2 == 0:
		return '{} {}'.format(k // 2, k // 2)
	if k % 3 == 0:
		return '{} {}'.format(k // 3, 2 * k // 3)
	lst = sorted(list(set(prime_factors(k))))
	if len(lst) > 1:
		f = lst[0]
		return '{} {}'.format(k // f, (f - 1) * k // f)
	return '{} {}'.format(1, k - 1)

def console(*args):
	print('\x1b[36m', *args, '\x1b[0m', file=sys.stderr)
	return
for case_num in range(int(input())):
	k = int(input())
	res = solve(k)
	print(res)


import math

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

def lcm(a, b):
	return a * b / gcd(a, b)
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		ans = float('+inf')
		A = 1
		B = n - 1
		N = int(math.sqrt(n))
		for i in range(2, N + 1):
			if n % i == 0:
				a = i
				b = n - i
				x = lcm(a, b)
				if x < ans:
					ans = x
					A = a
					B = b
				a = n // i
				b = n - a
				x = lcm(a, b)
				if x < ans:
					ans = x
					A = a
					B = b
		print(A, B)


def gen_prime():
	num = [0 for i in range(int(10 ** 4.5) + 1)]
	num[2] = 1
	num[3] = 1
	for i in range(4, int(10 ** 4.5) + 1):
		isprime = True
		for j in range(2, int(i ** 0.5) + 1):
			if num[j]:
				if not i % j:
					isprime = False
					break
		if isprime:
			num[i] = 1
	prime = []
	for i in range(2, int(10 ** 4.5) + 1):
		if num[i]:
			prime.append(i)
	return prime
prime = gen_prime()
t = int(input())
while t:
	t -= 1
	n = int(input())
	found = False
	pos = -1
	for i in range(len(prime)):
		if not n % prime[i]:
			pos = i
			found = True
			break
	if found:
		print(n // prime[pos], n - n // prime[pos])
	else:
		print(1, n - 1)


def largest_divisor(n):
	i = 2
	while i * i <= n:
		if n % i == 0:
			return i
		i += 1
	return n
t = int(input())
for _ in range(t):
	n = int(input())
	d = largest_divisor(n)
	print(n // d, n // d * (d - 1))


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(t,) = I()
for _ in range(t):
	(n,) = I()
	a = b = 0
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			a = n // i
			b = n // i * (i - 1)
			break
	if a == 0:
		a = 1
		b = n - 1
	print(a, b)


from collections import Counter
from collections import defaultdict
from collections import deque
import math
import heapq
import sys
import io, os
input = sys.stdin.readline
from bisect import *
rs = lambda : input().strip()
ri = lambda : int(input())
rl = lambda : list(map(int, input().strip().split()))
rls = lambda : list(map(str, input().split()))

def factors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(int(n / i))
	return l
t = int(input())
for _ in range(0, t):
	n = int(input())
	x = factors(n)
	x.sort()
	x.remove(1)
	mn = float('inf')
	for i in x:
		a = n // i
		b = n - a
		lcm = a * b // math.gcd(a, b)
		if a + b == n and mn > lcm:
			mn = i
			ans1 = a
			ans2 = b
	print(ans1, ans2)


from sys import stdin, setrecursionlimit, stdout
from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi, gcd, sin, cos, asin
from heapq import heapify, heappop, heappush, heapreplace, heappushpop

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

def fi():
	return float(stdin.readline())

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

def fmi():
	return map(float, stdin.readline().split())

def li():
	return list(mi())

def si():
	return stdin.readline().rstrip()

def lsi():
	return list(si())
res = ['YES', 'NO']

def sieve(x):
	a = [True] * (x + 1)
	sq = floor(sqrt(x))
	for i in range(3, sq + 1, 2):
		if a[i]:
			for j in range(i * i, x + 1, i):
				a[j] = False
	if x > 1:
		p = [2]
	else:
		p = []
	for i in range(3, x + 1, 2):
		if a[i]:
			p.append(i)
	return p
p = sieve(31650)
test_case = ii()
while test_case:
	test_case -= 1
	n = ii()
	x = 1
	for i in p:
		if not n % i:
			x = n // i
			break
		if i * i > n:
			break
	print(x, n - x)


def prime(k):
	ans = -1
	for i in range(2, int(k ** 0.5) + 1):
		if k % i == 0:
			return i
	return -1
t = int(input())
for _ in range(t):
	n = int(input())
	k = prime(n)
	if k == -1:
		print(1, n - 1)
	else:
		print(n // k, n - n // k)


import sys
INF = 10 ** 20
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import gcd
from math import ceil
from collections import defaultdict as dd, Counter
from bisect import bisect_left as bl, bisect_right as br

def find(x):
	ans = []
	for i in range(1, int(x ** 0.5) + 1):
		if x % i:
			continue
		ans.append(i)
		ans.append(x // i)
	return ans

def solve():
	(n,) = I()
	f = find(n)
	ans = INF
	A = B = -1
	cur = INF
	for i in f:
		a = i
		b = n - i
		if not a or not b:
			continue
		if a * b // gcd(a, b) < cur:
			cur = a * b // gcd(a, b)
			A = a
			B = b
	print(A, B)
(t,) = I()
while t:
	t -= 1
	solve()


import math

def PrimeFactors(n):
	if n % 2 == 0:
		return 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		if n % i == 0:
			return i
	return n
t = int(input())
nums = []
for i in range(t):
	nums.append(int(input()))
output = []
for n in nums:
	smallestPrime = PrimeFactors(n)
	output.append([n // smallestPrime, (smallestPrime - 1) * n // smallestPrime])
for out in output:
	print(*out)


t = int(input())
for _ in range(t):
	n = int(input())
	k = n
	for i in range(2, 100000):
		if n % i == 0:
			k = i
			break
	if k == n:
		print(1, n - 1)
	else:
		print(n // k, n - n // k)


def solve():
	n = int(input())
	q = int(n ** 0.5)
	for p in range(2, q + 1):
		if n % p == 0:
			return (n // p, n - n // p)
	return (1, n - 1)
CASE = int(input())
for case in range(0, CASE):
	print('%d %d' % solve())


import os
import sys
from io import BytesIO, IOBase
import math
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.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')
t = int(input())
for _ in range(t):
	inp = int(input())
	n = inp
	f = 0
	ff = int(n ** 0.5)
	for i in range(2, ff + 1):
		if n % i == 0:
			f = i
			break
	if f == 0:
		print(1, n - 1, sep=' ')
	else:
		q = f
		r = n // q
		n1 = (q - 1) * r
		n2 = r
		print(n1, n2, sep=' ')


n = int(input())
for i2 in range(n):
	x = int(input())
	o = 1
	for i in range(2, int(x ** 0.5) + 1):
		if x % i == 0:
			print(x // i, x - x // i)
			o = 0
			break
	if o == 1:
		print(1, x - 1)


def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	a = []
	for p in range(2, n):
		if prime[p]:
			a.append(p)
	return a
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		x = sieve(100001)
		y = len(x)
		arr = []
		i = 0
		while i < y:
			if n == 1:
				break
			elif n % x[i] == 0:
				arr.append(x[i])
				n = n // x[i]
			else:
				i += 1
		if n > x[y - 1]:
			arr.append(n)
		z = len(arr)
		result1 = 1
		for j in range(1, z):
			result1 *= arr[j]
		result2 = result1 * arr[0]
		print(result1, result2 - result1)


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

def lcm(a, b):
	return a * b / gcd(a, b)
for _ in range(int(input())):
	n = int(input())
	minDiv = -1
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			minDiv = i
			break
	l = n // minDiv
	if minDiv == -1:
		print(1, n - 1)
	else:
		print(l, l * (minDiv - 1))


import math
for i in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		lst = []
		i = 1
		while i <= math.sqrt(n):
			if n % i == 0:
				if n / i == i:
					lst.append(i)
				else:
					lst.append(i)
					lst.append(n // i)
			i = i + 1
		ans = n - 1
		for i in range(1, len(lst)):
			ans = min(ans, (lst[i] - 1) * (n // lst[i]))
		print(n - ans, ans)


import math
k = input()
for l in range(int(k)):
	n = int(input())
	yes = False
	for i in range(2, int(math.sqrt(n) + 1)):
		if n % i == 0:
			print(int(n / i), ' ', int((i - 1) * (n / i)))
			yes = True
			break
	if yes == False:
		print('1 ', n - 1)


for _ in range(int(input())):
	n = int(input())
	if n & 1 == 0:
		print(n // 2, n // 2)
	else:
		factors = set()
		i = 1
		while i * i <= n:
			if n % i == 0:
				factors.add(i)
				factors.add(n // i)
			i += 1
		factors.remove(n)
		a = max(factors)
		b = n - a
		print(a, b)


from sys import stdin, stdout
from math import gcd, sqrt
from collections import deque
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\n')
L = lambda : list(R())
P = lambda x: stdout.write(x)
lcm = lambda x, y: x * y // gcd(x, y)
hg = lambda x, y: (y + x - 1) // x * x
pw = lambda x: 1 if x == 1 else 1 + pw(x // 2)
chk = lambda x: chk(x // 2) if not x % 2 else True if x == 1 else False
sm = lambda x: (x ** 2 + x) // 2
N = 10 ** 9 + 7
for _ in range(I()):
	n = I()
	if n & 1:
		ans = 1
		for i in range(3, int(sqrt(n)) + 1, 2):
			if n % i == 0:
				ans = n // i
				break
		print(ans, n - ans)
	else:
		print(n // 2, n // 2)


from os import path
import sys
from heapq import heappush, heappop
from functools import cmp_to_key as ctk
from collections import deque, defaultdict as dd
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

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

def si():
	return input()

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

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def bo(i):
	return ord(i) - ord('a')
file = 1

def solve():
	for _ in range(ii()):
		n = ii()
		if n % 2 == 0:
			print(n // 2, n // 2)
		else:
			ans = 1
			for i in range(2, int(sqrt(n)) + 1):
				if n % i == 0:
					ans = max(ans, i)
					ans = max(ans, n // i)
			print(n - ans, ans)
if file:
	if path.exists('input1.txt'):
		sys.stdin = open('input1.txt', 'r')
		sys.stdout = open('output1.txt', 'w')
	else:
		input = sys.stdin.readline
solve()


t = int(input())
for q in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		ik = 2
		while ik * ik <= n:
			if n % ik == 0:
				break
			ik += 1
		if ik * ik > n:
			print(1, n - 1)
		else:
			print(n // ik, n - n // ik)


for _ in range(int(input())):
	n = int(input())
	shit = 0
	for i in range(2, int(n ** 0.5) + 1):
		prime = 1
		if n % i == 0:
			shit = i
			break
	if shit == 0:
		print(1, n - 1)
	else:
		print(n // shit, n // shit * (shit - 1))


def divisor(i):
	s = []
	for j in range(1, int(i ** (1 / 2)) + 1):
		if i % j == 0:
			s.append(i // j)
			s.append(j)
	return sorted(set(s))
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		(a, b) = (n // 2, n // 2)
	else:
		a = 0
		p = divisor(n)
		for i in p:
			if n - i >= i:
				(a, b) = (i, n - i)
			else:
				break
	print(a, b)


t = int(input())
for i in range(t):
	n = int(input())
	flag = True
	if n % 2 == 0:
		print(n // 2, n // 2)
		flag = False
	else:
		for i in range(3, int(n ** 0.5) + 2):
			if n % i == 0:
				print(n - n // i, n // i)
				flag = False
				break
	if flag:
		print(n - 1, 1)


import math

def P(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def shrey():
	n = int(input())
	ans1 = 0
	if n % 2 == 0:
		print(n // 2, end=' ')
		print(n // 2)
	elif P(n):
		print(1, end=' ')
		print(n - 1)
	else:
		for i in range(3, int(math.sqrt(n)) + 1):
			if n % i == 0:
				ans1 = n // i
				break
		print(ans1, end=' ')
		print(n - ans1)
T = input()
T = int(T)
for q in range(1, T + 1):
	shrey()


import collections
t = int(input())
se = set()
import math
for i in range(t):
	n = int(input())
	p = 0
	for i in range(2, 100000):
		if n % i == 0:
			p = i
			break
	if p == 0:
		p = n
	print(n // p, n - n // p)


import math
for i in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		f = 0
		for i in range(3, int(math.sqrt(n)) + 1, 2):
			if n % i == 0:
				f = 1
				break
		if f == 1:
			a = n // i
			b = a * (i - 1)
			print(a, b)
		else:
			print(1, n - 1)


from sys import stdin, stdout
import heapq as hq
from collections import defaultdict
t = int(input())
for tc in range(t):
	n = int(stdin.readline())
	n0 = n
	divs = []
	d = 2
	while n >= d ** 2:
		if n % d == 0:
			n //= d
			divs.append(d)
		else:
			d += 1
	if n > 1:
		divs.append(n)
	a = 1
	for d in divs:
		a *= d
	a //= divs[0]
	stdout.write(str(a) + ' ' + str(n0 - a) + '\n')


import sys, bisect, string, math, time, functools, random, fractions
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
from itertools import permutations, combinations, groupby
rep = range

def Golf():
	(n, *t) = map(int, open(0).read().split())

def I():
	return int(input())

def S_():
	return input()

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

def LS():
	return [i for i in input().split()]

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

def LI():
	return [int(i) for i in input().split()]

def LI_():
	return [int(i) - 1 for i in input().split()]

def NI(n):
	return [int(input()) for i in range(n)]

def NI_(n):
	return [int(input()) - 1 for i in range(n)]

def StoLI():
	return [ord(i) - 97 for i in input()]

def ItoS(n):
	return chr(n + 97)

def LtoS(ls):
	return ''.join([chr(i + 97) for i in ls])

def RA():
	return map(int, open(0).read().split())

def GI(V, E, ls=None, Directed=False, index=1):
	org_inp = []
	g = [[] for i in R(V)]
	FromStdin = True if ls == None else False
	for i in R(E):
		if FromStdin:
			inp = LI()
			org_inp.append(inp)
		else:
			inp = ls[i]
		if len(inp) == 2:
			(a, b) = inp
			c = 1
		else:
			(a, b, c) = inp
		if index == 1:
			a -= 1
			b -= 1
		aa = (a, c)
		bb = (b, c)
		g[a].append(bb)
		if not Directed:
			g[b].append(aa)
	return (g, org_inp)

def GGI(h, w, search=None, replacement_of_found='.', mp_def={'#': 1, '.': 0}, boundary=1):
	mp = [boundary] * (w + 2)
	found = {}
	for i in R(h):
		s = input()
		for char in search:
			if char in s:
				found[char] = (i + 1) * (w + 2) + s.index(char) + 1
				mp_def[char] = mp_def[replacement_of_found]
		mp += [boundary] + [mp_def[j] for j in s] + [boundary]
	mp += [boundary] * (w + 2)
	return (h + 2, w + 2, mp, found)

def TI(n):
	return GI(n, n - 1)

def accum(ls):
	rt = [0]
	for i in ls:
		rt += [rt[-1] + i]
	return rt

def bit_combination(n, base=2):
	rt = []
	for tb in R(base ** n):
		s = [tb // base ** bt % base for bt in R(n)]
		rt += [s]
	return rt

def gcd(x, y):
	if y == 0:
		return x
	if x % y == 0:
		return y
	while x % y != 0:
		(x, y) = (y, x % y)
	return y

def YN(x):
	print(['NO', 'YES'][x])

def Yn(x):
	print(['No', 'Yes'][x])

def show(*inp, end='\n'):
	if show_flg:
		print(*inp, end=end)
mo = 10 ** 9 + 7
inf = float('inf')
FourNb = [(-1, 0), (1, 0), (0, 1), (0, -1)]
EightNb = [(-1, 0), (1, 0), (0, 1), (0, -1), (1, 1), (-1, -1), (1, -1), (-1, 1)]
compas = dict(zip('WENS', FourNb))
cursol = dict(zip('LRUD', FourNb))
l_alp = string.ascii_lowercase
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
input = lambda : sys.stdin.readline().rstrip()
show_flg = False
show_flg = True

def solve(n):
	ans = n - 1
	rt = (1, n - 1)
	for i in rep(1, min(int(n ** 0.5) + 2, n + 1))[::-1]:
		if n % i == 0:
			d = i
			x = n // d
			a = 1
			b = x - 1
			a *= d
			b *= d
			tmp = a * b // gcd(a, b)
			if a == 0 or b == 0:
				continue
			if ans > tmp:
				rt = (a, b)
				ans = tmp
			d = n // i
			x = n // d
			a = 1
			b = x - 1
			a *= d
			b *= d
			tmp = a * b // gcd(a, b)
			if a == 0 or b == 0:
				continue
			if ans > tmp:
				rt = (a, b)
				ans = tmp
	return rt
ans = 0
for i in rep(I()):
	n = I()
	rt = solve(n)
	print(*rt)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
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 time import perf_counter
from fractions import Fraction
mod = int(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)]
try:
	sys.stdin = open('input.txt', 'r')
except:
	pass
T = int(input())
for _ in range(T):
	n = L()[0]
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		d = {}
		ans = -1
		for i in range(2, int(n ** 0.5) + 2):
			if n % i == 0:
				ans = i
				break
		if ans == -1:
			print(1, n - 1)
		else:
			print(n // ans, n - n // ans)


t = int(input())
for _ in range(t):
	n = int(input())
	isPrime = True
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			isPrime = False
			a = n // i
			b = n - a
			print('{} {}'.format(a, b))
			break
	if isPrime:
		print('{} {}'.format(1, n - 1))


I = lambda : list(map(int, input().split()))

def lcm(a, b):
	import math as mt
	return a * b // mt.gcd(a, b)
for tc in range(int(input())):
	(n,) = I()
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		ans = 3
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				ans = i
				break
		ans = [(1, n - 1, lcm(1, n - 1)), (n // 3, n - n // 3, lcm(n // 3, n - n // 3)), (n // ans, n - n // ans, lcm(n // ans, n - n // ans))]
		ans.sort(key=lambda x: x[2])
		temp = list(ans[0])[:len(ans) - 1]
		print(*temp)


import math
t = int(input())
for i in range(t):
	n = int(input())
	j = 2
	ans = 0
	while j <= math.sqrt(n):
		if n % j == 0:
			ans = n * (j - 1) // j
			break
		j += 1
	if ans == 0:
		print(str(n - 1) + ' 1')
	else:
		print(str(ans) + ' ' + str(n - ans))


for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		n1 = int(n ** 0.5)
		ch = 1
		for i in range(2, n1 + 1):
			if n % i == 0:
				ch = 0
				num = n // i
				break
		if ch == 1:
			print(1, n - 1)
		else:
			print(num, n - num)


import math

def primenum(x):
	count = 0
	for i in range(2, int(math.floor(math.sqrt(x))) + 1):
		if x % i == 0:
			count = count + 1
	if count == 0:
		return True
	else:
		return False
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif primenum(n) == True:
		print(1, n - 1)
	else:
		for i in range(2, n + 1):
			if n % i == 0:
				k = n // i
				break
		print(min(n - k, k), max(n - k, k))


import sys
import math
ii = lambda : sys.stdin.readline().strip()
idata = lambda : [int(x) for x in ii().split()]

def solve():
	n = int(ii())
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			print(n // i, n - n // i)
			return
	print(n - 1, 1)
	return
for t in range(int(ii())):
	solve()


for t in range(int(input())):
	n = int(input())
	if not n % 2:
		print(f'{n // 2} {n // 2}')
	else:
		idx = 1
		for i in range(3, int(n ** 0.5) + 1):
			if not n % i:
				idx = i
				break
		print(f'{n // idx} {n - n // idx}' if idx > 1 else f'{1} {n - 1}')


import math

def factors(n1):
	num = int(math.sqrt(n1)) + 1
	lis = []
	for i in range(1, num):
		if n % i == 0:
			lis.append(i)
			lis.append(n // i)
	lis.sort()
	return lis[-2]
t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		a = factors(n)
		b = n - a
		print(a, b)


from sys import stdin
input = stdin.buffer.readline
for _ in range(int(input())):
	n = int(input())
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			print(n // i, n - n // i)
			break
	else:
		print(1, n - 1)


import math
a = int(input())
for i in range(0, a):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		ans = 1
		for i in range(2, int(math.sqrt(n)) + 1):
			if n % i == 0:
				ans = i
				break
		if ans == 1:
			print(1, n - 1)
		else:
			print(n // ans, n // ans * (ans - 1))


import math
import random
from collections import *
mod = 1000000007
r1 = lambda : int(input())
rm = lambda : map(int, input().split())
rms = lambda : map(str, input().split())
rls = lambda : list(rm())

def def_value():
	return 'nan'

def solve():
	test = r1()
	while test:
		test -= 1
		n = r1()
		ans = 1
		x = int(n ** 0.5)
		for i in range(2, x + 2):
			if n % i == 0:
				ans = i
				break
		a = n // ans
		if ans == 1:
			a = 1
		print(a, n - a)
solve()


for _ in range(int(input())):
	n = int(input())
	d = 2
	while d * d <= n:
		if n % d == 0:
			print(n // d, n - n // d)
			break
		d += 1
	else:
		print(1, n - 1)


import math

def printDivisors(n):
	ma = -1
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				ma = max(ma, i)
			else:
				ma = max(ma, i)
				if i != 1:
					ma = max(ma, n // i)
		i = i + 1
	return ma
t = int(input())
for _ in range(t):
	n = int(input())
	ma = printDivisors(n)
	print(ma, n - ma)


def gcd(x, y):
	if y == 0:
		return x
	return gcd(y, x % y)

def lcm(x, y):
	return x * y // gcd(x, y)
for u in range(int(input())):
	n = int(input())
	if n & 1 == 0:
		print(n // 2, n // 2)
	else:
		x = [1]
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				if i ** 2 == n:
					x.append(i)
				else:
					x.append(i)
					x.append(n // i)
		t = lcm(x[0], n - x[0])
		ans = [x[0], n - x[0]]
		for i in range(1, len(x)):
			temp = lcm(x[i], n - x[i])
			if temp < t:
				ans = [x[i], n - x[i]]
				t = temp
		print(*ans)


import math

def go(i):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			print(n // i, n - n // i)
			return
	print(1, n - 1)
t = int(input())
for x in range(t):
	n = int(input())
	go(n)


from math import gcd, sqrt, ceil
for _ in range(int(input())):
	n = int(input())
	mn = 1000000000000
	ans = f'{1} {n - 1}'
	for i in range(2, ceil(sqrt(n)) + 1):
		if n % i != 0:
			continue
		a = n // i
		b = n - a
		mn1 = a * b // gcd(a, b)
		if mn1 < mn:
			mn = mn1
			ans = f'{a} {b}'
	print(ans)


t = int(input())
for tt in range(0, t):
	n = int(input())
	if n % 2 != 0:
		c = 0
		for i in range(2, round(n ** 0.5) + 1):
			if n % i == 0:
				c = 1
				print(round(n / i), n - round(n / i))
				break
		if c == 0:
			print(1, n - 1)
	else:
		print(round(n / 2), round(n / 2))


def list_divs(x):
	divs = []
	for y in range(1, int(x ** 0.5) + 1):
		if x % y == 0:
			divs.append(y)
			if y != x // y:
				divs.append(x // y)
	divs.sort()
	return divs

def solve():
	from math import gcd
	t = int(input())
	for _ in range(t):
		n = int(input())
		cnd = list_divs(n)
		ans = [10 ** 10, 0, 0]
		for i in cnd:
			(a, b) = (i, n - i)
			if b == 0:
				continue
			lcm = a * b // gcd(a, b)
			if lcm < ans[0]:
				ans = (lcm, a, b)
		print(*ans[1:])
solve()


def solve():
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
		return
	end = 0
	for i in range(3, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			end = 1
			break
	if end == 1:
		print(n // i, n - n // i)
	else:
		print(n - 1, 1)
t = int(input())
for _ in range(t):
	solve()


import sys
from collections import defaultdict as dd
from collections import deque
from fractions import Fraction as f
from copy import *
from bisect import *
from heapq import *
from math import *
from itertools import permutations

def eprint(*args):
	print(*args, file=sys.stderr)
zz = 1
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')

def li():
	return [int(x) for x in input().split()]

def fli():
	return [float(x) for x in input().split()]

def gi():
	return [x for x in input().split()]

def fi():
	return int(input())

def swap(a, i, j):
	(a[i], a[j]) = (a[j], a[i])

def si():
	return list(input().rstrip())

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

def gh():
	sys.stdout.flush()

def graph(n, m):
	for i in range(m):
		(x, y) = mi()
		a[x].append(y)
		a[y].append(x)

def bo(i):
	return ord(i) - ord('a')
t = fi()
while t > 0:
	t -= 1
	n = fi()
	flag = 0
	mini = 10 ** 18
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		for i in range(2, int(sqrt(n)) + 10):
			if n % i == 0:
				if (n - i) % i == 0:
					mini = min(mini, max(i, n - i))
				p = n // i
				if (n - p) % p == 0:
					mini = min(mini, max(p, n - p))
		if mini == 10 ** 18:
			print(1, n - 1)
		else:
			print(n - mini, mini)


t = int(input())
for T in range(t):
	n = int(input())
	(v1, v2) = (1, n - 1)
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			v1 = n // i
			v2 = n - v1
			break
	print(v1, v2)


import math

def factor(n):
	k = int(math.sqrt(n))
	for i in range(2, k + 1):
		if n % i == 0:
			return i
	return n
t = int(input())
while t:
	n = int(input())
	k = factor(n)
	if k == n:
		print(1, n - 1)
	else:
		temp1 = n // k
		temp2 = n - temp1
		print(temp1, temp2)
	t = t - 1


def solve(n):
	if n % 2 == 0:
		print(n // 2, n // 2)
		return
	else:
		k = 2
		while k * k <= n:
			if n % k == 0:
				print(n // k, n - n // k)
				return
			k += 1
		print(1, n - 1)
	pass

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

def lcm(a, b):
	return a * b / gcd(a, b)
t = int(input())
for i in range(0, t):
	n = int(input())
	solve(n)


tc = int(input())
for x in range(tc):
	n = int(input())
	if n % 2 == 0:
		print(int(n / 2), int(n / 2))
		continue
	else:
		ans1 = 1
		ans2 = n - 1
		i = 3
		while i * i <= n:
			if n % i == 0:
				ans1 = int(n / i)
				ans2 = n - ans1
				break
			i += 1
		print(ans1, ans2)


t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		fact_lst = []
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				fact_lst.append(i)
				break
		else:
			fact_lst.append(0)
		temp = min(fact_lst)
		if temp != 0:
			temp = n // temp
			print(temp, n - temp)
		else:
			print(1, n - 1)


import math
import sys
from sys import stdin
input = sys.stdin.readline

def smallestDivisor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		div = smallestDivisor(n)
		if div == n:
			print(1, n - 1)
		else:
			print(n // div, n - n // div)


import math

def solve(n):
	if n % 2 == 0:
		return (n // 2, n // 2)
	else:
		x = int(math.sqrt(n))
		mx = -float('inf')
		for i in range(2, x + 1):
			if n % i == 0:
				mx = max(mx, i, n // i)
		if mx == -float('inf'):
			return (1, n - 1)
		lcm = float('inf')
		(final1, final2) = (0, 0)
		no = n // mx
		for i in range(1, no):
			(x, y) = (i, no - i)
			(a, b) = (x * mx, y * mx)
			lm = a * b / math.gcd(a, b)
			if lm < lcm:
				lcm = lm
				(final1, final2) = (a, b)
		return (min(final1, final2), max(final1, final2))
t = int(input())
for _ in range(t):
	n = int(input())
	(a, b) = solve(n)
	print(a, b)


testCase = int(input())
while testCase > 0:
	element = int(input())
	i = 2
	a = 0
	b = 0
	check = 1
	while i * i <= element:
		if element % i == 0:
			a = element // i
			b = element - a
			check = 0
			break
		i += 1
	if check == 1:
		a = 1
		b = element - 1
	print(a, end=' ')
	print(b)
	testCase -= 1


qt = int(input())
for ki in range(qt):
	n = int(input())
	a = 1
	for i in range(2, int(pow(n, 0.5) + 1)):
		if n % i == 0:
			a = n / i
			break
	print(int(a), end='')
	print(' ', end='')
	print(int(n - a))


def calculate(n):
	if n % 2 == 0:
		return (int(n / 2), int(n / 2))
	ans = -1
	i = 2
	while i ** 2 <= n:
		if n % i == 0:
			ans = max(ans, i)
			ans = max(ans, n / i)
		i += 1
	if ans == -1:
		ans = 1
	return (int(ans), int(n - ans))
for i in range(int(input())):
	print(' '.join(map(str, calculate(int(input())))))


import sys
import math
import heapq
from collections import defaultdict, deque
from decimal import *

def r():
	return int(input())

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

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

def isPrime(p):
	if p == 1:
		return 0
	if p == 2 or p == 3:
		return 1
	if p % 2 == 0 or p % 3 == 0:
		return 0
	for i in range(5, int(math.sqrt(p)) + 1, 6):
		if p % i == 0 or p % (i + 2) == 0:
			return 0
	return 1
for _ in range(r()):
	n = r()
	if isPrime(n) == 1:
		print(1, n - 1)
		continue
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			maxGcd = i
			break
	rema = n // maxGcd
	print(rema * 1, rema * (maxGcd - 1))


import math

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

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

def solve():
	n = int(input())
	a = n - 1
	b = 1
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			if lcm(i, n - i) < lcm(a, b):
				a = i
				b = n - a
			if lcm(n // i, n - n // i) < lcm(a, b):
				a = n // i
				b = n - a
	print(a, b)
test = int(input())
for _ in range(test):
	solve()


def solve():
	n = int(input())
	ans = int(1e+18)
	ans_pair = (-1, -1)
	i = 2
	while i * i <= n:
		if n % i == 0 and max(i, n - i) % min(i, n - i) == 0 and (max(i, n - i) < ans):
			ans = max(i, n - i)
			ans_pair = (i, n - i)
			val = n // i
			if max(val, n - val) % min(val, n - val) == 0 and max(val, n - val) < ans:
				ans = max(val, n - val)
				ans_pair = (val, n - val)
		i += 1
	if n % 2 == 0 and ans > n // 2:
		ans = n // 2
		ans_pair = (n // 2, n // 2)
	elif ans > n - 1:
		ans_pair = (1, n - 1)
	print(ans_pair[0], ans_pair[1])
	return
t = 1
t = int(input())
while t > 0:
	t -= 1
	solve()


def hello(x):
	for i in range(2, x):
		if i * i > x:
			break
		elif x % i == 0:
			return i
	return -1
for _ in range(int(input())):
	n = int(input())
	a = hello(n)
	if a == -1:
		print(1, n - 1)
	else:
		print(n // a, n - n // a)


from math import sqrt
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif n == 3:
		print(1, 2)
	elif n == 5:
		print(1, 4)
	elif n == 7:
		print(1, 6)
	else:
		for i in range(3, int(sqrt(n)) + 1):
			if n % i == 0:
				print(n // i, n // i * (i - 1))
				break
			if i == int(sqrt(n)):
				print(1, n - 1)
				break


import sys
import string
from collections import defaultdict as dd
from collections import deque
import bisect
import heapq
import math

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

def rl():
	return list(map(int, input().split()))
t = ri()
for _ in range(t):
	n = ri()
	if n % 2 == 0:
		ans = [n // 2, n // 2]
	else:
		for p in range(3, int(math.sqrt(n)) + 1):
			if n % p == 0:
				ans = [n // p, n - n // p]
				break
		else:
			ans = [1, n - 1]
	print(*ans)


rw = int(input())
for ewqr in range(rw):
	n = int(input())
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			print(n // i, n - n // i)
			break
	else:
		print(1, n - 1)


import os
import sys
from io import BytesIO, IOBase
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.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 math import gcd, ceil

def pre(s):
	n = len(s)
	pi = [0] * n
	for i in range(1, n):
		j = pi[i - 1]
		while j and s[i] != s[j]:
			j = pi[j - 1]
		if s[i] == s[j]:
			j += 1
		pi[i] = j
	return pi

def prod(a):
	ans = 1
	for each in a:
		ans = ans * each
	return ans

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

def binary(x, length=16):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y
a = [i for i in range(1, 1001, 2)]

def fact(n):
	minn = n - 1
	ans = [1, n - 1]
	for i in range(2, int(n ** 0.5) + 7):
		if i == n:
			break
		if n % i == 0:
			ans2 = fact(i)
			(x, y) = (ans2[0] * (n // i), ans2[1] * (n // i))
			l = lcm(x, y)
			if l <= minn:
				minn = l
				ans = [x, y]
	return ans
for _ in range(int(input()) if True else 1):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
		continue
	ans = fact(n)
	print(ans[0], ans[1])


import math, itertools, fractions, heapq, collections, bisect, sys, 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 I():
	return int(sys.stdin.readline())

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

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

def S():
	return input()

def f(n):
	ret = 1
	for i in range(2, int(math.sqrt(n)) + 3):
		if n % i == 0:
			ret = max(ret, n // i, i)
	return ret

def main():
	n = I()
	ans = []
	for _ in range(n):
		k = I()
		if k % 2 == 0:
			ans.append(str(k // 2) + ' ' + str(k // 2))
		else:
			x = f(k)
			ans.append(str(x) + ' ' + str(k - x))
	for x in ans:
		print(x)
main()


import math as m
t = int(input())
for _ in range(t):
	n = int(input())
	div = []
	for i in range(2, int(m.sqrt(n)) + 1):
		if n % i == 0:
			div.append(i)
			div.append(n // i)
	a = 1
	c = 10 ** 15
	div = list(set(div))
	div.append(1)
	for i in div:
		if n % i == 0 and c > n // i - 1:
			c = n // i - 1
			a = i
	print(a, a * c)


def Solve(n):
	d = 2
	while d * d <= n:
		if n % d == 0:
			return n // d
		d += 1
	return 1
T = int(input())
for _ in range(T):
	n = int(input())
	ans = Solve(n)
	print(ans, n - ans)


import math
n = int(input())

def mdc(a, b):
	return abs(a * b) // math.gcd(a, b)

def menor(x):
	i = 2
	while i * i <= x:
		if x % i == 0:
			return str(int(x / i)) + ' ' + str(int(x - x / i))
		i += 1
	return '1 ' + str(x - 1)
for i in range(n):
	x = int(input())
	if x % 2 == 0:
		a = str(x // 2)
		print(a + ' ' + a)
		continue
	a = menor(x)
	print(a)


n = int(input())
for i in range(n):
	x = int(input())
	r = 1
	for j in range(2, min(x, 10 ** 5)):
		if x % j == 0:
			r = x // j
			break
	print(r, x - r)


import os
import sys
from io import BytesIO, IOBase
from collections import Counter, defaultdict
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.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')
primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919]
from math import ceil

def lmii():
	return list(map(int, input().split()))
t = int(input())
for i in range(t):
	n = int(input())
	p = 0
	for j in range(2, int(n ** 0.5) + 1):
		if n % j == 0:
			p = j
			break
	if p == 0:
		p = n
	print(n // p, n - n // p)


from math import gcd
from sys import stdin

def prime_factors(n):
	ret = []
	apnd = ret.append
	while n >= 4:
		if n % 2:
			break
		else:
			n //= 2
			apnd(2)
	i = 3
	while n >= i * i:
		if n % i:
			i += 2
		else:
			n //= i
			apnd(i)
	apnd(n)
	return ret

def main():
	input = lambda : stdin.readline()[:-1]
	lcm = lambda x, y: x * y // gcd(x, y)
	T = int(input())
	for _ in [0] * T:
		N = int(input())
		ans = []
		if N % 2:
			num = prime_factors(N)
			a = N
			for i in num:
				a //= i
				b = N - a
				lcm_ = lcm(a, b)
				ans.append((lcm_, a, b))
			ans.sort()
			print(ans[0][1], ans[0][2])
		else:
			a = N // 2
			print(a, a)
main()


def factors(n):
	a = []
	x = 1
	while x * x <= n:
		if n % x == 0:
			a.append(x)
			a.append(n // x)
		x += 1
	return a
t = int(input())
for _ in range(t):
	n = int(input())
	a = factors(n)
	a.sort()
	print(a[-2])
	print(n - a[-2])


import sys
t = int(sys.stdin.readline())
nums = []
for i in range(t):
	nums.append(int(sys.stdin.readline()))

def smallestDivisor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i ** 2 <= n:
		if n % i == 0:
			return i
		i += 2
	return n

def solve(n):
	d = smallestDivisor(n)
	return (n // d, n - n // d)
for n in nums:
	(a, b) = solve(n)
	print(str(a) + ' ' + str(b))


def read_int():
	return int(input())

def read_ints():
	return map(int, input().split(' '))
t = read_int()
for case_num in range(t):
	n = read_int()
	i = 2
	ans = (1, n - 1)
	val = n - 1
	while i * i <= n:
		if n % i == 0:
			a = i
			b = n // i
			if (a - 1) * b < val:
				val = (a - 1) * b
				ans = (b, (a - 1) * b)
			if a * (b - 1) < val:
				val = a * (b - 1)
				ans = (a, (b - 1) * a)
		i += 1
	print(ans[0], ans[1])


from math import sqrt
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
		continue
	for x in range(2, int(sqrt(n)) + 1):
		if n % x == 0:
			print(n // x, n - n // x)
			break
	else:
		print(1, n - 1)


import math

def divisor(n):
	mx = n
	ans = 1
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i < mx:
				mx = n // i
				ans = i
			if i < mx and i != 1:
				mx = i
				ans = n // i
	return ans
for lo in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
		continue
	x = divisor(n)
	print(x, n - x)


t = int(input())
from math import *

def primes(n):
	qq = []
	ix = n
	for ip in range(3, ceil(sqrt(n)) + 1, 2):
		if n % ip == 0:
			return n // ip
	if n != 1:
		return 1

def gcd(a, b):
	while b != 0:
		(a, b) = (b, a % b)
	return a

def fff(n):
	n = str(n)
	sums = 0
	for tl in n:
		sums += int(tl)
	return sums
from math import *
for xy in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		ll = primes(n)
		print(ll, n - ll)


def isprime(n):
	if n < 2:
		return False
	x = 2
	while x * x <= n:
		if n % x == 0:
			return False
		x += 1
	return True
t = int(input())
while t:
	t = t - 1
	n = int(input())
	if isprime(n):
		print(1, n - 1)
	elif n % 2 == 0:
		print(n // 2, n // 2)
	else:
		a = 0
		i = 3
		while i * i <= n:
			if n % i == 0:
				b = n // i
				a = max(a, b)
			i = i + 2
		print(a, n - a)


from math import sqrt

def sieve():
	lst = [True for _ in range(10 ** 5)]
	for i in range(2, int(sqrt(10 ** 5)) + 1):
		if lst[i] == True:
			for j in range(i ** 2, len(lst), i):
				lst[j] = False
	out = []
	for i in range(2, len(lst)):
		if lst[i]:
			out.append(i)
	return out
primes = sieve()

def solve(n):
	if n % 2 == 0:
		print('{} {}'.format(n // 2, n // 2))
	else:
		state = False
		for i in primes:
			if n % i == 0:
				state = True
				break
		if state == False:
			print('1 {}'.format(n - 1))
			return None
		m = n // i
		print('{} {}'.format(m, n - m))
	return None
test = int(input())
for _ in range(test):
	n = int(input())
	solve(n)


from math import sqrt

def read_int():
	n = int(input())
	return n

def read_ints():
	ints = [int(x) for x in input().split(' ')]
	return ints

def get_divisors(n):
	i = 1
	divisors = set()
	while i * i <= n:
		if n % i == 0:
			divisors.add(i)
			divisors.add(n // i)
		i += 1
	divisor_list = list(divisors)
	divisor_list.sort()
	divisor_list.pop()
	return divisor_list[::-1]

def solve(n):
	if n % 2 == 0:
		return [str(n // 2), str(n // 2)]
	divisors = get_divisors(n)
	for a in divisors:
		b = n - a
		if b % a == 0:
			return [str(a), str(b)]
	return [str(a), str(b)]
t = read_int()
for case in range(t):
	n = read_int()
	sol = solve(n)
	print(' '.join(sol))


from math import sqrt

def max_div(num):
	if num % 2 == 0:
		return num // 2
	for n in range(3, int(sqrt(num)) + 1, 2):
		if num % n == 0:
			return num // n
	return num - 1
quant_testes = int(input())
for c in range(quant_testes):
	num = int(input())
	maior = max_div(num)
	n1 = maior
	n2 = num - maior
	if n1 > n2:
		(n1, n2) = (n2, n1)
	print(n1, n2)


from math import sqrt
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		k = y = 0
		for j in range(3, int(sqrt(n)) + 1):
			if n % j == 0:
				k = k + 1
				y = j
				break
		if k == 0:
			print(1, n - 1)
		else:
			print(n // y, n - n // y)


import math

def nod(a, b):
	(a, b) = (max(a, b), min(a, b))
	while b > 0:
		(a, b) = (b, a % b)
	return a

def nok(a, b):
	n = nod(a, b)
	return a * b // n
t = int(input())
while t:
	n = int(input())
	(a1, a2) = (10 ** 9 + 1, 10 ** 9 + 1)
	for i in range(2, int(math.sqrt(n)) + 2):
		(tmp1, tmp2) = (0, 0)
		if n % i == 0:
			tmp1 = n // i
			tmp2 = n - tmp1
			if nok(tmp1, tmp2) < nok(a1, a2):
				(a1, a2) = (tmp1, tmp2)
	if nok(1, n - 1) < nok(a1, a2):
		(a1, a2) = (1, n - 1)
	print(a1, a2)
	t -= 1


from math import gcd

def lcm(x, y):
	return x * y // gcd(x, y)

def make_divisors(n):
	divisors = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			divisors.append(i)
			if i != n // i:
				divisors.append(n // i)
	return divisors
(t, *n) = map(int, open(0).read().split())
for x in n:
	d = make_divisors(x)
	ans = (1, x - 1)
	checker = x - 1
	for y in d:
		if y == 1 or y == x:
			continue
		else:
			temp = (y, x - y)
			if lcm(temp[0], temp[1]) < checker:
				ans = temp
				checker = lcm(temp[0], temp[1])
	print(*ans)


import math
from decimal import Decimal
import heapq
import copy
import heapq
from collections import deque

def na():
	n = int(input())
	b = [int(x) for x in input().split()]
	return (n, b)

def nab():
	n = int(input())
	b = [int(x) for x in input().split()]
	c = [int(x) for x in input().split()]
	return (n, b, c)

def dv():
	(n, m) = map(int, input().split())
	return (n, m)

def da():
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	return (n, m, a)

def dva():
	(n, m) = map(int, input().split())
	a = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	return (n, m, b)

def eratosthenes(n):
	sieve = list(range(n + 1))
	for i in sieve:
		if i > 1:
			for j in range(i + i, len(sieve), i):
				sieve[j] = 0
	return sorted(set(sieve))

def lol(lst, k):
	k = k % len(lst)
	ret = [0] * len(lst)
	for i in range(len(lst)):
		if i + k < len(lst) and i + k >= 0:
			ret[i] = lst[i + k]
		if i + k >= len(lst):
			ret[i] = lst[i + k - len(lst)]
		if i + k < 0:
			ret[i] = lst[i + k + len(lst)]
	return ret

def nm():
	n = int(input())
	b = [int(x) for x in input().split()]
	m = int(input())
	c = [int(x) for x in input().split()]
	return (n, b, m, c)

def dvs():
	n = int(input())
	m = int(input())
	return (n, m)

def fact(n):
	tc = []
	ans = {}
	d = 2
	while d * d <= n:
		if n % d == 0:
			tc.append(d)
			n //= d
		else:
			d += 1
	if n > 1:
		tc.append(n)
	for i in tc:
		ans[i] = ans.get(i, 0) + 1
	return ans

def how_many(l, r, c):
	m = (l + r) // 2
	if r - l == 1:
		if s[l] == c:
			return 0
		else:
			return 1
	d = s[l:m]
	k1 = (r - l) // 2 - s[l:m].count(c) + how_many(m, r, chr(ord(c) + 1))
	k2 = (r - l) // 2 - s[m:r].count(c) + how_many(l, m, chr(ord(c) + 1))
	return min(k1, k2)
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		d = int(math.sqrt(n))
		k = -1
		for i in range(2, d + 1):
			if n % i == 0:
				k = i
				break
		if k != -1:
			print(n // k, n - n // k)
		else:
			print(1, n - 1)


t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
		continue
	flag = False
	i = 3
	while i * i <= n:
		if n % i == 0:
			print(n // i, n - n // i)
			flag = True
			break
		i += 1
	if not flag:
		print(1, n - 1)


import sys
import math

def getGcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def solve():
	t = int(input())
	for test in range(0, t):
		n = int(input())
		(ans_a, ans_b) = (1, n - 1)
		minn = n * n
		for a in range(1, 2 + int(math.sqrt(n))):
			if n % a == 0 and n != a:
				gcd = getGcd(n - a, a)
				lcm = int((n - a) * a / gcd)
				if minn > lcm:
					minn = lcm
					(ans_a, ans_b) = (a, n - a)
			tmp = int(n / a)
			if n != tmp:
				gcd = getGcd(n - tmp, tmp)
				lcm = int((n - tmp) * tmp / gcd)
				if minn > lcm:
					minn = lcm
					(ans_a, ans_b) = (tmp, n - tmp)
		print(ans_a, ans_b)

def main():
	solve()
main()


import math
T = int(input())
for _ in range(T):
	n = int(input())
	i = 2
	a = 1
	b = n - 1
	while i * i <= n:
		if n % i == 0:
			k = n // i
			a = max(a, k)
			b = min(n - a, b)
		i += 1
	print(a, b)


import math
for i in range(int(input())):
	n = int(input())
	m = n * n
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		for i in range(1, math.floor(math.sqrt(n)) + 1):
			if n % i == 0:
				c = i
				k = c * (n - c) // math.gcd(c, n - c)
				if m > k:
					a = c
					b = n - c
					m = k
				if n % (n // i) == 0 and i != 1:
					c = n // i
					k = c * (n - c) // math.gcd(c, n - c)
					if m > k:
						a = c
						b = n - c
						m = k
		print(a, b)


import math

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

def brute(n):
	minLcm = float('inf')
	result = (1, n - 1)
	for i in range(1, n):
		a = i
		b = n - i
		currLcm = lcm(a, b)
		if currLcm < minLcm:
			minLcm = currLcm
			result = (a, b)
	return (result, minLcm)

def divisors(n):
	divs = [1]
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			divs.extend([i, n // i])
	divs.extend([n])
	return sorted(set(divs))

def fast(n):
	divs = divisors(n)
	if len(divs) == 2:
		return (1, n - 1)
	else:
		firstDiv = divs[1]
		return (n // firstDiv, (firstDiv - 1) * (n // firstDiv))

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		result = fast(n)
		print(' '.join((str(x) for x in result)))

def findPattern():
	N = 10000
	for n in range(2, 10000):
		result = brute(n)[0]
		print(n, result)

def randomTest():
	N = 10000
	for n in range(2, 10000):
		print(n)
		b = brute(n)[0]
		f = fast(n)
		if b != f:
			print('Broken!')
			print(b, f)
			return
main()


import sys

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

def input_split():
	return [int(i) for i in input().split()]
testCases = int(input())
answers = []

def smallest_div(m):
	for i in range(3, int(m ** 0.5) + 1):
		if m % i == 0:
			return (i, False)
	return (m, True)
for _ in range(testCases):
	n = int(input())
	if n % 2 == 0:
		a = n // 2
		b = n // 2
	else:
		(temp, isPrime) = smallest_div(n)
		if isPrime:
			a = n - 1
			b = 1
		else:
			a = n // temp
			b = n - a
	ans = '{} {}'.format(a, b)
	answers.append(ans)
print(*answers, sep='\n')


def lmc(n):
	if n % 2 == 0:
		return [int(n / 2), int(n / 2)]
	ans = -1
	j = 2
	while j * j <= n:
		if n % j == 0:
			ans = max(ans, j)
			ans = max(ans, n / j)
		j += 1
	if ans == -1:
		ans = 1
	return [int(ans), int(n - ans)]
t = int(input())
for _ in range(t):
	n = int(input())
	print(*lmc(n))


from __future__ import division, print_function
import sys
import os
from collections import Counter, deque, defaultdict
import itertools
import math
import io
if sys.version_info[0] < 3:
	input = raw_input
	range = xrange
	filter = itertools.ifilter
	map = itertools.imap
	zip = itertools.izip
MOD = 998244353
mod = 10 ** 9 + 7

def prepare_factorial(mod=mod):
	fact = [1]
	for i in range(1, 200005):
		fact.append(fact[-1] * i % mod)
	ifact = [0] * 200005
	ifact[200004] = pow(fact[200004], mod - 2, mod)
	for i in range(200004, 0, -1):
		ifact[i - 1] = i * ifact[i] % mod
	return (fact, ifact)

def modinv(n, p):
	return pow(n, p - 2, p)

def ncr(n, r, fact, ifact):
	t = fact[n] * (ifact[r] * ifact[n - r]) % MOD % MOD
	return t

def get_n(Sum):
	ans = (-1 + sqrt(1 + 8 * Sum)) // 2
	return ans

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	divisors = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return divisors

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def lrfind(d, x, default=-1):
	left = right = -1
	for i in range(len(d)):
		if d[i] == x:
			if left == -1:
				left = i
			right = i
	if left == -1:
		return (default, default)
	else:
		return (left, right)

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def check_sorted(a):
	for i in range(len(a) - 1):
		if a[i] > a[i + 1]:
			return False
	return True

def ceil(n, k=1):
	return n // k + (n % k != 0)

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

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

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

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

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

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

def prr(a, sep=' ', end='\n'):
	print(sep.join(map(str, a)), end=end)

def dd():
	return defaultdict(int)

def ddl():
	return defaultdict(list)

def write(s):
	return sys.stdout.write(s)

def factl(n):
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		if n % i == 0:
			return i
	return 1

def main():
	t = ii()
	for _ in range(t):
		n = ii()
		if n % 2 == 0:
			print(n // 2, n // 2)
		else:
			ans = factl(n)
			ma = max(n // ans, ans)
			mi = min(n // ans, ans)
			if mi == 1:
				print(1, n - 1)
			else:
				print(ma, ma * (mi - 1))
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			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')
main()


def solve(no):
	if no % 2 == 0:
		print(str(no // 2) + ' ' + str(no // 2))
	else:
		for i in range(2, int(no ** (1 / 2)) + 1):
			if no % i == 0:
				print(str(no // i) + ' ' + str(no - no // i))
				return
		print('1 ' + str(no - 1))
te = int(input())
for i in range(te):
	no = int(input())
	solve(no)


import sys
from functools import reduce
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		for i in range(3, int(n ** 0.5) + 1, 2):
			if n % i == 0:
				x = n // i
				print(x, n - x)
				break
		else:
			print(1, n - 1)


import math

def solve(n):
	p = 1
	for i in range(2, int(math.ceil(math.sqrt(n))) + 1):
		if n % i == 0:
			p = i
			break
	if p != 1:
		k = n // p
	else:
		k = 1
	return ' '.join([str(k), str(n - k)])

def read():
	t = int(input())
	for i in range(t):
		n = int(input())
		ans = solve(n)
		print(ans)
read()


for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		m = 0
		m1 = 0
		a = int(n ** 0.5 // 1)
		for i in range(a, 1, -1):
			if n % i == 0:
				m = n // i
				m1 = n - m
		if m > 0:
			print(m, m1)
		else:
			print(1, n - 1)


import io, os
from collections import deque
RL = lambda : list(map(int, input().split(' ')))

def smallestDivisor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n
T = int(input())
for _ in range(T):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		small = smallestDivisor(n)
		a = n // small
		b = n - a
		print(a, b)


t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		a = n // 2
		b = a
	else:
		a = 1
		b = n - a
		min_k = a
		while min_k <= n ** (1 / 2):
			min_k += 1
			if n % min_k == 0:
				a = n // min_k
				b = n - a
				break
	print(a, b)


import math
for i in range(int(input())):
	n = int(input())
	d = True
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			print(n // i, n - n // i)
			d = False
			break
	if d:
		print(n - 1, 1)


from functools import reduce
import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def arr():
	return [int(i) for i in input().split()]

def sarr():
	return [int(i) for i in input()]

def inn():
	return int(input())
mo = 1000000007

def isprime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))
for _ in range(inn()):
	n = inn()
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif isprime(n):
		print(1, n - 1)
	else:
		fac = factors(n)
		fac.sort()
		mn = min(fac[-2], n - fac[-2])
		mx = max(fac[-2], n - fac[-2])
		print(mn, mx)


import math
t = int(input())

def prime(n):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return 0
	return 1
while t:
	t -= 1
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2, sep=' ')
	elif prime(n):
		print(1, n - 1, sep=' ')
	else:
		for i in range(2, int(math.sqrt(n)) + 1):
			if n % i == 0:
				if prime(i):
					print(n // i, n - n // i, sep=' ')
					break


MOD = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
from collections import *
import math
for _ in range(ii()):
	n = ii()
	c = 0
	p = 0
	dn = 0
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		for i in range(2, int(math.sqrt(n)) + 1):
			if n % i == 0 and dn == 0:
				ans = n // i
				c = c + 1
				dn = dn + 1
		if c == 0 or n == 2:
			print(n - 1, 1)
			p = p + 1
		elif int(math.sqrt(n)) != math.sqrt(n) and p == 0:
			print(ans, n - ans)
			p = p + 1
		elif c < 2 and p == 0:
			print(int(math.sqrt(n)), int(n - math.sqrt(n)))
			p = p + 1
		elif p == 0:
			for i in range(0, n // 3 + 1):
				if 3 * i == n:
					print(i, 2 * i)
					p = p + 1
					break


for _ in range(int(input())):
	n = int(input())
	p = 0
	for i in range(2, 10 ** 6 + 1):
		if n % i == 0:
			p = i
			break
	if p == 0:
		p = n
	print(n // p, n - n // p)


import math
t = int(input())
for lim in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2, end='\n')
	else:
		i = 1
		j = n - i
		for x in range(3, math.ceil(math.sqrt(n) + 1), 2):
			if n % x == 0:
				(i, j) = (n // x, n - n // x)
				break
		print(i, j, end='\n')


t = int(input())
import math

def getDivisors(n):
	i = 1
	ans = []
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				ans.append(i)
			else:
				ans.append(i)
				ans.append(n // i)
		i = i + 1
	return ans

def isPrime(n):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True
while t > 0:
	n = int(input())
	if isPrime(n):
		print(1, n - 1)
	elif n % 2 == 0:
		print(n // 2, n // 2)
	else:
		temp = getDivisors(n)
		temp.sort()
		print(temp[-2], n - temp[-2])
	t -= 1


from sys import stdin, stdout
import math

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

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

def li():
	return list(mi())

def si():
	return stdin.readline()

def fac(n):
	j = 2
	l1 = []
	while j <= math.sqrt(n):
		if n % j == 0:
			if n // j == j:
				l1.append(j)
			else:
				l1.extend([j, n // j])
		j += 1
	l1.append(1)
	return l1
for _ in range(ii()):
	n = ii()
	l1 = max(fac(n))
	print(l1, n - l1)


import math

def solve():
	n = int(input())
	a = 2
	i = 2
	found = False
	while i * i <= n:
		if n % i == 0:
			found = True
			a = i
			break
		i += 1
	if not found:
		a = 1
		b = n - 1
	else:
		a = n // a
		b = n - a
	print(a, b)
t = int(input())
for _ in range(t):
	solve()


for _ in range(int(input())):
	n = int(input())
	flag = 0
	for j in range(2, int(n ** 0.5) + 1):
		if n % j == 0:
			flag = 1
			break
	if flag == 1:
		print(n // j, n - n // j)
	else:
		print(n - 1, 1)


import sys
input = sys.stdin.readline

def primes(n):
	ass = []
	is_prime = [True] * (n + 1)
	is_prime[0] = False
	is_prime[1] = False
	for i in range(2, int(n ** 0.5) + 1):
		if not is_prime[i]:
			continue
		for j in range(i * 2, n + 1, i):
			is_prime[j] = False
	is_prime[2] = False
	for i in range(len(is_prime)):
		if is_prime[i]:
			ass.append(i)
	return ass
p = primes(10 ** 5)
T = int(input())
for testcase in range(T):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		judge = True
		for e in p:
			if n % e == 0:
				print(n // e, n - n // e)
				judge = False
				break
		if judge:
			print(1, n - 1)


from math import gcd

def div(n):
	arr = []
	mi = 10000000000
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			arr.append(i)
			arr.append(n // i)
	a = 1
	b = 1
	for i in arr:
		if i != n:
			a = i
			b = n - i
			lcm = a * b // gcd(a, b)
			if lcm < mi:
				mi = lcm
				x = a
				y = b
	return (x, y)
for _ in range(int(input())):
	n = int(input())
	(x, y) = div(n)
	print(x, y)


from collections import deque
from collections import OrderedDict
import math
import sys
import os
import threading
import bisect
import operator
import heapq
from atexit import register
from io import BytesIO
import io
input = lambda : sys.stdin.readline().rstrip('\r\n')
for t in range(int(input())):
	n = int(input())
	sqr = int(math.sqrt(n))
	answer = 0
	for i in range(2, sqr + 1):
		if n % i == 0:
			answer = i
			break
	if answer != 0:
		print(n // answer, n // answer * (answer - 1))
	else:
		print(1, n - 1)


def div(n):
	r = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			r.append(i)
			if i * i != n:
				r.append(n // i)
	r.sort()
	return r

def fuu(a, g, n):
	return a * (n - a) // g

def min_f(n, g):
	a1 = g
	a2 = n - g
	if fuu(a1, g, n) <= fuu(a2, g, n):
		return (fuu(a1, g, n), a1)
	else:
		return (fuu(a2, g, n), a2)
tests = int(input())
for test in range(tests):
	n = int(input())
	(m, mi) = (fuu(1, 1, n), 1)
	d = div(n)
	for v in d:
		if v == n:
			break
		(f, fi) = min_f(n, v)
		if f < m:
			(m, mi) = (f, fi)
	print(mi, n - mi)


for i in range(int(input())):
	a = int(input())
	for j in range(2, 31628):
		if a % j == 0:
			print(a // j, a - a // j)
			break
	else:
		print(a - 1, 1)


from math import sqrt, ceil
for _ in range(int(input())):
	n = int(input())
	mn = 1000000000000
	a = 1
	b = n - 1
	for i in range(2, ceil(sqrt(n)) + 1):
		if n % i == 0:
			a = n // i
			b = n - a
			break
	print(a, b)


import sys
import os
readline = sys.stdin.readline

def gcd(a, b):
	while a != 0 and b != 0:
		if a < b:
			(a, b) = (b, a)
		a = a % b
	return a + b

def NOK(a, b):
	return a * b / gcd(a, b)
t = int(input())
while t:
	n = int(input())
	t -= 1
	if n % 2 == 0:
		print(n // 2, n // 2)
		continue
	j = 1
	res1 = 1
	res2 = n - 1
	nok = n - 1
	while j * j <= n:
		a = j
		b = n - j
		if NOK(a, b) < nok:
			res1 = a
			res2 = b
			nok = NOK(a, b)
		j += 1
		if n % j != 0:
			continue
		a = n // j
		b = n - a
		if NOK(a, b) < nok:
			res1 = a
			res2 = b
			nok = NOK(a, b)
	print(res1, res2)


import sys
import random
from fractions import Fraction
from math import *

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

def iinput():
	return int(input())

def finput():
	return float(input())

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

def linput():
	return list(input())

def rinput():
	return map(int, tinput())

def fiinput():
	return map(float, tinput())

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

def trinput():
	return tuple(rinput())

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

def NOYES(fl):
	if fl:
		print('NO')
	else:
		print('YES')

def YESNO(fl):
	if fl:
		print('YES')
	else:
		print('NO')

def main():
	n = iinput()
	for i in range(2, int(n ** 0.5) + 2):
		if n % i == 0:
			print(n // i, n - n // i)
			return 0
	print(1, n - 1)
for i in range(iinput()):
	main()


import math
for i in range(int(input())):
	n = int(input())
	p = 0
	for k in range(1, int(math.sqrt(n)) + 1):
		if n % (k + 1) == 0:
			print(n // (k + 1), k * (n // (k + 1)))
			p = 1
			break
	if p == 0:
		print(1, n - 1)


import math
t = int(input())
for i in range(t):
	flag = 0
	x = int(input())
	if x % 2 == 0:
		print(x // 2, x // 2)
	else:
		for i in range(3, int(math.sqrt(x) + 1)):
			if x % i == 0:
				flag = 1
				break
		if flag == 0:
			print(1, x - 1)
		else:
			print(x // i, x - x // i)


import math
t = int(input())
solucio = []
for k in range(t):
	n = int(input())
	if n % 2 == 0:
		a = n / 2
	else:
		trobat = False
		ll = 3
		arrel = math.sqrt(n)
		while ll < arrel + 1 and trobat is False:
			if n % ll == 0:
				trobat = True
				a = n / ll
			else:
				ll += 1
		if trobat is False:
			a = 1
	solucio.append(str(int(a)) + ' ' + str(int(n - a)))
for i in range(t):
	print(solucio[i])


import math

def multiple_inputs(func=lambda x: x, sep=' ') -> map:
	return map(func, input().split(sep) if sep else list(input()))

def multiple_multiple_inputs(n: int, func=lambda x: x, sep=' '):
	return [multiple_inputs(func, sep) for _ in range(n)]

def smallest_prime(candidate: int) -> int:
	if type(candidate) is not int:
		raise TypeError(f"expected 'int' for attribute 'candidate', got '{type(candidate).__name__}' instead")
	elif candidate < 1:
		raise ValueError('candidate should be greater than or equal to 1')
	return next((n for n in range(2, int(math.sqrt(candidate)) + 1) if candidate % n == 0), candidate)

def main():
	for _ in range(int(input())):
		n = int(input())
		p = smallest_prime(n)
		print(f'{n // p} {n // p * (p - 1)}')
main()


import math
test = int(input())

def solve():
	n = int(input())
	sq = int(math.sqrt(n))
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		for x in range(1, sq + 1):
			p = 2 * x + 1
			if n % p == 0:
				print(n // p, n - n // p)
				break
			if x == sq:
				print(1, n - 1)
				break
for x in range(test):
	solve()


T = int(input())
while T != 0:
	T -= 1
	n = int(input())
	a = 1
	b = n - 1
	num = 2
	while num * num <= n:
		if n % num == 0:
			ta = n // num
			tb = n - ta
			if tb < b:
				(a, b) = (ta, tb)
		num += 1
	print(a, b)


import math

def divisors(n):
	for i in range(2, math.ceil(math.sqrt(n)) + 1):
		if n % i == 0:
			return i
	return 1
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		yep = divisors(n)
		if yep == 1:
			print(1, n - 1)
		else:
			print(n // yep, n - n // yep)


from collections import Counter
import math
tests = int(input())
for _ in range(tests):
	(n,) = map(int, input().strip().split())
	fmax = 1
	for f in range(int(math.sqrt(n)) + 1, 0, -1):
		f = max(f, n // f)
		if n % f == 0:
			f = max(f, n // f)
			if f != n:
				fmax = f if f > fmax else fmax
	print(fmax, n - fmax)


import math
for _ in range(int(input())):
	N = int(input())
	if N % 2 == 0:
		print(N // 2, N // 2)
	else:
		q = int(math.sqrt(N))
		temp = 0
		for i in range(2, q + 1):
			if N % i == 0:
				temp = 1
				gcd = N // i
				print(gcd, N - gcd)
				break
		if temp == 0:
			print(1, N - 1)


t = int(input())
for x in range(t):
	n = int(input())
	done = 0
	i = 2
	while i <= n ** (1 / 2):
		if n % i == 0:
			done = 1
			break
		i += 1
	if not done:
		print(1, n - 1)
	else:
		print(n // i, n - n // i)


def check(n):
	f = 1
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			f = 0
			break
	if f == 1:
		return 1
	else:
		return 0

def find(n):
	for i in range(3, n + 1):
		if n % i == 0:
			return n // i
t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	elif check(n):
		print(1, n - 1)
	else:
		k = find(n)
		print(k, n - k)


import math

def printDivisors(n):
	i = 1
	l = []
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
		i = i + 1
	l.sort()
	l.remove(1)
	l.remove(n)
	return l
t = int(input())
for _ in range(t):
	n = int(input())
	l = printDivisors(n)
	if n % 2 == 0:
		print(n // 2, end=' ')
		print(n // 2)
	elif len(l) == 0:
		print(1, end=' ')
		print(n - 1)
	else:
		print(l[-1], end=' ')
		print(n - l[-1])


def sol():
	n = int(input())
	if n % 2 == 0:
		return (n / 2, n - n / 2)
	d = 3
	while d * d <= n and n % d != 0:
		d += 2
	if d * d > n:
		return (1, n - 1)
	a = n / d
	b = n - a
	return (a, b)
for i in range(int(input())):
	(a, b) = sol()
	print(int(a), end=' ')
	print(int(b))


import math

def c(n):
	l = []
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			l += [i]
			l += [n // i]
	if l == []:
		l += [n]
	return l

def main():
	for _ in range(int(input())):
		n = int(input())
		k = c(n)
		k.sort()
		m = []
		for i in k:
			m += [(n // i * (i - 1), n // i)]
		m.sort()
		print(m[0][0], m[0][1])
main()


from collections import deque
import os
import sys
from io import BytesIO, IOBase
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.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 bisect import bisect_left as bl
from math import log2, ceil
from heapq import heappush, heappop
from itertools import permutations

def main():
	for t in range(int(input())):
		n = int(input())
		m = int(n ** 0.5) + 1
		ans = n - 1
		fans = (n - 1, 1)
		if n % 2 == 0:
			print(n // 2, n // 2)
		else:
			for i in range(m, 0, -1):
				if n % i == 0:
					a = max(i, n - i)
					b = max(n // i, n - n // i)
					if a > b:
						if b < ans:
							fans = (n // i, n - n // i)
					elif a < ans:
						fans = (i, n - i)
			print(fans[0], fans[1])
main()


def prime(x):
	if x % 2 == 0:
		return False
	for k in range(3, x, 2):
		if x % k == 0 and x != k:
			return False
			break
		if k ** 2 > x:
			return True
for i in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		a = n // 2
		print(a, a)
	elif n == 3:
		print(1, 2)
	elif prime(n):
		print(1, n - 1)
	else:
		for i in range(3, n, 2):
			if n % i == 0:
				b = n // i
				a = n - b
				if a > b:
					print(b, a)
				else:
					print(a, b)
				break


import math

def divisors(n):
	i = 1
	a = []
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				a.append(i)
			else:
				a.append(i)
				a.append(n // i)
		i = i + 1
	return a
for _ in range(int(input())):
	n = int(input())
	a = divisors(n)
	a.sort()
	del a[-1]
	p = 0
	q = 0
	m = float('inf')
	for i in a:
		x = i
		y = n - i
		lcm = x * y // math.gcd(x, y)
		if lcm < m:
			m = lcm
			p = x
			q = y
	print(p, q)


def maths(n):
	if n % 2 == 0:
		print(n // 2, n // 2)
		return
	else:
		for i in range(2, int(n ** (1 / 2)) + 1):
			if n % i == 0:
				print(n // i, n - n // i)
				return
		print(1, n - 1)
		return
t = int(input())
a = []
for j in range(t):
	a.append(int(input()))
for x in a:
	maths(x)


for nt in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		ans = 1
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				ans = max(ans, i, n // i)
		print(ans, n - ans)


import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
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.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')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]

def fun(n):
	ans = []
	for i in range(1, int(sqrt(n)) + 1):
		if (n - i) % i == 0:
			ans.append((i, n - i))
		k = n // i
		if k != i and k != n:
			if (n - k) % k == 0:
				ans.append((k, n - k))
	return ans
for _ in range(Int()):
	n = Int()
	ans = fun(n)
	a = 1
	Lcm = n
	for (x, y) in ans:
		lcm = x * y // gcd(x, y)
		if lcm < Lcm:
			Lcm = lcm
			a = x
	print(a, n - a)


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
import sys
import random
from queue import PriorityQueue
from collections import Counter as cc
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
from itertools import permutations
from math import factorial as f

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p
import sys

def solve(n):
	seti = set()
	for i in range(1, int(sqrt(n)) + 1):
		if n % i == 0:
			seti.add(n // i)
			seti.add(i)
	return seti
t = int(input())
for _ in range(t):
	n = int(input())
	z = solve(n)
	mini = inf
	(a, b) = (-1, -1)
	for i in z:
		z1 = n - i
		z2 = i
		if z1 > 0 and z2 > 0:
			mini = min(z1 * z2 // gcd(z1, z2), mini)
			if mini == z1 * z2 // gcd(z1, z2):
				(a, b) = (z1, z2)
	print(a, b)


def testcase():
	n = int(input())
	for i in range(2, int(n ** 0.5 + 1)):
		if n % i == 0:
			x = n // i
			print(x, n - x)
			return
	print(1, n - 1)
t = int(input())
for _ in range(t):
	testcase()


for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		f = 0
		l = []
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				f = 1
				l.append(i)
				l.append(n // i)
		if f == 0:
			print(1, n - 1)
		else:
			print(max(l), n - max(l))


def solve(n):
	p = 0
	for m in range(2, 100000):
		if n % m == 0:
			p = m
			break
	if p == 0:
		p = n
	return [n // p, n - n // p]
t = int(input())
while t:
	n = int(input())
	print(*solve(n))
	t -= 1


t = int(input())
c = []
import math
for i in range(t):
	n = int(input())
	u = n
	p = []
	while n % 2 == 0:
		p.append(2)
		n = n // 2
		if p:
			break
	if not p:
		for i in range(3, int(math.sqrt(n)) + 1, 2):
			while n % i == 0:
				p.append(i)
				n = n / i
				if p:
					break
			if p:
				break
	if not p:
		if n > 2:
			p.append(n)
	if not p:
		c.append(str(1) + ' ' + str(u - 1))
	else:
		c.append(str(u // p[0]) + ' ' + str(u - u // p[0]))
for k in c:
	print(k)


for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(f'{n // 2} {n // 2}')
	else:
		k = int(n ** 0.5)
		print_1 = True
		for i in range(2, k + 1):
			if n % i == 0:
				print(f'{n // i} {n - n // i}')
				print_1 = False
				break
		if print_1:
			print(f'{1} {n - 1}')


import math
T = int(input())
for _ in range(0, T):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		temp = 1
		for i in range(2, int(math.sqrt(n)) + 1):
			if n % i == 0:
				temp = max(n // i, temp)
		print(temp, n - temp)


import math
t = int(input())
for case in range(t):
	n = int(input())
	a = 0
	b = 0
	prime = True
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			a = n // i
			b = n - a
			prime = False
			break
	if prime == True:
		a = 1
		b = n - 1
	print(str(a) + ' ' + str(b))


for h in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
		continue
	for i in range(3, int(n ** 0.5) + 1):
		if n % i == 0:
			print(n // i, n - n // i)
			break
	else:
		print(1, n - 1)


import math

def prime(n):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return i
	return n
for _ in range(int(input())):
	a = int(input())
	b = prime(a)
	if b == a:
		print(1, a - 1)
	else:
		print(a // b, a - a // b)


def primer(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			print(n // i, n // i * (i - 1))
			return 0
	print(n - 1, 1)
for test in range(int(input())):
	n = int(input())
	primer(n)


import sys
input = sys.stdin.readline

def print(val):
	sys.stdout.write(val + '\n')

def prog():
	for _ in range(int(input())):
		n = int(input())
		if n % 2 == 0:
			print(str(n // 2) + ' ' + str(n // 2))
		else:
			found = False
			for i in range(3, int(n ** 0.5) + 1, 2):
				if n % i == 0:
					print(str(n // i) + ' ' + str(n * (i - 1) // i))
					found = True
					break
			if not found:
				print('1' + ' ' + str(n - 1))
prog()


def make_divisors(n):
	divisors = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			divisors.append(i)
			if i != n // i:
				divisors.append(n // i)
	divisors.sort(reverse=True)
	return divisors
for _ in range(int(input())):
	n = int(input())
	m = make_divisors(n)[1]
	print(m * 1, m * (n // m - 1))


import sys
import math
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	p = 0
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			p = i
			break
	if p == 0:
		p = n
	print(n // p, n - n // p)


for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
		continue
	i = 2
	k = 1
	while i * i <= n:
		if n % i == 0:
			k = i
			break
		i += 1
	if k == 1:
		print('1', n - 1)
	else:
		print(n // k, n - n // k)


import sys
from math import ceil, sqrt, sin, pi, tan
from collections import defaultdict
read = sys.stdin.buffer.readline
import heapq
mi = lambda : map(int, read().split())
li = lambda : list(mi())
cin = lambda : int(read())

def ispd(s):
	n = len(s)
	if s[:n // 2] == s[[n // 2 + 1, n // 2][n % 2 == 0]:][::-1]:
		return True
	return False
for _ in range(cin()):
	n = cin()
	ans = n - 1
	if n % 2 == 0:
		ans = n // 2
		print(ans, n - ans)
	else:
		i = 2
		while i * i <= n:
			if n % i == 0:
				if (n - i) % i == 0:
					ans = min(ans, max(i, n - i))
				a = n // i
				b = n - a
				(a, b) = (max(a, b), min(a, b))
				if n // i != i:
					if a % b == 0:
						ans = min(ans, a)
			i += 1
		print(ans, n - ans)


from functools import reduce

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		r = factors(n)
		s = []
		for i in range(len(r)):
			if r[i] < n:
				s.append(r[i])
		k = max(s)
		print(k, n - k)


t = int(input())
import math
for test in range(t):
	n = int(input())
	a = -1
	b = -1
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			a = n // i
			b = n - a
			break
	if a == -1 and b == -1:
		a = 1
		b = n - 1
	print(a, b)


import math
from collections import deque
import sys
sys.setrecursionlimit(10 ** 4)

def Divisors(n):
	l = []
	i = 2
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
		i = i + 1
	return l

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

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n / i
	if n > 2:
		l.append(n)
	return l

def Factors(n):
	result = []
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			if i == n / i:
				result.append(i)
			else:
				result.append(i)
				result.append(n // i)
	result.append(1)
	return result

def maxSubArraySum(a):
	max_so_far = 0
	max_ending_here = 0
	size = len(a)
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_so_far < abs(max_ending_here):
			max_so_far = max_ending_here
	return max_so_far

def longestsubarray(arr, n, k):
	current_count = 0
	max_count = 0
	for i in range(0, n, 1):
		if arr[i] % k != 0:
			current_count += 1
		else:
			current_count = 0
		max_count = max(current_count, max_count)
	return max_count

def main():
	n = int(input())
	if n % 2 == 0:
		print(n // 2, n // 2)
	else:
		l = Factors(n)
		m = max(l)
		r = n // m
		print(m, (r - 1) * m)
t = int(input())
for i in range(0, t):
	main()


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

def print_list(l):
	print(' '.join(map(str, l)))
output = [1] * 35000

def countPrimes(n):
	(output[0], output[1]) = (0, 0)
	for i in range(2, int(n ** 0.5) + 1):
		if output[i] == 1:
			output[i * i:n:i] = [0] * len(output[i * i:n:i])
countPrimes(35000)
s = [i for i in range(35000) if output[i] == 1]
N = int(input())
for _ in range(N):
	n = int(input())
	flag = True
	for k in s:
		if n % k == 0:
			tmp = n // k
			print('%d %d' % (tmp, n - tmp))
			flag = False
			break
	if flag:
		print('%d %d' % (1, n - 1))


import math
for _ in range(int(input())):
	n = int(input())
	i = 2
	got = False
	t = int(math.sqrt(n)) + 1
	while i <= t:
		if n % i == 0:
			print(n // i, (i - 1) * (n // i))
			got = True
			break
		i += 1
	if not got:
		print(1, n - 1)


from sys import stdin

def inp():
	return stdin.buffer.readline().rstrip().decode('utf8')

def itg():
	return int(stdin.buffer.readline())

def mpint():
	return map(int, stdin.buffer.readline().split())
from collections import Counter

def is_prime(n):
	if n < 5 or n & 1 == 0 or n % 3 == 0:
		return 2 <= n <= 3
	s = (n - 1 & 1 - n).bit_length() - 1
	d = n >> s
	for a in [2, 325, 9375, 28178, 450775, 9780504, 1795265022]:
		p = pow(a, d, n)
		if p == 1 or p == n - 1 or a % n == 0:
			continue
		for _ in range(s):
			p = p * p % n
			if p == n - 1:
				break
		else:
			return False
	return True

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def memodict(f):

	class memodict(dict):

		def __missing__(self, key):
			ret = self[key] = f(key)
			return ret
	return memodict().__getitem__

def pollard_rho(n):
	if n & 1 == 0:
		return 2
	if n % 3 == 0:
		return 3
	s = (n - 1 & 1 - n).bit_length() - 1
	d = n >> s
	for a in [2, 325, 9375, 28178, 450775, 9780504, 1795265022]:
		p = pow(a, d, n)
		if p == 1 or p == n - 1 or a % n == 0:
			continue
		for _ in range(s):
			prev = p
			p = p * p % n
			if p == 1:
				return gcd(prev - 1, n)
			if p == n - 1:
				break
		else:
			for i in range(2, n):
				(x, y) = (i, (i * i + 1) % n)
				f = gcd(abs(x - y), n)
				while f == 1:
					(x, y) = ((x * x + 1) % n, (y * y + 1) % n)
					y = (y * y + 1) % n
					f = gcd(abs(x - y), n)
				if f != n:
					return f
	return n

@memodict
def prime_factors(n):
	if n <= 1:
		return Counter()
	f = pollard_rho(n)
	return Counter([n]) if f == n else prime_factors(f) + prime_factors(n // f)

def lcm(x, y):
	return x * y // gcd(x, y)

def brute_force(x):
	a = min(range(1, x // 2 + 1), key=lambda i: lcm(i, x - i))
	return (a, x - a)
DEBUG = 0
for case in range(itg()):
	n = itg()
	if n & 1 ^ 1:
		print(n >> 1, n >> 1)
	elif is_prime(n):
		print(1, n - 1)
	else:
		min_f = min(prime_factors(n))
		max_f = n // min_f
		a = 1 * max_f
		b = (min_f - 1) * max_f
		print(a, b)
		if DEBUG:
			assert (a, b) == brute_force(n)