n=int(input()) sum=0 i=1 while i!=0: sum+=i for j in range(1,i+1): if sum-3*j==n: print(j,i) break i+=1