'''
dict的复杂度大都在O(1)
'''
import math
import sys
n = int(input())
mx = int(math.sqrt(n)) + 2
key = {}
for c in range(mx):
for d in range(mx):
key[c**2 + d**2] = c
for a in range(mx):
for b in range(mx):
left = n - a**2 - b**2
c = key.get(left, -1)
if c != -1:
d = int(math.sqrt(left - c ** 2))
a, b, c, d = sorted([a, b, c, d])
print(a, b, c, d)
sys.exit()