def chick(a): flag = 0 arr = [] for i in range(a): for j in range(a): if 2 * i + j * 4 == a: flag = 1 k = i + j arr.append(k) #print("%d %d"%(i, j)) #print("%d %d"%(min(arr), max(arr))) if flag == 0: print("%d %d"%(0, 0)) else: print("%d %d"%(min(arr), max(arr))) while True: try: a = int(input()) chick(a) except: break