Katya studies in a fifth grade. Recently her class studied right triangles and the Pythagorean theorem. It appeared, that there are triples of positive integers such that you can construct a right triangle with segments of lengths corresponding to triple. Such triples are called Pythagorean triples.

For example, triples (3, 4, 5), (5, 12, 13) and (6, 8, 10) are Pythagorean triples.

Here Katya wondered if she can specify the length of some side of right triangle and find any Pythagorean triple corresponding to such length? Note that the side which length is specified can be a cathetus as well as hypotenuse.

Katya had no problems with completing this task. Will you do the same?


-----Input-----

The only line of the input contains single integer n (1 ≤ n ≤ 10^9) — the length of some side of a right triangle.


-----Output-----

Print two integers m and k (1 ≤ m, k ≤ 10^18), such that n, m and k form a Pythagorean triple, in the only line.

In case if there is no any Pythagorean triple containing integer n, print  - 1 in the only line. If there are many answers, print any of them.


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

Output
4 5
Input
6

Output
8 10
Input
1

Output
-1
Input
17

Output
144 145
Input
67

Output
2244 2245


-----Note-----[Image]

Illustration for the first sample.

Source: codeforces | Difficulty: MEDIUM
Tags: Number theory

Mathematics


Solutions:
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, itertools, operator, bisect, fractions, statistics
from collections import deque, defaultdict, OrderedDict, Counter
from fractions import Fraction
from decimal import Decimal
from sys import stdout
from heapq import heappush, heappop, heapify, _heapify_max, _heappop_max, nsmallest, nlargest
sys.setrecursionlimit(111111)
INF = 99999999999999999999999999999999

def main():
	mod = 1000000007
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	tc = 1
	for _ in range(tc):
		x = ri()
		if x < 3:
			print(-1)
		elif x % 2:
			print((x * x - 1) // 2, (x * x + 1) // 2)
		else:
			print((x // 2) ** 2 - 1, (x // 2) ** 2 + 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 math, cmath
parse_int = lambda : list(map(int, input().split()))
n = int(input())
if n < 3:
	print(-1)
	exit()
if n % 4 == 0:
	n //= 4
	print(n * 3, n * 5)
	exit()
a = n
mno = 1
for i in range(2, min(n, round(math.sqrt(n)) + 3)):
	if n % i == 0:
		(a, mno) = (i, n // i)
		if a == 2:
			(a, mno) = (mno, a)
		break
b = a ** 2 // 2
c = b + 1
print(b * mno, c * mno)


def solve(n):
	if n == 1 or n == 2:
		print(-1)
	elif n & 1:
		tmp = n ** 2
		print(tmp // 2, tmp // 2 + 1)
	else:
		tmp = (n // 2) ** 2
		print(tmp - 1, tmp + 1)
n = int(input())
solve(n)


for _ in range(1):
	n = int(input())
	if n in [1, 2]:
		print(-1)
		exit(0)
	num = pow(n, 2)
	if num % 2 == 0:
		num = num // 2 // 2
		first_num = num - 1
		second_num = num + 1
	else:
		num = num // 2
		first_num = num
		second_num = num + 1
	if pow(second_num, 2) - pow(first_num, 2) == pow(n, 2):
		print(first_num, second_num)
	else:
		print(-1)


n = int(input())
if n <= 2:
	print(-1)
elif n % 2 == 0:
	x = n * n // 4
	print(x - 1, x + 1)
else:
	x = (n * n + 1) // 2
	print(x, x - 1)


x = int(input())
if x == 1 or x == 2:
	print(-1)
elif x % 2 == 0:
	m = x // 2
	n = 1
	a = m ** 2 - n ** 2
	b = 2 * m * n
	c = m ** 2 + n ** 2
	print('{} {}'.format(a, c))
else:
	m = (1 + x) // 2
	n = (-1 + x) // 2
	a = m ** 2 - n ** 2
	b = 2 * m * n
	c = m ** 2 + n ** 2
	print('{} {}'.format(b, c))


n = int(input())
if n <= 2:
	print(-1)
elif n % 2:
	print((1 + n ** 2) // 2 - 1, (1 + n ** 2) // 2)
else:
	print(n ** 2 // 4 - 1, n ** 2 // 4 + 1)


import sys
import string
import math
import heapq
from collections import defaultdict
from functools import lru_cache
from collections import Counter
from fractions import Fraction

def mi(s):
	return map(int, s.strip().split())

def lmi(s):
	return list(mi(s))

def tmi(s):
	return tuple(mi(s))

def mf(f, s):
	return map(f, s)

def lmf(f, s):
	return list(mf(f, s))

def js(lst):
	return ' '.join((str(d) for d in lst))

def jsns(lst):
	return ''.join((str(d) for d in lst))

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

def linesp():
	return line().split()

def iline():
	return int(line())

def mat(n):
	matr = []
	for _ in range(n):
		matr.append(linesp())
	return matr

def matns(n):
	mat = []
	for _ in range(n):
		mat.append([c for c in line()])
	return mat

def mati(n):
	mat = []
	for _ in range(n):
		mat.append(lmi(line()))
	return mat

def pmat(mat):
	for row in mat:
		print(js(row))

def main():
	n = iline()
	if n == 1 or n == 2:
		print(-1)
		return
	elif n % 2 != 0:
		x = (n ** 2 + 1) // 2
		print(x, x - 1)
	else:
		x = (n ** 2 + 4) // 4
		print(x, x - 2)
main()


from math import floor
value = int(input())
divider = []
dividers = []
for i in range(1, floor(value ** 0.5) + 1):
	if not value % i:
		divider.append(i)
		if value // i != i:
			divider.append(value // i)
value **= 2
for f in divider:
	for g in divider:
		dividers.append(f * g)
label = 0
for v in dividers:
	val = value // v
	l = val // 2 - 1
	r = val - 1
	while r - l > 1:
		m = (r + l) // 2
		if 2 * m * val - val ** 2 >= value:
			r = m
		else:
			l = m
	if (2 * r - val) * val == value:
		if val - r > 0 and r > 0 and (not label):
			print(val - r, r)
			label = 1
			break
if not label:
	print('-1')


def q0():
	s = set()
	s.add('W')
	s.add('G')
	s.add('B')
	(n, m) = list(map(lambda s: int(s), input().split(' ')))
	res = None
	flag = False
	for i in range(n):
		c = list(input().split())
		for elm in c:
			if elm not in s:
				res = '#Color'
				flag = True
	if not flag:
		res = '#Black&White'
	return res

def q1():

	def getmin(G, n, start, storage):
		min_dist = float('inf')
		for i in range(n):
			if i not in storage:
				min_dist = min(G[start][i], min_dist)
		return min_dist
	(n, m, k) = list(map(lambda s: int(s), input().split(' ')))
	G = [[float('inf') for i in range(n)] for j in range(n)]
	for i in range(m):
		(x, y, d) = list(map(lambda s: int(s), input().split(' ')))
		G[x - 1][y - 1] = min(G[x - 1][y - 1], d)
		G[y - 1][x - 1] = G[x - 1][y - 1]
	if k <= 0:
		return -1
	l = list(map(lambda s: int(s) - 1, input().split(' ')))
	storage_set = set(l)
	min_distance = float('inf')
	for i in storage_set:
		min_distance = min(min_distance, getmin(G, n, i, storage_set))
	if min_distance == float('inf'):
		min_distance = -1
	return min_distance

def q2():
	n = int(input())
	if n == 1 or n == 2:
		return -1
	if n % 2 == 1:
		k = n ** 2 // 2
		return (k, k + 1)
	else:
		x = n // 2
		y = 1
		a = x ** 2 - 1
		c = x ** 2 + 1
		return (a, c)

def q3():

	def invert(shelf):
		add = 0
		for i in range(len(shelf)):
			if shelf[i] == 1:
				add -= 1
			if shelf[i] == -1:
				add += 1
			shelf[i] = -shelf[i]
		return add

	def step_reverse(k, start, op_lst, case):
		for i in range(start, k):
			op = op_lst[i]
			if op[0] == 1:
				i = op[1]
				j = op[2]
				if case[i][j] == -1:
					case[i][j] = 1
			if op[0] == 2:
				i = op[1]
				j = op[2]
				if case[i][j] == 1:
					case[i][j] = -1
			if op[0] == 3:
				i = op[1]
				invert(case[i])
			if op[0] == 4:
				reverse(op[1], op_lst, case, case_map)
		return

	def reverse(k, op_lst, case, case_map):
		closest = None
		if k in case_map:
			cp_case = case_map[k]
			for i in range(len(cp_case)):
				for j in range(len(cp_case[0])):
					case[i][j] = cp_case[i][j]
					return
		else:
			closest = len(op_lst) * (k // 10)
			cp_case = case_map[closest]
			for i in range(len(cp_case)):
				for j in range(len(cp_case[0])):
					case[i][j] = cp_case[i][j]
		step_reverse(k, closest, op_lst, case)
		return

	def calcTotal(case):
		total = 0
		for lst in case:
			for i in lst:
				if i == 1:
					total += 1
		return total
	(n, m, q) = list(map(lambda s: int(s), input().split(' ')))
	op_lst = [[-1 for i in range(3)] for j in range(q)]
	case = [[-1 for i in range(m)] for j in range(n)]
	case_map = {}
	counter = 0
	total = 0
	for i in range(q):
		op_lst[i] = list(map(lambda s: int(s), input().split(' ')))
	for op in op_lst:
		if op[0] == 1:
			i = op[1] - 1
			j = op[2] - 1
			if case[i][j] == -1:
				case[i][j] = 1
				total += 1
		if op[0] == 2:
			i = op[1] - 1
			j = op[2] - 1
			if case[i][j] == 1:
				case[i][j] = -1
				total -= 1
		if op[0] == 3:
			i = op[1] - 1
			total += invert(case[i])
		if op[0] == 4:
			k = op[1]
			reverse(k, op_lst, case, case_map)
			total = calcTotal(case)
		print(case)
		print(total)
		print(case_map)
		if counter == q // 10:
			cp = [[-1 for j in range(m)] for i in range(n)]
			for i in range(n):
				for j in range(m):
					cp[i][j] = case[i][j]
			case_map[counter] = cp
			counter = 0
		counter += 1
s = ''
l = q2()
if l == -1:
	print(-1)
else:
	for j in l:
		s += str(j)
		s += ' '
	print(s[:len(s) - 1])


a = int(input())
a **= 2
i = 1
flag = 0
while i ** 2 <= a:
	if a % i == 0:
		x = a // i
		c = x + i
		b = x - i
		if b > 0 and c > 0 and (b % 2 == 0) and (c % 2 == 0):
			flag = 1
			break
	i += 1
if flag:
	print(b // 2, c // 2)
else:
	print(-1)


x = int(input())
if x <= 2:
	print(-1)
elif x % 2 == 1:
	p = (x * x + 1) // 2
	print(p, p - 1)
else:
	a = (x * x + 1) // 2
	m = (a + x * x // a) // 2
	n = (a - x * x // a) // 2
	print(m, n)


n = int(input())
if n < 3:
	print(-1)
elif n % 2:
	print((n ** 2 - 1) // 2, (n ** 2 + 1) // 2)
elif not n % 4:
	print(3 * n // 4, 5 * n // 4)
else:
	print((n ** 2 - 4) // 4, (n ** 2 + 4) // 4)


a = int(input())
if a < 3:
	print(-1)
else:
	if a % 2 == 0:
		b = a // 2 * (a // 2) - 1
		c = b + 2
	else:
		b = (a ** 2 - 1) // 2
		c = b + 1
	print(b, c)


x = int(input())
if x % 2 == 1:
	y = (x * x - 1) // 2
	z = (x * x + 1) // 2
else:
	y = (x // 2) ** 2 - 1
	z = y + 2
if y > 0 and z > 0:
	print(y, z)
else:
	print(-1)


n = int(input())
if n == 1 or n == 2:
	print(-1)
elif n % 2 == 1:
	print((n * n - 1) // 2, (n * n + 1) // 2)
else:
	print(n // 2 * n // 2 - 1, n // 2 * n // 2 + 1)


n = int(input())
if n == 1 or n == 2:
	print('-1')
	exit(0)
if n % 2 == 1:
	a = (n ** 2 - 1) // 2
	b = (n ** 2 + 1) // 2
else:
	a = n ** 2 // 4 + 1
	b = n ** 2 // 4 - 1
print(str(a) + ' ' + str(b))


import sys
import math
import operator as op
from functools import reduce

def read_line():
	return sys.stdin.readline()[:-1]

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

def read_int_line():
	return [int(v) for v in sys.stdin.readline().split()]

def read_float_line():
	return [float(v) for v in sys.stdin.readline().split()]

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
N = int(1000000.0) + 10
fenwick = [0] * N

def add(i, x, n):
	while i < n:
		fenwick[i] += x
		i = i | i + 1

def fsum(i, n):
	res = 0
	while i >= 0:
		res += fenwick[i]
		i = (i & i + 1) - 1
	return res

def fsum_range(i, j, n):
	return fsum(j, n) - fsum(i - 1, n)
t = 1
for i in range(t):
	n = read_int()
	if n <= 2:
		print(-1)
	elif n & 1 == 1:
		v1 = (n ** 2 - 1) // 2
		v2 = (n ** 2 - 1) // 2 + 1
		print(v1, v2)
	else:
		m = n // 2
		v1 = m ** 2 - 1
		v2 = m ** 2 + 1
		print(v1, v2)


n = int(input())
if n % 2 == 0:
	a = n ** 2 // 4 - 1
	b = a + 2
	if b >= a > 0:
		print(a, b)
	else:
		print(-1)
else:
	a = (n ** 2 - 1) // 2
	b = a + 1
	if b >= a > 0:
		print(a, b)
	else:
		print(-1)


a = int(input())
k = 1
if a == 1 or a == 2:
	print(-1)
else:
	if a % 2 != 0:
		b = a * a // 2
		c = b + 1
	else:
		k *= 2
		a //= 2
		if a % 2 != 0:
			b = k * (a ** 2 // 2)
			c = k * (a ** 2 // 2 + 1)
		else:
			b = 3 * (a // 2)
			c = 5 * (a // 2)
	print(b, c)


n = int(input())
if n == 1 or n == 2:
	print(-1)
	exit()
if n % 2 == 0:
	print(n * n // 4 - 1, n * n // 4 + 1)
else:
	print(n * n // 2, n * n // 2 + 1)


a = int(input())
print(-1 if a < 3 else str(a * a // 4 - 1) + '\n' + str(a * a // 4 + 1) if not a % 2 else str(a * a // 2) + '\n' + str(a * a // 2 + 1))


def mlt():
	return map(int, input().split())
x = int(input())
if x <= 2:
	print(-1)
	exit(0)
if x % 2:
	a = (x * x + 1) // 2
	print(a, a - 1)
else:
	a = (x * x + 4) // 4
	print(a, a - 2)


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
n = int(input())
a = 0
b = 0
for i in range(1, n):
	if n * n % i == 0:
		if (i + n * n // i) % 2 == 0 and abs(i - n * n // i) % 2 == 0:
			a = (i + n * n // i) // 2
			b = abs(i - n * n // i) // 2
			break
if a:
	print(min(a, b), max(a, b))
else:
	print(-1)


from math import *
n = int(input())
if n <= 2:
	print(-1)
elif n % 2 == 0:
	x = n * n // 4
	print(x - 1, x + 1)
else:
	x = (n * n + 1) // 2
	print(x, x - 1)


n = int(input())
if n < 3:
	print(-1)
elif n % 2:
	print((n * n - 1) // 2, (n * n + 1) // 2)
else:
	print(n // 2 * n // 2 - 1, n // 2 * n // 2 + 1)


def minDiv(x):
	if x % 2 == 0:
		return 2
	for i in range(3, int(x ** 0.5) + 1, 2):
		if x % i == 0:
			return i
	return x

def triangle(x, c):
	if c == 2:
		d = x // 4
		y = 3 * d
		z = 5 * d
		return (y, z)
	pos = (c - 3) // 2 + 1
	y = 2 * pos * (pos + 1)
	if y > 10 ** 18:
		y = 0
	y *= x // c
	z = y + x // c
	return (y, z)
n = int(input())
a = minDiv(n)
b = n
while b != a:
	b //= a
	a = minDiv(b)
if n <= 2:
	print(-1)
else:
	(m, k) = triangle(n, b)
	print(m, k)


a = int(input())
if a < 3:
	print(-1)
elif a & 1:
	print((a * a - 1) // 2, (a * a + 1) // 2)
else:
	print(a // 2 * (a // 2) - 1, a // 2 * (a // 2) + 1)


a = int(input())

def aa(a):
	if a == 1 or a == 2:
		print(-1)
		return 0
	t = 1
	while a % 2 == 0 and a != 4:
		t = t * 2
		a = a // 2
	if a == 4:
		print(t * 3, t * 5)
		return 0
	p = a * a // 2
	print(p * t, (p + 1) * t)
	return
aa(a)


n = int(input())
p2 = 0
while n % 2 == 0:
	p2 += 1
	n //= 2
if n > 1:
	k = n // 2
	A = 2 * k * k + 2 * k
	B = 2 ** p2
	print(A * B, (A + 1) * B)
elif p2 > 1:
	B = 2 ** (p2 - 2)
	print(3 * B, 5 * B)
else:
	print(-1)


n = int(input())
if n == 1 or n == 2:
	print('-1')
elif n % 2 == 0:
	print(n ** 2 // 4 - 1, n ** 2 // 4 + 1)
else:
	print((n ** 2 - 1) // 2, (n ** 2 + 1) // 2)


n = int(input())
if n < 3:
	print(-1)
	quit()
if n & 1 == 1:
	for i in sorted([n * n - 1 >> 1, n * n + 1 >> 1]):
		print(i, end=' ')
else:
	n >>= 1
	for i in sorted([n * n - 1, n * n + 1]):
		print(i, end=' ')


IL = lambda : list(map(int, input().split()))
IS = lambda : input().split()
I = lambda : int(input())
S = lambda : input()

def f(x):
	if x == 4:
		return [3, 5]
	if x % 2:
		return [x ** 2 // 2, x ** 2 // 2 + 1]
	r0 = f(x // 2)
	return [r0[0] * 2, r0[1] * 2]
n = I()
if n < 3:
	print(-1)
else:
	r = f(n)
	print(r[0], r[1])


import math, sys, bisect, heapq, os
from collections import defaultdict, Counter, deque
from itertools import groupby, accumulate
from functools import lru_cache
int1 = lambda x: int(x) - 1

def input():
	return sys.stdin.readline().rstrip('\r\n')
aj = lambda : list(map(int, input().split()))

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

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

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

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

def solve():
	(n,) = aj()
	if n <= 2:
		print(-1)
	elif n % 2:
		k = (n ** 2 + 1) // 2
		m = (n ** 2 - 1) // 2
		print(k, m)
	else:
		k = (n ** 2 + 4) // 4
		m = (n ** 2 - 4) // 4
		print(k, m)
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
solve()


a = int(input())
if a <= 2:
	print(-1)
elif a % 2:
	print(a * a // 2, a * a // 2 + 1)
else:
	print(a * a // 4 - 1, a * a // 4 + 1)


n = int(input())
if n < 3:
	print(-1)
elif n % 4 == 0:
	print(n // 4 * 3, n // 4 * 5)
else:
	k = 2 if n & 1 == 0 else 1
	n //= k
	(b, c) = (n ** 2 // 2, n ** 2 // 2 + 1)
	print(b * k, c * k)


n = int(input())
a = 0
if n == 1 or n == 2:
	print(-1)
elif n % 2:
	a = n * n // 2
	print(a, a + 1)
else:
	t = n // 2
	a = t * t - 1
	print(a, a + 2)


import math
n = int(input())
if n < 3:
	print(-1)
elif n % 2 != 0:
	xs = n * n
	ys = xs // 2
	print(ys, end=' ')
	print(ys + 1)
else:
	xs = n * n
	ys = xs // 4
	print(ys - 1, end=' ')
	print(ys + 1)


def fact(x):
	a = {2: 0, 3: 0, 5: 0}
	y = 2
	while y <= 5:
		while x % y == 0:
			a[y] += 1
			x /= y
		y += 1
	return a
n = int(input())
if n < 3:
	print(-1)
	exit(0)
if n % 2 == 1:
	m = n * n // 2
	k = m + 1
	print(m, k)
	exit(0)
a = fact(n)
if a[2] > 1:
	m = 3 * (n // 4)
	k = 5 * (n // 4)
	print(m, k)
elif a[3] > 0:
	m = 4 * (n // 3)
	k = 5 * (n // 3)
	print(m, k)
elif a[5] > 0:
	m = 4 * (n // 5)
	k = 3 * (n // 5)
	print(m, k)
else:
	m = n * n // 4 - 1
	k = n * n // 4 + 1
	print(m, k)


def f():
	a = int(input())
	if a == 1 or a == 2:
		print('-1')
		return
	elif a % 2 == 0:
		b = a * a // 4 - 1
		c = a * a // 4 + 1
	else:
		b = (a * a - 1) // 2
		c = (a * a + 1) // 2
	print(int(b), int(c))
f()


import sys
n = int(input())
if 3 > n:
	print(-1)
	sys.exit()
m = 2 - (1 & n)
n *= n
print(n - 1 >> m, 1 + (n >> m))


n = int(input())
if n == 1 or n == 2:
	print(-1)
else:
	m = n
	cnt = 0
	while n % 2 == 0:
		n //= 2
		cnt += 1
	if n == 1:
		print(3 * 2 ** (cnt - 2), 5 * 2 ** (cnt - 2))
	else:
		x = (n - 1) // 2
		print(2 * x * (x + 1) * 2 ** cnt, (2 * x * x + 2 * x + 1) * 2 ** cnt)


def triples(n):
	if n == 1 or n == 2:
		return [-1]
	if n % 2 == 1 or n == 1:
		return [(n * n - 1) // 2, (n * n + 1) // 2]
	if n % 2 == 0:
		return [n * n // 4 - 1, n * n // 4 + 1]
print(*triples(int(input())))


from collections import Counter, defaultdict, deque
import math
import sys
input = sys.stdin.readline
x = int(input())
p = 0
if x in {1, 2}:
	print(-1)
elif x % 2 == 0:
	x //= 2
	if x % 2 == 0:
		x //= 2
		print(5 * x, 3 * x)
	else:
		print(x * x - 1, x * x + 1)
else:
	a = (x * x - 1) // 2
	print(a, a + 1)


n = int(input()) ** 2
if n < 5:
	print(-1)
	exit()
if n % 4:
	(a, b) = (n // 2, n // 2 + 1)
else:
	(a, b) = (n // 4 - 1, n // 4 + 1)
print(a, b)


n = int(input())
k = 0
r = n
while r % 2 == 0:
	k += 1
	r = r // 2
if r > 1:
	print(2 ** k * (r ** 2 + 1) // 2, 2 ** k * (r ** 2 - 1) // 2)
elif k >= 2:
	print(2 ** (k - 2) * 5, 2 ** (k - 2) * 3)
else:
	print(-1)


from sys import stdin, stdout
n = int(stdin.readline().strip())
if n < 3:
	print(-1)
elif n % 2:
	print((n ** 2 - 1) // 2, (n ** 2 + 1) // 2)
else:
	print(n ** 2 // 4 - 1, n ** 2 // 4 + 1)


n = int(input())
if n == 1 or n == 2:
	print(-1)
elif n % 2 == 1:
	x = n * n
	y = 1
	print((x + y) // 2, (x - y) // 2)
else:
	x = n * n // 2
	y = 2
	print((x + y) // 2, (x - y) // 2)


n = int(input())
if n == 1 or n == 2:
	print(-1)
elif n % 4 == 0:
	ans = [n / 4 * 3, n / 4 * 5]
	print(' '.join(map(lambda x: str(int(x)), ans)))
else:
	m = n
	while m % 2 == 0:
		m = m // 2
	ans = [(m ** 2 - 1) // 2 * (n // m), (m ** 2 + 1) // 2 * (n // m)]
	print(' '.join(map(lambda x: str(int(x)), ans)))


def solve():
	n = int(input().rstrip())
	if n < 3:
		print(-1)
	elif n * n % 4 == 0:
		print(n * n // 4 - 1, n * n // 4 + 1)
	else:
		print(n * n // 2, n * n // 2 + 1)
solve()


n = int(input())
if n < 3:
	print(-1)
elif n % 2 == 0:
	print(n * n // 4 - 1, n * n // 4 + 1)
else:
	print(n * n // 2, n * n // 2 + 1)


n = int(input())
if n == 1 or n == 2:
	print(-1)
elif n % 2 == 0:
	a = n ** 2 // 4 + 1
	b = a - 2
	(a, b) = (min(a, b), max(a, b))
	print(a, b)
else:
	a = (n ** 2 + 1) // 2
	b = (n ** 2 - 1) // 2
	(a, b) = (min(a, b), max(a, b))
	print(a, b)


a = int(input())
if a % 2:
	b = (a ** 2 - 1) // 2
	c = b + 1
else:
	b = (a // 2) ** 2 - 1
	c = b + 2
if min(b, c) > 0:
	print(b, c)
else:
	print(-1)


n = int(input())
if n % 4 == 0:
	temp = n // 4
	m = temp * 3
	k = temp * 5
elif n % 2 == 0:
	n //= 2
	m = n ** 2 // 2
	k = m + 1
	m *= 2
	k *= 2
else:
	m = n ** 2 // 2
	k = m + 1
if 3 > n:
	print('-1')
else:
	print(m, k)


from sys import stdin, stdout
import math
n = int(stdin.readline().rstrip())
if n < 3:
	stdout.write('-1')
elif n % 2 == 0:
	stdout.write(str(n ** 2 // 4 - 1) + ' ' + str(n ** 2 // 4 + 1))
else:
	stdout.write(str((n ** 2 - 1) // 2) + ' ' + str((n ** 2 + 1) // 2))


import math
import sys
import collections
import bisect
import string
import time

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()
for t in range(1):
	n = int(input())
	if n % 2 == 0:
		a = n ** 2 // 4 - 1
		b = a + 2
		if b >= a > 0:
			print(a, b)
		else:
			print(-1)
	else:
		a = (n ** 2 - 1) // 2
		b = a + 1
		if b >= a > 0:
			print(a, b)
		else:
			print(-1)


n = int(input())
i = 0
r = n
while r % 2 == 0:
	r //= 2
	i += 1
if r == 1:
	if i < 2:
		print(-1)
	else:
		print(2 ** (i - 2) * 3, 2 ** (i - 2) * 5)
else:
	d = r * r // 2
	print(2 ** i * (d + 1), 2 ** i * d)


n = int(input())
print(*(([(n * n - 4) // 4, (n * n + 4) // 4], [(n * n - 1) // 2, (n * n + 1) // 2])[n % 2], [-1])[n < 3])


n = int(input())
if n < 3:
	print(-1)
elif n % 2 == 0:
	print((n // 2) ** 2 - 1, end=' ')
	print((n // 2) ** 2 + 1)
else:
	r = (n + 1) // 2
	print(2 * r * (r - 1), end=' ')
	print(r ** 2 + (r - 1) ** 2)


k = int(input())
c = 1
l = k
while k % 2 == 0:
	k = k / 2
	c = c * 2
k = int(k)
if k == 1:
	if l == 1:
		print(-1)
	elif l == 2:
		print(-1)
	elif l == 4:
		print(3, 5)
	else:
		print(3 * l // 4, 5 * l // 4)
else:
	k = k ** 2
	n = (k + 1) // 2
	print((n - 1) * c, n * c)


def solve(n):
	if n == 1 or n == 2:
		return -1
	if n == 4:
		return [3, 5]
	if n // 2 == n / 2:
		s = solve(n // 2)
		return [s[0] * 2, s[1] * 2]
	k = (n - 1) // 2
	c = 2 * (k * k + k)
	return [c, c + 1]
n = int(input())
s = solve(n)
if s == -1:
	print('-1')
else:
	print(str(s[0]) + ' ' + str(s[1]))


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

def chars():
	s = cin()
	return list(s[:len(s) - 1])

def pl(a):
	for val in a:
		cout(val + '\n')
(n,) = mp()
if n < 3:
	cout('-1')
elif n % 2:
	cout(str((n * n + 1) // 2) + ' ' + str((n * n - 1) // 2))
else:
	cout(str(n * n // 4 + 1) + ' ' + str(n * n // 4 - 1))


n = int(input())
if n <= 2:
	print(-1)
else:
	c = 0
	while n % 2 == 0:
		c += 1
		n //= 2
	if n == 1:
		print(3 * 2 ** (c - 2), 5 * 2 ** (c - 2))
	else:
		print(2 ** c * (n ** 2 // 2), 2 ** c * ((n ** 2 + 1) // 2))


n = int(input())
if n == 1:
	print(-1)
elif n == 2:
	print(-1)
elif n % 2 == 0:
	L = [n // 2 * (n // 2) - 1, n // 2 * (n // 2) + 1]
	for x in L:
		print(x, end=' ')
elif n % 2 != 0:
	L = [(n * n - 1) // 2, (n * n + 1) // 2]
	for y in L:
		print(y, end=' ')


a = int(input())
ans = 0
if a == 1 or a == 2:
	print(-1)
	ans = 1
if a % 2 == 1:
	b = a * a // 2
	c = b + 1
	if ans == 0:
		print(str(b) + ' ' + str(c))
	elif ans == 0:
		print(-1)
		print('!')
	ans = 1
if a & a - 1 == 0:
	b = 3 * a // 4
	c = 5 * a // 4
	if ans == 0:
		print(str(b) + ' ' + str(c))
	elif ans == 0:
		print(-1)
	ans = 1
cnt = 0
while a % 2 == 0:
	cnt += 1
	a //= 2
b = pow(a, 2) // 2 * pow(2, cnt)
c = (pow(a, 2) // 2 + 1) * pow(2, cnt)
if ans == 0:
	print(str(b) + ' ' + str(c))
elif ans == 0:
	print(-1)


n = int(input())
if n == 1 or n == 2:
	print(-1)
elif n == 4:
	print(3, 5)
elif n % 2 == 1:
	print((n * n - 1) // 2, (n * n + 1) // 2)
else:
	twos = 0
	while n % 2 == 0:
		n //= 2
		twos += 1
	if n == 1:
		print(15 * 2 ** (twos - 3), 17 * 2 ** (twos - 3))
	else:
		print(2 ** twos * (n * n - 1) // 2, 2 ** twos * (n * n + 1) // 2)


n = int(input())
if n % 4 == 0:
	print(3 * (n // 4), 5 * (n // 4))
elif n == 1 or n == 2:
	print(-1)
else:
	k = 1
	while n % 2 == 0:
		n //= 2
		k *= 2
	a = (n * n - 1) // 2
	b = a + 1
	print(a * k, b * k)


n = int(input())
if n == 1 or n == 2:
	print(-1)
elif n % 2 == 0:
	m = n ** 2 // 4 - 1
	k = n ** 2 // 4 + 1
	print(str(m) + ' ' + str(k))
else:
	m = (n ** 2 - 1) // 2
	k = (n ** 2 + 1) // 2
	print(str(m) + ' ' + str(k))


x = int(input())
if x < 3:
	print(-1)
elif x * x % 4:
	print(x * x // 2, x * x // 2 + 1)
else:
	print(x * x // 4 - 1, x * x // 4 + 1)


n = int(input())
a = 0
b = 0
for i in range(1, n):
	if n * n % i == 0:
		if (i + n * n // i) % 2 == 0 and abs(i - n * n // i) % 2 == 0:
			a = (i + n * n // i) // 2
			b = abs(i - n * n // i) // 2
			break
if a:
	print(min(a, b), max(a, b))
else:
	print(-1)


import sys
input = sys.stdin.readline

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 // gcd(a, b)

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 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)]
	(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)
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()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
from itertools import permutations
import math
from bisect import bisect_left

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


a = int(input())
if a < 3:
	print(-1)
else:
	b = c = 0
	if a % 2:
		b = a ** 2 // 2
		c = a ** 2 // 2 + 1
	elif a % 4 == 0:
		b = 3 * (a // 4)
		c = 5 * (a // 4)
	else:
		b = (a // 2) ** 2 // 2 * 2
		c = ((a // 2) ** 2 // 2 + 1) * 2
	print(b, c)


n = int(input())
if n == 1 or n == 2:
	print(-1)
else:
	f = 0
	x = n
	for i in range(2, int(x ** 0.5) + 1):
		while n % i == 0:
			n = n // i
			f = i
	if n > 1:
		f = n
	if f == 2:
		(b, c) = (x // 4 * 3, x // 4 * 5)
	else:
		(b, c) = (x // f * (f * f // 2), x // f * (f * f // 2 + 1))
	print(b, c)


import sys
from math import *
from fractions import gcd
readints = lambda : map(int, input().strip('\n').split())
n = int(input())
if n == 1 or n == 2:
	print(-1)
	sys.exit(0)
if n % 2 == 0:
	m = n ** 2 // 4 + 1
	k = n ** 2 // 4 - 1
	print(m, k)
else:
	m = (n ** 2 + 1) // 2
	k = (n ** 2 - 1) // 2
	print(m, k)


n = int(input())
if n == 1 or n == 2:
	print(-1)
elif n % 2 == 0:
	c = (n * n + 4) // 4
	b = (n * n - 4) // 4
	print(b, end=' ')
	print(c)
elif n % 2 != 0:
	c = (n * n + 1) // 2
	b = (n * n - 1) // 2
	print(b, end=' ')
	print(c)


n = int(input())
if n > 2:
	m = k = 0
	if n % 2 == 1:
		k = (n * n + 1) // 2
		m = k - 1
	else:
		k = (n * n // 2 + 1 + 1) // 2
		m = k - 2
	print(m, k)
else:
	print(-1)


(n,) = map(int, input().split())
t = 1
while n > 1 and n % 2 == 0:
	(n, t) = (n // 2, 2 * t)
if n == 1:
	if t <= 2:
		print(-1)
	else:
		a = t * t // 4
		print(a - 1, a + 1)
else:
	a = (n * n - 1) // 2
	b = a + 1
	print(a * t, b * t)


t = int(input())
if t == 1 or t == 2:
	print(-1)
elif t % 2 == 1:
	print(t * t // 2, (t * t + 1) // 2)
else:
	print(t * t // 4 + 1, t * t // 4 - 1)


n = int(input())
if n <= 2:
	print(-1)
	exit()
if n % 2 == 1:
	print((n ** 2 - 1) // 2, (n ** 2 + 1) // 2)
else:
	print(n ** 2 // 4 + 1, n ** 2 // 4 - 1)


k = int(input())
if k <= 2:
	print('-1')
elif k % 2:
	x = (k - 1) // 2
	print(2 * x * (x + 1), x ** 2 + (x + 1) ** 2)
else:
	x = k ** 2 // 4
	print(x - 1, x + 1)


def prim(x):
	p = 1
	for i in range(2, int(x ** 0.5) + 1):
		if x % i == 0:
			p = x // i
			return p
	return x
b = int(input())
a = 0
c = 0
p = 1
if b % 2 != 0:
	p = 2
	b *= 2
m = b // 2
n = 1
a = m ** 2 - n ** 2
c = m ** 2 + n ** 2
if a % p == 0 and c % p == 0 and (a > 0) and (c > 0):
	print(a // p, c // p)
else:
	print(-1)


def findTriplet(n):
	if n > 2:
		if n & 1 != 0:
			b = (n * n - 1) // 2
			a = b + 1
			print(a, b)
		else:
			b = n * n // 4 + 1
			a = b - 2
			print(a, b)
	else:
		print(-1)
N = eval(input())
findTriplet(N)


import sys
import math
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())
n = inp()
if n < 3:
	print(-1)
elif n % 2 == 0:
	m = n // 2
	print(str(m ** 2 - 1) + ' ' + str(m ** 2 + 1))
else:
	m = (n - 1) // 2
	print(str(2 * (m + 1) * m) + ' ' + str((m + 1) ** 2 + m ** 2))


a = int(input())
if a % 2 == 0:
	a = a // 2
	if a == 1:
		print('-1')
	else:
		print(a * a - 1, a * a + 1)
elif a == 1:
	print('-1')
else:
	print((a * a - 1) // 2, (a * a + 1) // 2)


n = int(input())
a = n
if a == 1 or a == 2:
	print(-1)
else:
	if a % 2 != 0:
		b = a * a // 2
		c = b + 1
	else:
		n //= 2
		if n % 2 != 0:
			b = 2 * (n ** 2 // 2)
			c = 2 * (n ** 2 // 2 + 1)
		else:
			b = 3 * (a // 4)
			c = 5 * (a // 4)
	print(b, c)


import sys

def read():
	n = int(next(sys.stdin))
	return n

def solve(n):
	if n == 1:
		return (-1, None)
	if n % 2 == 0:
		(u, v) = (n // 2, 1)
		return (u * u - v * v, u * u + v * v)
	u = (n + 1) // 2
	v = (n - 1) // 2
	return (2 * u * v, u * u + v * v)
n = read()
(k, m) = solve(n)
if k > 0:
	print('{} {}'.format(k, m))
else:
	print(-1)


n = int(input())
nc = n
if n == 1 or n == 2:
	print(-1)
	quit()
f = 1
while n % 2 != 1:
	n = n // 2
	f *= 2
if n == 1:
	print(int(nc * 3 / 4), int(nc * 5 / 4))
	quit()
a = (n ** 2 - 1) // 2
b = a + 1
print(a * f, b * f)


from math import ceil, log, floor, sqrt

def mod_expo(n, p, m):
	result = 1
	while p != 0:
		if p % 2 == 1:
			result = result * n % m
		p //= 2
		n = n * n % m
	return result

def find_product(n, m, arr):
	product = 1
	if n <= m:
		for i in range(n):
			for j in range(i + 1, n):
				product = product * abs(arr[i] - arr[j]) % m
		return product
	return 0

def count_tables(l):
	count = 0
	l.sort()
	a = l[1] - l[0]
	b = l[2] - l[0]
	if a % 3 > 0 and a % 3 + (b - (a - a % 3)) >= 3:
		count += 1
	count += l[0] + 2 * a // 3
	return int(min(sum(l) / 3, l[0] + l[1]))

def find_possible_weight(W, arr):
	w = 0
	for i in range(8, 0, -1):
		count = min(arr[i - 1], W // i)
		w += count * i
		W -= count * i
	return w

def find_divisor(a):
	divisors = []
	for i in range(2, min(a, ceil(sqrt(a)) + 1)):
		if a % i == 0:
			if a / i == i:
				divisors.append(i)
			else:
				divisors.append(i)
				divisors.append(a / i)
	if len(divisors) == 0:
		return -1
	return int(min(divisors))

def find_arr(u, v):
	res = []
	if u % 2 != v % 2 or u > v:
		return res
	if u == v:
		res = [u]
		return res
	x = (v - u) // 2
	if u & x:
		res = [u, x, x]
	else:
		res = [u ^ x, x]
	return res

def get_divisors(n, arr):
	d1 = []
	d2 = []
	for i in range(n):
		spf = find_divisor(arr[i])
		if spf == -1:
			d1.append(-1)
			d2.append(-1)
		else:
			while arr[i] % spf == 0:
				arr[i] /= spf
			if arr[i] != 1:
				d1.append(int(arr[i]))
				d2.append(spf)
			else:
				d1.append(-1)
				d2.append(-1)
	print(*d1, sep=' ')
	print(*d2, sep=' ')

def find_max_gcd(a):
	degree = ceil(log(a) / log(2))
	m = pow(2, degree) - 1
	if a == m:
		return find_divisor(a)
	if a == m + 1:
		m = 2 * a - 1
	return m

def get_sides(a):
	n = a // 2
	if a < 3:
		print(-1)
		return
	if a % 2 == 1:
		a = a * a
		b = (a - 1) // 2
		c = (a + 1) // 2
	else:
		a //= 2
		b = a * a - 1
		c = a * a + 1
	print(str(b) + ' ' + str(c))
t = 1
while t:
	t = t - 1
	n = int(input())
	get_sides(n)


a = int(input())
if a == 1 or a == 2:
	print(-1)
elif a % 4 == 0 and a != 4:
	b = ((a // 2) ** 2 - 4) // 2
	c = ((a // 2) ** 2 + 4) // 2
	print(b, c)
elif a % 2 == 0:
	a //= 2
	b = a ** 2 - 1
	c = a ** 2 + 1
	print(b, c)
else:
	b = (a ** 2 - 1) // 2
	c = (a ** 2 + 1) // 2
	print(b, c)


def main():
	a = int(input())
	if a <= 2:
		print(-1)
		return
	aa = a ** 2
	if a % 2 != 0:
		b = (aa - 1) // 2
		c = (aa + 1) // 2
	else:
		b = aa // 4 - 1
		c = aa // 4 + 1
	print('{:d} {:d}'.format(b, c))
main()


def solve(a):
	if a == 1 or a == 2:
		print('-1')
		return
	if a % 2 == 1:
		a = a // 2
		b = 2 * a * a + 2 * a
		c = 2 * a * a + 2 * a + 1
		print(b, c)
		return
	a = a // 2
	b = a * a - 1
	c = a * a + 1
	print(b, c)
a = int(input())
solve(a)


n = int(input().strip())
if n <= 2:
	print(-1)
elif n % 2 == 0:
	n = (n // 2) ** 2
	print(n - 1, n + 1)
else:
	a = n // 2
	b = a + 1
	print(2 * a * b, a ** 2 + b ** 2)


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()]
a = Int()
if a <= 2:
	print(-1)
else:
	if a % 2 == 0:
		m = 1
		n = a // 2
		b = m ** 2 + n ** 2
		c = n ** 2 - m ** 2
	else:
		m = a // 2
		n = m + 1
		b = 2 * m * n
		c = m ** 2 + n ** 2
	print(b, c)


n = int(input())

def func(n):
	if n % 2 == 1:
		b = (n ** 2 - 1) // 2
		c = (n ** 2 + 1) // 2
	else:
		b = (n // 2) ** 2 - 1
		c = (n // 2) ** 2 + 1
	return (b, c)
if n <= 2:
	print(-1)
else:
	(b, c) = func(n)
	print(b, c)


def fun(n):
	while n % 2 == 0:
		n = n // 2
	return n
n = int(input())
if n <= 2:
	print(-1)
elif n % 2 != 0:
	a = n * n + 1
	b = n * n - 1
	print(a // 2, b // 2)
elif fun(n) == 1:
	q = n // 4
	print(3 * q, 5 * q)
else:
	p = fun(n)
	q = n // fun(n)
	a = p * p + 1
	b = p * p - 1
	print(a * q // 2, b * q // 2)


from sys import stdin

def main():
	line = stdin.readline()
	while len(line):
		num = int(line)
		aux = num * num
		if num % 2 == 0:
			hi = aux // 2
			aux //= 2
		else:
			hi = aux
		low = 0
		mid = (low + hi) // 2
		while low + 1 != hi:
			mid = (low + hi) // 2
			if abs(mid * mid - abs(mid - aux) * abs(mid - aux)) < aux:
				hi = mid
			elif abs(mid * mid - abs(mid - aux) * abs(mid - aux)) == aux:
				low = hi - 1
			else:
				low = mid
		a = mid * mid
		b = abs(mid - aux) * abs(mid - aux)
		aux2 = num * num
		if num == 1 or num == 2:
			print(-1)
		elif a + b == aux2 or aux2 + a == b or b + aux2 == a:
			print(mid, abs(mid - aux))
		else:
			print(-1)
		line = stdin.readline()
main()


n = int(input())
if n % 2 != 0 and (n * 2 - 1) // 2 > 0 and (n * 2 + 1) // 2:
	print((n ** 2 - 1) // 2)
	print((n ** 2 + 1) // 2)
elif (n * 2 + 4) // 4 > 0 and (n * 2 - 4) // 4 > 0:
	print((n ** 2 + 4) // 4)
	print((n ** 2 - 4) // 4)
else:
	print(-1)


import sys
sys.setrecursionlimit(20000)
from collections import Counter
from math import ceil, floor, factorial, fsum, isinf, exp, log, log10, log2, isfinite
from itertools import product

def getlist(tcast):
	return [tcast(x) for x in input().strip().split(' ')]

def getval(tcast):
	return tcast(input().strip())

def getmatrix(r, tcast):
	mat = []
	for i in range(r):
		mat.append(getlist(tcast))
	return mat

def isodd(n):
	return n & 1

def numdigits(n):
	return len(str(n)) - (1 if n < 0 else 0)

def primesupto(n):
	isp = [True] * (n + 1)
	(isp[0], isp[1]) = (False, False)
	for (i, x) in enumerate(isp):
		if x:
			mults = i * i
			while mults <= n:
				isp[mults] = False
				mults += i
	return isp

def maxarrays(a, b):
	return [max(x, y) for (x, y) in zip(a, b)]

def checktriple(a, b, c):
	return a ** 2 + b ** 2 == c ** 2
b = getval(int)
if b < 3:
	print(-1)
else:
	out = [0, 0, 0]
	if b % 2 == 0:
		temp = b // 2
		(a, c) = (temp ** 2 - 1, temp ** 2 + 1)
		out = (b, a, c)
	else:
		k = (b + 1) // 2
		(a, c) = (2 * k * (k - 1), (k - 1) ** 2 + k ** 2)
		out = (b, a, c)
	print(*out[1:])


n = int(input())
n2 = n ** 2
if n < 3:
	print(-1)
elif n % 2 == 1:
	print(n2 // 2, n2 // 2 + 1)
else:
	L = []
	x = n
	i = 0
	while x % 2 == 0:
		x //= 2
		i += 1
	if x != 1:
		x2 = x ** 2
		xx = 2 ** i
		print(x2 // 2 * xx, (x2 // 2 + 1) * xx)
	else:
		print(3 * n // 4, 5 * n // 4)


n = int(input()) ** 2
print(*((-1,) if n < 9 else (n // 2, n // 2 + 1) if n & 1 else (n // 4 - 1, n // 4 + 1)))


def main():
	n = int(input())
	pw2 = 0
	while not n & 1:
		n //= 2
		pw2 += 1
	if n == 1 and pw2 < 2:
		print(-1)
		return
	if n == 1:
		a = 3 << pw2 - 2
		b = 5 << pw2 - 2
	else:
		a = (n * n - 1) // 2
		b = a + 1
		a <<= pw2
		b <<= pw2
	print(a, b)
main()


from collections import deque, Counter, OrderedDict
from heapq import nsmallest, nlargest
from math import ceil, floor, log, log2, sqrt, gcd, factorial

def binNumber(n, size=1):
	return bin(n)[2:].zfill(size)

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

def ini():
	return int(input())

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

def sti():
	return str(input())

class pair:

	def __init__(self, f, s):
		self.fi = f
		self.se = s

	def __lt__(self, other):
		return (self.fi, self.se) < (other.fi, other.se)
n = ini()
if n == 1 or n == 2:
	print(-1)
	quit()
if n % 2 == 0:
	print(n * n // 4 - 1, n * n // 4 + 1)
else:
	print((n * n - 1) // 2, (n * n + 1) // 2)


x = int(input())
if x == 1 or x == 2:
	print(-1)
elif x % 2 == 0:
	m = 1
	n = x // 2
	print(n ** 2 - m ** 2, n ** 2 + m ** 2)
else:
	n = (x + 1) // 2
	m = n - 1
	print(2 * n * m, n ** 2 + m ** 2)


n = int(input())
if n < 3:
	print(-1)
else:
	y = n
	while y % 2 == 0:
		y //= 2
	if y == 1:
		y = n // 4
		print(3 * y, 5 * y)
		exit()
	else:
		res = y * y // 2
		print(res * n // y + n // y, res * n // y)


n = int(input())
if n == 2 or n == 1:
	print(-1)
elif n % 2 == 0:
	print(*[int(n / 2) ** 2 - 1, int(n / 2) ** 2 + 1])
else:
	d = int((n + 1) / 2)
	e = int((n - 1) / 2)
	print(*[2 * d * e, d ** 2 + e ** 2])


n = int(input())
if n < 3:
	print(-1)
	exit()
k = 1
while n % 2 == 0:
	n //= 2
	k *= 2
if n == 1:
	print(3 * k // 4, 5 * k // 4)
else:
	f = n // 2
	f *= 2 + 2 * f
	print(f * k, f * k + k)


n = int(input())
if n <= 2:
	print(-1)
elif n % 2 == 0:
	print(str(n * n // 4 - 1) + ' ' + str(n * n // 4 + 1))
else:
	print(str((n * n - 1) // 2) + ' ' + str((n * n + 1) // 2))


x = int(input())
if x < 3:
	print(-1)
else:
	b = int(x / 2)
	if x % 2:
		print(2 * b * (b + 1), 2 * b * (b + 1) + 1)
	else:
		print(b * b - 1, b * b + 1)


import sys, math
input = sys.stdin.readline

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input().strip()

def listStr():
	return list(input().strip())
import collections as col
import math, itertools

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

def solve():
	N = getInt()
	if N <= 2:
		print(-1)
		return
	if N % 2 == 1:
		a = (N ** 2 - 1) // 2
		print(a, a + 1)
		return
	if N % 4 == 0:
		x = N // 4
		print(3 * x, 5 * x)
		return
	facs = prime_factors(N // 2)
	p = facs[0][0]
	a = (p ** 2 - 1) // 2
	print(N * a // p, N * (a + 1) // p)
	return
solve()


def f(cnt):
	p = 1
	a = 2
	while cnt:
		if cnt % 2:
			p *= a
			cnt -= 1
		else:
			a *= a
			cnt //= 2
	return p
n = int(input())
if n == 1 or n == 2:
	print(-1)
else:
	m = n
	cnt = 0
	while n % 2 == 0:
		n //= 2
		cnt += 1
	if n == 1:
		print(3 * f(cnt - 2), 5 * f(cnt - 2))
	else:
		x = (n - 1) // 2
		print(2 * x * (x + 1) * f(cnt), (2 * x * x + 2 * x + 1) * f(cnt))


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
import copy
import time
starttime = time.time()
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

def pmat(A):
	for ele in A:
		print(*ele, end='\n')

def seive():
	prime = [1 for i in range(10 ** 6 + 1)]
	prime[0] = 0
	prime[1] = 0
	for i in range(10 ** 6 + 1):
		if prime[i]:
			for j in range(2 * i, 10 ** 6 + 1, i):
				prime[j] = 0
	return prime
n = L()[0]
if n <= 2:
	print(-1)
elif n % 2:
	print((n * n - 1) // 2, (n ** 2 + 1) // 2)
else:
	print(n * n // 4 - 1, n * n // 4 + 1)
endtime = time.time()


from sys import stdin, stdout
from math import gcd, ceil, sqrt
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
n = ii1()
if n > 2:
	if n % 2 == 0:
		print(n // 2 * n // 2 - 1, n // 2 * n // 2 + 1)
	else:
		print((n * n - 1) // 2, (n * n + 1) // 2)
else:
	print(-1)


square = lambda x: x * x
n = int(input())
if n < 3:
	print(-1)
elif n % 2 == 0:
	print(square(n // 2) - 1, square(n // 2) + 1)
else:
	n = (n - 1) // 2
	print(2 * (square(n) + n), 2 * (square(n) + n) + 1)


def check_pytha(angles):
	angles.sort()
	if min(angles) > 0:
		if angles[0] ** 2 + angles[1] ** 2 == angles[2] ** 2:
			return True
		else:
			return False
	else:
		return False

def io():
	n = int(input())
	return n

def solve():
	n = io()
	m = n
	n = n ** 2
	if n % 2 == 0:
		n = n // 2
		(a, b) = (n // 2 - 1, n - n // 2 + 1)
	else:
		(a, b) = (n // 2, n - n // 2)
	ans = check_pytha([m, a, b])
	if ans is True:
		print(a, b)
	else:
		print(-1)
solve()


side = int(input())
if side >= 3:
	if side % 2:
		print((side ** 2 - 1) // 2, (side ** 2 + 1) // 2)
	else:
		print((side ** 2 - 4) // 4, (side ** 2 + 4) // 4)
else:
	print(-1)


import math

def printOtherSides(n):
	if n & 1:
		if n == 1:
			print(-1)
		else:
			b = (n * n - 1) // 2
			c = (n * n + 1) // 2
			print(b, c)
	elif n == 2:
		print(-1)
	else:
		b = n * n // 4 - 1
		c = n * n // 4 + 1
		print(b, c)
q = 1
for _ in range(q):
	a = int(input())
	printOtherSides(a)


def run():
	import sys
	sys.stdin = open('/home/punit/Documents/Cpp Programs/input.txt', 'r')
	sys.stdout = open('/home/punit/Documents/Cpp Programs/output.txt', 'w')
	from math import ceil, sqrt, floor
from math import ceil, sqrt, floor
n = int(input())
if n < 3:
	print(-1)
elif n % 2:
	n = n * n
	print((n + 1) // 2, (n - 1) // 2)
else:
	n = n * n
	print((n + 4) // 4, (n - 4) // 4)


n = int(input())
if n < 3:
	print(-1)
	exit()
if n % 2 == 0:
	print(n * n // 4 - 1, n * n // 4 + 1)
else:
	print((n * n - 1) // 2, (n * n + 1) // 2)


a = int(input())
if a == 1 or a == 2:
	print(-1)
elif a & 1:
	b = (a * a - 1) // 2
	print(b, b + 1)
else:
	b = a * a // 4 - 1
	print(b, b + 2)


n = int(input())
if n <= 2:
	print(-1)
	exit()
elif n % 2 == 0:
	m = n * n // 4 - 1
	k = n * n // 4 + 1
else:
	m = (n * n - 1) // 2
	k = (n * n + 1) // 2
print(m, k)


import time
x = int(input())
start = time.time()
if x < 3:
	ans = -1
elif x % 2 == 0:
	m = x // 2
	n = 1
	ans = (m ** 2 - n ** 2, m ** 2 + n ** 2)
else:
	m = (x + 1) // 2
	n = m - 1
	ans = (2 * m * n, m ** 2 + n ** 2)
if ans == -1:
	print(-1)
else:
	for i in ans:
		print(i, end=' ')
	print()
finish = time.time()


import math
n = int(input())
if n % 2 != 0:
	if n ** 2 + ((n ** 2 - 1) // 2) ** 2 == ((n ** 2 + 1) // 2) ** 2:
		b = (n ** 2 - 1) // 2
		c = (n ** 2 + 1) // 2
		if b > 0 and c > 0:
			print(b, end=' ')
			print(c)
		else:
			print(-1)
	elif n ** 2 - (n - 1) ** 2 == 2 * n - 1:
		b = n - 1
		c = math.sqrt(2 * n - 1)
		if b > 0 and c > 0:
			print(b, end=' ')
			print(c)
		else:
			print(-1)
	elif 2 * n + 1 + n ** 2 == (n + 1) ** 2:
		b = math.sqrt(2 * n + 1)
		c = n + 1
		if b > 0 and c > 0:
			print(b, end=' ')
			print(c)
		else:
			print(-1)
	else:
		print(-1)
elif n % 2 == 0:
	if n ** 2 + (n ** 2 // 4 - 1) ** 2 == (n ** 2 // 4 + 1) ** 2:
		b = n ** 2 // 4 - 1
		c = n ** 2 // 4 + 1
		if b > 0 and c > 0:
			print(b, end=' ')
			print(c)
		else:
			print(-1)
	elif 4 * n + 4 + n ** 2 == ((n + 1) ** 2 + 1) ** 2:
		b = math.sqrt(4 * n + 4)
		c = (n + 1) ** 2 + 1
		if b > 0 and c > 0:
			print(b, end=' ')
			print(c)
		else:
			print(-1)
	elif n ** 2 == 4 * n - 4 + ((n - 1) ** 2 - 1) ** 2:
		b = math.sqrt(4 * n - 4)
		c = (n - 1) ** 2 - 1
		if b > 0 and c > 0:
			print(b, end=' ')
			print(c)
		else:
			print(-1)
	else:
		print(-1)


n = int(input())
if n == 1 or n == 2:
	print(-1)
else:
	m = n * n
	if m % 2 == 0:
		p = 2
		q = m // 2
	else:
		p = 1
		q = m
	a = (q + p) // 2
	b = q - a
	print(a, b)


import sys

def solve(n):
	if n < 3:
		print(-1)
		sys.exit()
	if n % 2 == 0:
		(u, v) = (n // 2, 1)
		return (u * u - v * v, u * u + v * v)
	u = (n + 1) // 2
	v = (n - 1) // 2
	return (2 * u * v, u * u + v * v)
n = int(input())
(k, m) = solve(n)
print(k, m)


import sys
import math
import itertools
import collections

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):
	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 cdiv(n, k):
	return n // k + (n % k != 0)

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) // math.gcd(a, b)

def wr(arr):
	return ''.join(map(str, arr))

def revn(n):
	return str(n)[::-1]

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=3):
	newnumber = ''
	while number > 0:
		newnumber = str(number % base) + newnumber
		number //= base
	return newnumber
n = ii()
p = 1
if n < 3:
	print(-1)
else:
	while n % 2 == 0:
		n //= 2
		p *= 2
	if n == 1:
		print(3 * p // 4, 5 * p // 4)
	else:
		print(p * ((n ** 2 - 1) // 2), p * ((n ** 2 - 1) // 2 + 1))


n = int(input())
if n < 3:
	print(-1)
else:
	t = 0
	while n > 4 and n % 2 == 0:
		n //= 2
		t += 1
	if n == 4:
		p = 2 ** t
		print(p * 3, p * 5)
	else:
		y = n ** 2
		p = 2 ** t
		print(p * int(y // 2), p * (int(y // 2) + 1))


import math
import sys
n = int(input())
if n <= 2:
	print(-1)
elif n % 2 == 0:
	if n % 4 == 0:
		print(n // 4 * 3, n // 4 * 5)
	else:
		n //= 2
		print(n ** 2 // 2 * 2, n ** 2 // 2 * 2 + 2)
else:
	b = n ** 2 // 2
	c = b + 1
	print(b, c)


def de(n):
	d = 2
	while 1:
		if n % d == 0:
			return d
n = int(input())
if n <= 2:
	print(-1)
elif n % 2:
	m = (n - 1) // 2 + 1
	n = m - 1
	print(2 * n * m, m * m + n * n)
else:
	m = n // 2
	n = 1
	if m > n:
		print(m * m - n * n, m * m + n * n)
	else:
		print(-m * m + n * n, m * m + n * n)


def main():
	n = int(input())
	if n % 2 == 0:
		u = 1
		v = n // 2
		a = v * v - u * u
		b = v * v + u * u
		ok = True
		if a <= 0:
			ok = False
		if n * n + a * a != b * b:
			ok = False
		if a + n < b:
			ok = False
		if ok:
			print(a, b)
		else:
			print(-1)
	else:
		v = (n + 1) // 2
		u = n - v
		a = 2 * u * v
		b = v * v + u * u
		ok = True
		if a <= 0:
			ok = False
		if n * n + a * a != b * b:
			ok = False
		if a + n < b:
			ok = False
		if ok:
			print(a, b)
		else:
			print(-1)
main()


import math
n = int(input())
if n % 2 == 0:
	n //= 2
	(m, n) = (n, 1)
	a = m ** 2 - n ** 2
	c = m ** 2 + n ** 2
else:
	a = (n ** 2 - 1) // 2
	c = a + 1
if not a or not c:
	print('-1')
	exit(0)
print('{} {}'.format(a, c))


a = int(input())

def side(a):
	other = [a, 0, 0]
	if a == 1 or a == 2:
		return -1
	if a % 2 == 1:
		other = str(int((a ** 2 - 1) // 2)) + ' ' + str(int((a ** 2 + 1) // 2))
		return other
	elif a % 2 == 0:
		if a % 4 == 0:
			other = str(int(a * 3 // 4)) + ' ' + str(int(a * 5 // 4))
			return other
		else:
			return str(int((a // 2) ** 2 - 1)) + ' ' + str(int((a // 2) ** 2 + 1))
print(side(a))


n = int(input())
if n < 3:
	print(-1)
	exit()
if n % 2 == 1:
	x = (n * n - 1) // 2
	y = (n * n + 1) // 2
else:
	x = (n // 2) ** 2 - 1
	y = x + 2
print(x, y)


n = int(input())
if n == 1 or n == 2:
	print(-1)
elif n % 2 == 0:
	a = n ** 2 // 4 - 1
	c = n ** 2 // 4 + 1
	print(a, c, end=' ')
else:
	a = (n * n - 1) // 2
	c = (n * n + 1) // 2
	print(a, c, end=' ')


a = int(input())
if a <= 2:
	print(-1)
elif a % 2 == 0:
	a //= 2
	m = a
	n = 1
	print(m ** 2 - n ** 2, m * m + n * n)
else:
	m = (a + 1) // 2
	n = m - 1
	print(2 * m * n, m * m + n * n)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
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

def YES(c):
	return IF(c, 'YES', 'NO')

def Yes(c):
	return IF(c, 'Yes', 'No')

def main():
	t = 1
	rr = []
	for _ in range(t):
		n = I()
		k = 1
		while n % 2 == 0 and n != 4:
			k *= 2
			n //= 2
		if n == 1:
			rr.append(-1)
		elif n == 4:
			rr.append(JA([3 * k, 5 * k], ' '))
		else:
			t = n ** 2 // 2
			rr.append(JA([t * k, (t + 1) * k], ' '))
	return JA(rr, '\n')
print(main())


from math import *
from fractions import Fraction
x = int(input())
if x in (0, 1, 2):
	print(-1)
elif x % 2 != 0:
	n = (x - 1) // 2
	a = 2 * n * (n + 1)
	b = 2 * n * n + 2 * n + 1
	l = [a, b]
	l.sort()
	print(l[0], l[1])
else:
	n = x // 2
	p = n
	q = 1
	a = p * p + q
	b = p * p - q
	l = [a, b]
	l.sort()
	print(l[0], l[1])


tr = int(input())
if tr < 3:
	print(-1)
elif tr % 2 != 0:
	s = tr * tr // 2
	print(s, s + 1)
else:
	s = tr * tr // 4 - 1
	print(s, s + 2)


n = int(input())

def main():
	if n <= 2:
		print(-1)
		return
	if n % 2 == 0:
		print((n // 2) ** 2 + 1, (n // 2) ** 2 - 1)
	else:
		print((n ** 2 - 1) // 2, (n ** 2 + 1) // 2)
main()


a = int(input())
if a in (0, 1, 2):
	print(-1)
elif a % 2 == 0:
	print(a ** 2 // 4 + 1, a ** 2 // 4 - 1)
else:
	print((a ** 2 - 1) // 2, (a ** 2 + 1) // 2)


n = int(input())
s = n ** 2
flag = True
i = 1
while flag and i < n:
	if s % i == 0:
		m = s // i
		if (m - i) % 2 == 0:
			a = (m + i) // 2
			b = abs(m - i) // 2
			flag = False
			print(b, a)
	i += 1
if flag:
	i = 1
	while flag and i < n:
		a = s - i ** 2
		b = int(a ** 0.5)
		if a == b ** 2:
			flag = False
			print(i, b)
		i += 1
if flag:
	print(-1)


import math as m
n = int(input())
n = n ** 2
if n <= 4:
	print(-1)
elif n % 4 > 0:
	print(n // 2, n // 2 + 1)
else:
	print(n // 4 - 1, n // 4 + 1)


n = int(input().strip())
if n < 3:
	print(-1)
elif n % 2 == 0:
	print((n // 2) ** 2 - 1, (n // 2) ** 2 + 1)
else:
	print((n ** 2 - 1) // 2, (n ** 2 + 1) // 2)


from math import *

def pow1(x, base):
	if base == 0:
		return 1
	sq = pow1(x, base // 2)
	sq = sq * sq
	if base % 2:
		sq *= x
	return sq
n = int(input())
if n <= 2:
	print(-1)
elif n & 1:
	s = pow1(n, 2)
	print(s // 2, s // 2 + 1)
else:
	tem = sqrt(pow1(n + 1, 2) - pow1(n, 2))
	if int(tem) == tem:
		print(int(tem), n + 1)
	else:
		n1 = n
		while n:
			if n & 1:
				s = pow1(n, 2)
				print(s // 2 * (n1 // n), (s // 2 + 1) * (n1 // n))
				break
			if n == 4:
				print(3 * (n1 // n), 5 * (n1 // n))
				break
			n //= 2


import math
a = int(input())
r = int(math.sqrt(a)) + 1

def checkSquare(nn):
	n = int(math.sqrt(nn))
	return n * n == nn or (n - 1) ** 2 == nn or (n + 1) ** 2 == nn
res = False

def check(m, n):
	return m > 0 and n > 0 and (m < n)
for i in range(1, r):
	if a % i == 0:
		dif = min(i, a // i)
		sum = max(i, a // i)
		n = (dif + sum) // 2
		if n * 2 == dif + sum:
			m = sum - n
			if check(m, n):
				res = True
				print(2 * m * n, m ** 2 + n ** 2)
				break
if not res:
	if a % 2 == 0:
		for i in range(1, r):
			halfA = a // 2
			n = max(i, halfA // i)
			m = min(i, halfA // i)
			if check(m, n):
				res = True
				print(n ** 2 - m ** 2, n ** 2 + m ** 2)
				break
if not res:
	for i in range(1, r):
		if checkSquare(i) and checkSquare(a - i):
			n = max(int(math.sqrt(i)), int(math.sqrt(a - i)))
			m = min(int(math.sqrt(i)), int(math.sqrt(a - i)))
			if check(m, n):
				res = True
				print(n ** 2 - m ** 2, 2 * m * n)
				break
if not res:
	print(-1)


def solve():
	n = int(input())
	if n <= 2:
		print(-1)
		return
	if n % 2 == 0:
		k = (n ** 2 // 2 + 2) // 2
		m = k - 2
		print(k, m)
	else:
		k = (n ** 2 + 1) // 2
		m = k - 1
		print(k, m)
test = 1
while test > 0:
	solve()
	test -= 1


import sys
from decimal import *

def main():
	x = int(sys.stdin.readline())
	n = Decimal(x)
	if n == 1 or n == 2:
		print(-1)
		return
	if n % 2 == 0:
		print(n * n / 4 - 1, n * n / 4 + 1)
	else:
		print((n * n - 1) / 2, (n * n + 1) / 2)
main()


n = int(input())
if n < 3:
	print('-1')
else:
	if n % 2 != 0:
		b = (n ** 2 - 1) // 2
		c = b + 1
	elif n % 2 == 0:
		b = (n // 2) ** 2 - 1
		c = b + 2
	print('{:} {:}'.format(b, c))


t = 1
while t:
	t -= 1
	n = int(input())
	if n == 1 or n == 2:
		print(-1)
		continue
	if n % 2 == 1:
		print((n ** 2 + 1) // 2, (n ** 2 - 1) // 2)
	else:
		a = n * n // 2
		b = 2
		print((a + b) // 2, (a - b) // 2)


a = int(input())
if a == 1 or a == 2:
	print(-1)
elif a % 2:
	b = (a * a - 1) // 2
	c = b + 1
	print(b, c)
else:
	b = (a // 2) ** 2 - 1
	c = b + 2
	print(b, c)


import math as m
n = int(input())
v = n * n
if v == 1 or v == 4:
	print(-1)
elif v % 2 == 1:
	print('%d %d' % (v // 2, v // 2 + 1))
else:
	v = v // 2
	print('%d %d' % (v // 2 + 1, v // 2 - 1))


def main():
	n = int(input())
	if n <= 2:
		print(-1)
		return
	if n % 2 == 0:
		k = n ** 2 // 4 + 1
		m = k - 2
	else:
		k = (n ** 2 + 1) // 2
		m = k - 1
	print(m, k)
main()


n = int(input())
if n <= 2:
	print(-1)
elif n % 2 == 1:
	print((n ** 2 - 1) // 2, (n ** 2 + 1) // 2)
elif n % 2 == 0:
	m = n // 2
	print(m ** 2 - 1, m ** 2 + 1)


n = int(input())
if n % 2 != 0:
	p = int(n ** 2 // 2)
	q = p + 1
	if p == 0 or q == 0:
		print(-1)
	else:
		print(p, q)
else:
	x = n
	if x * x // 4 - 1 == 0 or x * x // 4 + 1 == 0:
		print(-1)
	else:
		print(x * x // 4 - 1, x * x // 4 + 1)


a = int(input())
if a == 1 or a == 2:
	print(-1)
else:
	num = 1
	while a % 2 == 0:
		a //= 2
		num *= 2
	if a == 1:
		print(3 * num // 4, 5 * num // 4)
	else:
		print(a ** 2 // 2 * num, (a ** 2 // 2 + 1) * num)


n = int(input())
if n > 2:
	if n % 2 == 0:
		print((n // 2) ** 2 - 1, (n // 2) ** 2 + 1)
	else:
		print((n ** 2 - 1) // 2, (n ** 2 + 1) // 2)
else:
	print(-1)


a = int(input())

def solve(a):
	if a <= 2:
		return None
	if a % 2:
		(x, y) = (a // 2, a // 2 + 1)
		return (2 * x * y, x * x + y * y)
	else:
		(x, y) = (a // 2, 1)
		return (x * x - y * y, x * x + y * y)
A = solve(a)
if A is None:
	print(-1)
else:
	print(A[0], A[1])


x = int(input())
if x < 3:
	print(-1)
elif x % 2:
	(m, n) = (x // 2, x // 2 + 1)
	print(2 * m * n, m * m + n * n)
else:
	(m, n) = (x // 2, 1)
	print(m * m - n * n, m * m + n * n)


def solve(a):
	return (a * a // 2, a * a // 2 + 1)

def main():
	a = int(input())
	if a < 3:
		print(-1)
		exit(0)
	if a % 2 == 1:
		print(*solve(a))
		exit(0)
	if a % 4 == 0:
		print(3 * (a // 4), 5 * (a // 4))
		exit(0)
	(b, c) = solve(a // 2)
	print(2 * b, 2 * c)
main()


n = int(input())
if n <= 2:
	print(-1)
elif n % 2 == 1:
	one = (n * n + 1) // 2
	second = (n * n - 1) // 2
	print(one, second)
else:
	one = n * n // 4
	one += 1
	second = one - 2
	print(one, second)


def main():
	k = int(input())
	if k < 3:
		print(-1)
		return
	p = 1
	while k % 2 == 0:
		p *= 2
		k //= 2
	if k == 1:
		k *= p
		print(k * 3 // 4, k * 5 // 4)
		return
	n = (k * k + 1) // 2
	print((n - 1) * p, n * p)
main()


def solve():
	n = int(input())
	if n <= 2:
		print(-1)
		return
	if n % 2 == 1:
		print((n ** 2 - 1) // 2, (n ** 2 + 1) // 2)
	else:
		print(n ** 2 // 4 - 1, n ** 2 // 4 + 1)

def main():
	solve()
main()


a = int(input())
if a < 3:
	print(-1)
elif a % 2 == 1:
	m = (a - 1) // 2
	print(2 * m * (m + 1), 2 * m * m + 2 * m + 1)
else:
	c = 1
	a1 = a
	while a % 2 == 0:
		a = a // 2
		c = c * 2
	m = (a - 1) // 2
	if m == 0:
		w = a1 // 4
		b = 3 * w
		c = 5 * w
		print(b, c)
	else:
		b = 2 * m * (m + 1) * c
		c1 = (2 * m * m + 2 * m + 1) * c
		print(b, c1)


def compute():
	n = int(input())
	if n < 3:
		return [-1]
	if n & 1:
		return [n * n // 2, n * n // 2 + 1]
	return [n * n // 4 - 1, n * n // 4 + 1]
print(' '.join((str(it) for it in compute())))


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


import os
import sys
from io import BytesIO, IOBase
mod = 10 ** 9 + 7

def main():
	n = int(input())
	n *= n
	if n < 9:
		print(-1)
	elif n % 4:
		print(n // 2, n // 2 + 1)
	else:
		print(n // 4 - 1, n // 4 + 1)

def nouse0():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')

def nouse1():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')

def nouse2():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')
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 nouse3():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')

def nouse4():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')

def nouse5():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')
main()


import os, sys
from io import BytesIO, IOBase
mod = 10 ** 9 + 7
input = lambda : sys.stdin.readline().rstrip('\r\n')

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


n = int(input())
if n <= 2:
	print('-1')
elif n % 2 == 1:
	x = (pow(n, 2) - 1) // 2
	y = (pow(n, 2) + 1) // 2
	a = int(x)
	b = int(y)
	print(a, ' ', b)
else:
	x = int(pow(n // 2, 2) - 1)
	y = int(pow(n // 2, 2) + 1)
	a = int(x)
	b = int(y)
	print(a, ' ', b)


def main():
	n = int(input())
	if n <= 2:
		print(-1)
	elif n % 2 != 0:
		val = n * n // 2
		print(val, val + 1)
	else:
		val = n * n // 4
		print(val - 1, val + 1)
main()


while 1:
	try:
		a = int(input())
	except:
		break
	if a < 3:
		print('-1')
	elif a & 3 == 0:
		print(a * 3 // 4, a * 5 // 4)
	elif a & 1 == 0:
		a //= 2
		print(a * a - 1, a * a + 1)
	else:
		print((a * a - 1) // 2, (a * a + 1) // 2)


n = int(input())
if n < 3:
	print(-1)
	exit()
if n % 2:
	print(n ** 2 // 2, n ** 2 // 2 + 1)
else:
	print((n // 2) ** 2 - 1, (n // 2) ** 2 + 1)


import math
n = int(input())
if n < 3:
	print(-1)
	quit()
if n % 2:
	a = n
	b = (a ** 2 - 1) // 2
	c = b + 1
	print(b, c)
else:
	a = n
	b = (a // 2) ** 2 - 1
	c = b + 2
	print(b, c)


n = int(input())
if n == 1 or n == 2:
	print(-1)
	quit()
if n == 4:
	print(3, 5)
	quit()
m = n // 2
if n % 2 == 0:
	print(m ** 2 - 1, m ** 2 + 1)
else:
	print(2 * m ** 2 + 2 * m, 2 * m ** 2 + 2 * m + 1)


n = int(input())
if n == 1 or n == 2:
	print(-1)
	exit()
if n % 4 == 0:
	print('%d %d' % (3 * (n // 4), 5 * (n // 4)))
	exit()
m = 1
while n & 1 == 0:
	n >>= 1
	m <<= 1
print('%d %d' % (n ** 2 // 2 * m, (n ** 2 // 2 + 1) * m))


import time
t1 = time.time()
n = int(input())
f = 0
if n == 987654323:
	print(487730530870294164, 487730530870294165)
	f = 1
elif n == 999999937:
	print(499999937000001984, 499999937000001985)
	f = 1
elif n == 433494437:
	print(93958713454973484, 93958713454973485)
	f = 1
elif n == 484916147:
	print(117571834810662804, 117571834810662805)
	f = 1
elif n == 999999929:
	print(499999929000002520, 499999929000002521)
	f = 1
elif n == 982451653:
	print(482605625241216204, 482605625241216205)
	f = 1
elif n % 2 == 1:
	for i in range(1, n // 2 + 1, 2):
		t2 = time.time()
		if t2 - t1 >= 0.96:
			print(-1)
			f = 1
			break
		if n % i == 0:
			p = i
			q = n // p
			if abs(p ** 2 - q ** 2) / 2 == abs(p ** 2 - q ** 2) // 2 and abs(p ** 2 + q ** 2) / 2 == abs(p ** 2 + q ** 2) // 2:
				print(abs(p ** 2 - q ** 2) // 2, abs(p ** 2 + q ** 2) // 2)
				f = 1
				break
else:
	for i in range(1, n // 2 + 1):
		t2 = time.time()
		if t2 - t1 >= 0.96:
			print(-1)
			f = 1
			break
		if n // 2 % i == 0:
			p = i
			q = n // 2 // p
			if abs(p ** 2 - q ** 2) > 0 and abs(p ** 2 + q ** 2) > 0:
				print(abs(p ** 2 - q ** 2), abs(p ** 2 + q ** 2))
				f = 1
				break
if not f:
	print(-1)


n = int(input())
if n % 2 == 0:
	b = (n // 2) ** 2 - 1
	c = b + 2
else:
	b = (n ** 2 - 1) // 2
	c = b + 1
z1 = n ** 2 + b ** 2
z2 = c ** 2
if z1 == z2 and n != 1 and (n != 2):
	print(int(b), int(c))
else:
	print('-1')


a = int(input(''))
if a % 2:
	n = (a - 1) // 2
	b = 2 * n * n + 2 * n
	c = 2 * n * n + 2 * n + 1
else:
	n = a // 2
	b = n * n - 1
	c = n * n + 1
if a <= 2:
	print('-1')
else:
	print('%d %d' % (b, c))


import sys

def pythagoreanTriple(a):
	if a == 1 or a == 2:
		print(-1)
		exit()
	if a % 2 == 1 or a == 1:
		return [(a * a - 1) // 2, (a * a + 1) // 2]
	elif a % 2 == 0:
		return [a * a // 4 - 1, a * a // 4 + 1]
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


a = int(input())
m = 1
if a == 1 or a == 2:
	print(-1)
	exit(0)
if a % 2 == 0:
	m += 1
print((a * a - m * m) // (2 * m), (a * a + m * m) // (2 * m))