import sys input = lambda :sys.stdin.readline()[:-1] ni = lambda :int(input()) na = lambda :list(map(int,input().split())) yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES") no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO") ####################################################################### def f(b): ok = 0 ng = 10**10 while abs(ok-ng)>1: d = ok+ng>>1 if d*d <= 2*b*b: ok = d else: ng = d return ok def comp(p, q): if p[0] < q[0]: return -comp(q, p) if p[0] == q[0] and p[1] == q[1]: return 0 if p[1] > q[1]:return 1 if (p[0]-q[0])**2 < 2 * (p[1]-q[1])**2: return -1 return 1 n = ni() c = [] m = 2*10**5 for i in range(m): c.append(f(i)) d = [] s = 0 i = 0 j = 0 while i < m: while i < m and c[i] <= j: s += c[i] i += 1 #print(j, i, s) d.append(j * i - s) j += 1 for i in range(len(d)): if d[i] >= n: ans = i break #print(ans) p = [] b = 0 while True: a = ans - f(b) - 1 if a < 0: break p.append((a, b)) b += 1 from functools import cmp_to_key print(*sorted(p, key=cmp_to_key(comp))[n-d[ans]-1])