import math import statistics
n = float(input()) for i in range(1000): for j in range(i+1): if i*(i+1)/2 - 3*j == n: print("%d %d"%(j,i)) exit()