from bisect import bisect_left v=[] i,n=1,1 v.append(0) v.append(n) while n<1e7: i+=1 n+=i v.append(n) while 1: try: n=int(input()) row=bisect_left(v,n) idx=row+n-v[row] print(f'TERM {n} IS ',end='') if row%2: print(f'{row+1-idx}/{idx}') else: print(f'{idx}/{row+1-idx}') except: break