A Pythagorean triple consists of three positive integers $\boldsymbol{a}$, $\boldsymbol{b}$, and $\textbf{c}$, such that $a^2+b^2=c^2$. Such a triple is commonly written as $(a,b,c)$. This term comes from the Pythagorean theorem, which says that a Pythagorean Triple will be the lengths of the sides of a right-angled triangle.  

You have been given an integer $\boldsymbol{a}$ which represents the length of one of cathetus of a right-angle triangle.  

You need to find the lengths of the remaining sides. There may be multiple possible answers; any one will be accepted.

Hints: 

Every odd number $2k+1$ can be represented as $(k+1)^2-k^2$.  
If $m$ and $n$ are integers and $m>n$, then $(m^2-n^2)^2+(2mn)^2=(m^2+n^2)^2$. 

Input Format

The first line contains an integer $\boldsymbol{a}$ denoting the length of one of cathetus of the right-angled triangle.  

Constraints

$5\leq a<10^9$

Output Format

A single line containing the possible values of $\boldsymbol{a}$, $\boldsymbol{b}$ and $\textbf{c}$. You may print them in any order. 

Sample Input 0
5

Sample Output 0
5 12 13

Explanation 0

We can see that the triple $(5,12,13)$ is a pythagorean triple: 

$5^2+12^2=13^2$

Difficulty: EASY
Tags: Matrices

Starter code:

Solutions:
import sys

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


import sys

def pythagoreanTriple(a):
	if a % 2 == 1:
		k = a // 2
		m = k + 1
		n = k
		return (m ** 2 - n ** 2, 2 * m * n, m ** 2 + n ** 2)
	else:
		mn = a // 2
		m = mn
		n = 1
		return (m ** 2 - n ** 2, 2 * m * n, m ** 2 + n ** 2)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a % 2 == 1:
		a2 = a ** 2
		k = (a2 - 1) // 2
		return (a, k, k + 1)
	m = a // 2
	n = 1
	return (m ** 2 - n ** 2, 2 * m * n, m ** 2 + n ** 2)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	a2 = a ** 2
	if a % 2 != 0:
		b = (a ** 2 - 1) // 2
		c = b + 1
	else:
		m = a // 2
		b = m ** 2 - 1
		c = m ** 2 + 1
	return [a, b, c]
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


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


import sys

def pythagoreanTriple(a):
	if a % 2 == 0:
		m = a // 2
		return (a, m ** 2 - 1, m ** 2 + 1)
	k = (a - 1) // 2
	return (a, 2 * (k + 1) * k, (k + 1) ** 2 + k ** 2)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a % 2 == 1:
		k = a // 2
		m = k + 1
		n = k
		return (a, 2 * m * n, m ** 2 + n ** 2)
	else:
		k = a // 2
		m = k
		n = 1
		return (m ** 2 - n ** 2, a, m ** 2 + n ** 2)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


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


import sys

def pythagoreanTriple(a):
	if a % 2:
		b = (a ** 2 - 1) // 2
		c = b + 1
	else:
		b = (a // 2) ** 2 - 1
		c = b + 2
	return (a, b, c)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a % 2 == 0:
		m = a // 2
		b = m * m - 1
		c = m * m + 1
		return (a, b, c)
	else:
		k = a // 2
		m = k + 1
		n = k
		b = 2 * m * n
		c = m * m + n * n
		return (a, b, c)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a & 1:
		m = a // 2 + 1
		n = a // 2
	else:
		m = a // 2
		n = 1
	return (m ** 2 - n ** 2, 2 * m * n, m ** 2 + n ** 2)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a % 2 == 1:
		k = (a * a - 1) // 2
		return (a, k, k + 1)
	else:
		(n, m) = (1, a // 2)
		return (m * m - n * n, a, m * m + n * n)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


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


import sys
from math import floor, sqrt

def pythagoreanTriple(a):
	if a % 2 == 1:
		return (a, (a ** 2 - 1) // 2, (a ** 2 + 1) // 2)
	m = a // 2
	return (m ** 2 - 1, a, m ** 2 + 1)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	t = 1
	while a % 2 == 0:
		a //= 2
		t *= 2
	if a is 1:
		(a, b, c) = (t // 4 * 3, t, t // 4 * 5)
		return (a, b, c)
	else:
		_a = a * a
		(b, c) = ((_a - 1) // 2, (_a + 1) // 2)
	return (a * t, b * t, c * t)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


def pythagoreanTriple(a):
	if a % 2 == 0:
		m = a // 2
		n = 1
	else:
		n = (a - 1) // 2
		m = n + 1
	return (m * m - n * n, 2 * m * n, m * m + n * n)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

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


import sys

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


import sys

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


import sys

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


import sys

def pythagoreanTriple(a):
	if a % 2 == 1:
		return (a, a * a // 2, a * a // 2 + 1)
	else:
		m = a // 2
		return (a, m * m - 1, m * m + 1)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

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


import sys

def pythagoreanTriple(a):
	if a % 2 == 0:
		m = a // 2
		n = 1
		return [a, m ** 2 - n ** 2, m ** 2 + n ** 2]
	else:
		k = a ** 2 - 1
		k = k // 2
		return [a, k, k + 1]
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

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


import sys

def pythagoreanTriple(a):
	if a % 2 == 0:
		m = a // 2
		b = m ** 2 - 1
		c = m ** 2 + 1
	else:
		k = (a - 1) // 2
		b = 2 * k * (k + 1)
		c = k ** 2 + (k + 1) ** 2
	print(a, b, c)
a = int(input().strip())
pythagoreanTriple(a)


import sys

def pythagoreanTriple(a):
	if a & 1:
		k = (a - 1) // 2
		(m, n) = (k + 1, k)
	else:
		(m, n) = (a // 2, 1)
	return (m * m - n * n, 2 * m * n, m * m + n * n)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a % 2 == 0:
		b = (a // 2) ** 2 - 1
		c = b + 2
	else:
		b = (a ** 2 - 1) // 2
		c = b + 1
	return (a, b, c)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a & 1:
		return (a, (a * a - 1) // 2, (a * a + 1) // 2)
	return (a, a * a // 4 - 1, a * a // 4 + 1)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	b = 0
	c = 0
	if a % 2 == 0:
		m = a // 2
		b = m * m - 1
		c = m * m + 1
	else:
		k = (a - 1) // 2
		b = 2 * k * (k + 1)
		c = (k + 1) * (k + 1) + k * k
	return [a, b, c]
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


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


import sys

def pythagoreanTriple(a):
	if a % 2 == 0:
		return (a, (a // 2) ** 2 - 1, (a // 2) ** 2 + 1)
	else:
		k = (a - 1) // 2
		return (a, 2 * (k + 1) * k, (k + 1) ** 2 + k ** 2)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

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


import sys

def pythagoreanTriple(a):
	b = c = 0
	if a % 2 == 1:
		k = pow(a, 2) // 2
		b = k
		c = k + 1
	elif a > 2:
		n = 1
		m = a // 2
		b = pow(m, 2) - pow(n, 2)
		c = pow(m, 2) + pow(n, 2)
	return (a, b, c)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a % 2 == 1:
		k = (a * a - 1) // 2
		return (k, a, k + 1)
	m = a // 2
	n = 1
	return (m * m - n * n, a, m * m + n * n)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a % 2 == 0:
		if a % 4 == 0:
			mu = a // 4
			return (a, 3 * mu, 5 * mu)
		if a % 3 == 0:
			mu = a // 3
			return (a, 4 * mu, 5 * mu)
		if a % 5 == 0:
			mu = a // 5
			return (a, 3 * mu, 4 * mu)
		(p, q, r) = pythagoreanTriple(a // 2)
		return (p * 2, q * 2, r * 2)
	else:
		k = a // 2
		m = k + 1
		n = k
		return (a, 2 * m * n, m * m + n * n)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a % 2 == 1:
		k = (a - 1) // 2
		x = 2 * (k + 1) * k
		y = (k + 1) ** 2 + k ** 2
	else:
		x = (a ** 2 - 4) // 4
		y = x + 2
	return (a, x, y)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


def is_power_of_two(n):
	return n & n - 1 == 0
leg = int(input())
x = leg
count = 0
while x % 2 == 0:
	x //= 2
	count += 1
if is_power_of_two(leg):
	x = 3
	count -= 2
k = x // 2
(m, n) = (k + 1, k)
print(2 ** count * (m ** 2 - n ** 2), 2 ** count * (2 * m * n), 2 ** count * (m ** 2 + n ** 2))


import sys

def pythagoreanTriple(a):
	if a % 2 == 1:
		k = (a - 1) // 2
		m = k + 1
		n = k
		return (a, int(2 * m * n), int(m * m + n * n))
	else:
		n = 1
		m = a // 2
		return (a, int(m * m - n * n), int(m * m + n * n))
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


a = int(input())
if a & 1:
	k = (a - 1) // 2
	m = k
	n = k + 1
	print(a, 2 * m * n, m ** 2 + n ** 2)
else:
	b = (a // 2) ** 2 - 1
	print(a, b, b + 2)


a = int(input())
t = 1
while not a & 1:
	t <<= 1
	a >>= 1
if a == 1:
	s = t // 4
	print(3 * s, 4 * s, 5 * s)
else:
	k = (a - 1) // 2
	b = 2 * (k + 1) * k
	c = (k + 1) * (k + 1) + k * k
	print(a * t, b * t, c * t)


import sys

def pythagoreanTriple(a):
	if a % 2 == 0:
		m = a // 2
		return (2 * m, m ** 2 - 1, m ** 2 + 1)
	k = (a - 1) // 2
	return (2 * k + 1, 2 * k * (k + 1), 2 * k ** 2 + 2 * k + 1)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


a = int(input())
twos = 1
while a % 2 == 0:
	if a == 4:
		break
	twos *= 2
	a //= 2
if a == 4:
	b = 3
	c = 5
else:
	k = (a * a - 1) // 2
	b = k
	c = k + 1
print(twos * a, twos * b, twos * c)
assert a ** 2 + b ** 2 == c ** 2


import sys
a = int(input().strip())
if a % 2 == 1:
	k = a // 2
	print(str(a) + ' ' + str((k + 1) ** 2 + k ** 2) + ' ' + str(2 * (k + 1) * k))
else:
	k = a // 2
	print(str(a) + ' ' + str(k ** 2 - 1) + ' ' + str(k ** 2 + 1))


from math import floor
import sys

def pythagoreanTriple(a):
	if a % 2 == 0:
		b = pythagoreanTriple(int(a / 2))
		for i in range(len(b)):
			b[i] = b[i] * 2
		return b
	else:
		if a == 1:
			return [3 / 4, 1, 5 / 4]
		d = floor(a / 2)
		return [a, 2 * d * (d + 1), pow(d, 2) + pow(d + 1, 2)]
a = int(input().strip())
triple = pythagoreanTriple(a)
triple = map(int, triple)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a % 2 == 0:
		b = (a // 2) ** 2 - 1
		c = b + 2
	else:
		b = (a ** 2 - 1) // 2
		c = b + 1
	return (a, b, c)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import math
a = int(input())
if a & 1:
	print(a, (a * a - 1) // 2, (a * a + 1) // 2)
else:
	print(a, (a // 2) ** 2 - 1, (a // 2) ** 2 + 1)


import sys

def pythagoreanTriple(a):
	if a % 2 == 0:
		k = a // 2
		print(a, k * k - 1, k * k + 1)
	else:
		k = a * a // 2
		print(k, a, k + 1)
a = int(input().strip())
pythagoreanTriple(a)


import sys

def pythagoreanTriple(a):
	if a % 2 == 1:
		m = int(a / 2) + 1
		n = int(a / 2)
		b = 2 * m * n
		c = m * m + n * n
		return str(a) + ' ' + str(b) + ' ' + str(c)
	else:
		n = 1
		m = int(a / 2)
		b = m * m - n * n
		c = m * m + n * n
		return str(a) + ' ' + str(b) + ' ' + str(c)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(triple)


import sys
a = int(input())
if a % 2 != 0:
	s = a * a
	d = s // 2
	print(a, int(d), int(d + 1))
else:
	s = a * a
	d = s // 4
	print(a, int(d - 1), int(d + 1))


import sys

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


import sys

def pythagoreanTriple(a):
	if a % 2 == 0:
		m = a // 2
		n = 1
		b = m * m - n * n
	else:
		n = (a - 1) // 2
		m = n + 1
		b = 2 * m * n
	c = m * m + n * n
	return [a, b, c]
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a % 2:
		k = (a - 1) // 2
		m = k + 1
		n = k
		return (a, 2 * m * n, m ** 2 + n ** 2)
	else:
		k = a // 2
		m = k
		n = 1
		return (a, m ** 2 - n ** 2, m ** 2 + n ** 2)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


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


import sys

def pythagoreanTriple(a):
	if a % 2:
		b = (a ** 2 - 1) // 2
		c = b + 1
	else:
		b = (a // 2) ** 2 - 1
		c = b + 2
	return [a, b, c]
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

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


import sys

def isSquare(a):
	n = a ** 0.5
	if n == int(a ** 0.5):
		return 1
	return 0

def square(a):
	return a ** 2
a = int(input().strip())
if a % 2 == 1:
	b = (square(a) - 1) // 2
	c = b + 1
else:
	b = square(a // 2) - 1
	c = b + 2
print(a, b, c)


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


import sys

def pythagoreanTriple(a):
	if a % 2 == 1:
		k = a // 2
		m = k + 1
		n = k
		print(str(a) + ' ' + str(2 * m * n) + ' ' + str(m ** 2 + n ** 2))
	else:
		m = a // 2
		n = 1
		print(str(m ** 2 - n ** 2) + ' ' + str(a) + ' ' + str(m ** 2 + n ** 2))
a = int(input().strip())
pythagoreanTriple(a)


import sys

def pythagoreanTriple(a):
	if a % 2 == 1:
		b = (pow(a, 2) - 1) // 2
		c = b + 1
	else:
		b = pow(a // 2, 2) - 1
		c = b + 2
	return (a, b, c)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a % 2 == 0:
		m_n = a // 2
		(m, n) = (m_n, 1)
		return [a, m ** 2 - n ** 2, m ** 2 + n ** 2]
	else:
		k = (a - 1) // 2
		(m, n) = (k + 1, k)
		return [a, 2 * m * n, m ** 2 + n ** 2]
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	k = 0
	m = 0
	n = 0
	while a % 2 == 0:
		k += 1
		a //= 2
	if a == 1:
		m = 2 ** (k - 1)
		n = 1
		return (m * m - n * n, 2 * m * n, m * m + n * n)
	else:
		m = a // 2 + 1
		n = a // 2
		return ((m * m - n * n) * 2 ** k, 2 * m * n * 2 ** k, (m * m + n * n) * 2 ** k)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a % 2 == 1:
		k = (a - 1) // 2
		a2 = 2 * k * (k + 1)
		a3 = k ** 2 + (k + 1) ** 2
		return [a, a2, a3]
	count = 0
	while not a & 1:
		count += 1
		a = a >> 1
	if a == 1:
		m = 2 ** (count - 1)
		a2 = m ** 2 - 1
		a3 = a2 + 2
		return [2 * m, a2, a3]
	tempans = pythagoreanTriple(a)
	ans = [2 ** count * num for num in tempans]
	return ans
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a % 2 == 0:
		m = a // 2
		b = m ** 2 - 1
		c = m ** 2 + 1
		return [a, b, c]
	else:
		k = a // 2
		b = 2 * k * (k + 1)
		c = (k + 1) ** 2 + k ** 2
		return [a, b, c]
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


a = int(input())
if a & 1 == 0:
	b = (a >> 1) ** 2 - 1
else:
	b = a ** 2 - 1 >> 1
print(a, b, b + 1 + int(a & 1 == 0))


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


def pythagoreanTriple(a):
	if a % 2 == 1:
		b = (a ** 2 - 1) // 2
		c = (a ** 2 + 1) // 2
	else:
		b = (a // 2) ** 2 - 1
		c = (a // 2) ** 2 + 1
	return (a, b, c)
a = int(input())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a % 2 == 1:
		k = a // 2
		b = 2 * k * (k + 1)
		c = 2 * k * k + 2 * k + 1
	else:
		k = a // 2
		b = k ** 2 - 1
		c = k ** 2 + 1
	return (a, b, c)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a % 2 == 1:
		k = (a ** 2 - 1) // 2
		return (a, k, k + 1)
	m = a // 2
	return (a, m ** 2 - 1, m ** 2 + 1)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

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


import sys

def pythagoreanTriple(a):
	aa = a
	mm = 1
	while aa % 2 == 0:
		if aa == 4:
			return [mm * 4, mm * 3, mm * 5]
		aa //= 2
		mm *= 2
	k = aa // 2
	m = k + 1
	n = k
	return [mm * (m * m - n * n), mm * 2 * m * n, mm * (m * m + n * n)]
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys
a = int(input().strip())
if a % 2 == 0:
	m = 1
	n = int(a / 2)
	print(str(n ** 2 - 1) + ' ' + str(a) + ' ' + str(n ** 2 + 1))
else:
	m = int((a + 1) / 2)
	n = m - 1
	print(str(a) + ' ' + str(2 * m * n) + ' ' + str(m ** 2 + n ** 2))


import sys
import math

def pythagoreanTriple(a):
	b = 0
	h = 0
	if a % 2 != 0:
		b = (a ** 2 - 1) // 2
		h = b + 1
	else:
		b = (a // 2) ** 2 - 1
		h = b + 2
	return (a, b, h)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


def pythagoreanTriple(a):
	multiplier = 1
	while a % 2 == 0:
		a >>= 1
		multiplier <<= 1
	if a == 1:
		multiplier >>= 2
		base = [3, 4, 5]
	else:
		k = (a + 1) // 2
		base = [k ** 2 - (k - 1) ** 2, 2 * k * (k - 1), k ** 2 + (k - 1) ** 2]
	return [multiplier * x for x in base]
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a % 2 == 0:
		m = a // 2
		n = 1
		b = m * m - n * n
	else:
		k = (a - 1) // 2
		m = k + 1
		n = k
		b = 2 * m * n
	c = m * m + n * n
	return (a, b, c)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys
import math

def pythagoreanTriple(a):
	if a % 2 == 0:
		b = (a * a >> 2) - 1
		c = (a * a >> 2) + 1
		return (a, b, c)
	else:
		b = a * a >> 1
		c = (a * a >> 1) + 1
		return (a, b, c)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a % 2 == 1:
		k = (a - 1) // 2
		m = k + 1
		n = k
		b = 2 * m * n
	else:
		k = a // 2
		m = k
		n = 1
		b = k * k - 1
	c = m * m + n * n
	return [a, b, c]
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	result = [a]
	if a % 2 == 0:
		m = a // 2
		n = 1
		result.append(m ** 2 - n ** 2)
		result.append(m ** 2 + n ** 2)
		return result
	else:
		n = (a - 1) // 2
		result.append(2 * (n + 1) * n)
		result.append((n + 1) ** 2 + n ** 2)
		return result
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	r = 1
	if a % 2 == 1:
		k = int((a - 1) / 2)
		a1 = r * 2 * (k + 1) * k
		a2 = r * (k + 1) ** 2 + k ** 2
		return (a, a1, a2)
	else:
		k = int(a / 2)
		a1 = k ** 2 - 1
		a2 = k ** 2 + 1
		return (a, a1, a2)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a == 4:
		return (3, 4, 5)
	if a % 2 == 1:
		n = (a - 1) // 2
		m = n + 1
		ms = m * m
		ns = n * n
		return (ms - ns, 2 * m * n, ms + ns)
	return (2 * v for v in pythagoreanTriple(a // 2))
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


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


import sys

def pythagoreanTriple(a):
	if a % 2 == 1:
		k = (a - 1) // 2
		b = 2 * (k ** 2 + k)
		c = 2 * (k ** 2 + k) + 1
	else:
		m = a // 2
		b = m ** 2 - 1
		c = m ** 2 + 1
	return (a, b, c)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a % 2 == 1:
		k = int(a / 2)
		(m, n) = (k + 1, k)
		b = 2 * m * n
		c = m ** 2 + n ** 2
	else:
		(m, n) = (int(a / 2), 1)
		b = int(m ** 2 - n ** 2)
		c = int(m ** 2 + n ** 2)
	return (a, b, c)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


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


import sys

def pythagoreanTriple(a):
	if a % 2 == 1:
		l = (a ** 2 - 1) // 2
		return (a, l, l + 1)
	else:
		m = a // 2
		return (a, m ** 2 - 1, m ** 2 + 1)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a % 2 != 0:
		k = a // 2
		m = k + 1
		n = k
	else:
		m = a // 2
		n = 1
	return [m ** 2 - n ** 2, 2 * m * n, m ** 2 + n ** 2]
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


a = int(input())
if a % 2 == 1:
	k = (a ** 2 - 1) // 2
	print(a, k, k + 1)
else:
	z = (a // 2) ** 2
	print(a, z - 1, z + 1)


import sys

def pythagoreanTriple(a):
	b = 0
	c = 0
	if a % 2 == 0:
		b = pow(a // 2, 2) - 1
		c = b + 2
	else:
		b = (pow(a, 2) - 1) // 2
		c = b + 1
	return (a, int(b), int(c))
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

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


a = int(input().strip())
o = a
e = 1
while o % 2 == 0:
	o //= 2
	e *= 2
k = o // 2
if o > 1:
	print(e * (2 * k + 1), e * (2 * k * (k + 1)), e * (k * k + (k + 1) * (k + 1)))
else:
	c = a // 4
	print(c * 3, c * 4, c * 5)


import sys

def pythagoreanTriple(a):
	if a == 4:
		return (4, 3, 5)
	elif a % 2 == 1:
		k = a ** 2
		b = (k - 1) // 2
		c = (k + 1) // 2
		return (a, b, c)
	else:
		(d, e, f) = pythagoreanTriple(a // 2)
		return (2 * d, 2 * e, 2 * f)
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	if a % 2 == 1:
		a //= 2
		return [(a + 1) * (a + 1) - a * a, 2 * a * (a + 1), a * a + (a + 1) * (a + 1)]
	else:
		n = 1
		m = a // 2
		return [m * m - n * n, 2 * m * n, m * m + n * n]
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


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


a = int(input())
if a % 2 != 0:
	k = (a ** 2 - 1) // 2
	print(a, k, k + 1, sep=' ')
else:
	m = a // 2
	n = 1
	b = m ** 2 - 1
	c = m ** 2 + 1
	print(a, b, c, sep=' ')


import sys

def pythagoreanTriple(a):
	d = a
	a = a * a
	if a % 2 == 1:
		b = a // 2
		c = b + 1
		print(d, b, c)
	else:
		if a % 4 == 0:
			k = a // 4
			b = k - 1
			c = k + 1
		print(d, b, c)
a = int(input().strip())
pythagoreanTriple(a)


import sys
import math

def pythagoreanTriple(a):
	if a * a % 2 == 1:
		temp = a * a // 2
		b = temp
		c = temp + 1
	else:
		temp = a * a // 4
		b = temp - 1
		c = temp + 1
	return [a, b, c]
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))


import sys
from math import sqrt as s

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


import sys

def pythagoreanTriple(a):
	if a % 2 == 1:
		k = (a - 1) // 2
		n = 2 * k * (k + 1)
		m = int((a ** 2 + n ** 2) ** 0.5) - min([k, 50])
		while m ** 2 < n ** 2 + a ** 2:
			m += 1
		return (a, n, m)
	elif a % 4 == 0:
		b = a // 4
		return (a, b * 3, b * 5)
	else:
		k = (a // 2 - 1) // 2
		n = 2 * k * (k + 1)
		m = int((a ** 2 + (2 * n) ** 2) ** 0.5) - min([k, 50])
		while m ** 2 < (2 * n) ** 2 + a ** 2:
			m += 1
		return (a, 2 * n, m)
for i in range(1):
	a = int(input().strip())
	triple = pythagoreanTriple(a)
	print(' '.join(map(str, triple)))


import sys

def pythagoreanTriple(a):
	a2 = a * a
	if a % 2 == 1:
		k = a2 // 2
		return [a, k, k + 1]
	else:
		mn = a2 // 4
		return [a, mn - 1, mn + 1]
a = int(input().strip())
triple = pythagoreanTriple(a)
print(' '.join(map(str, triple)))