K = input() if K == 0: print 2, 0 exit() ans = [] for i in xrange(32): ans.append((i, i+1)) for i in xrange(30, -1, -1): if K == 0: break if K % 2 == 0: for j in xrange(i+2, 32): ans.append((i, j)) K /= 2 else: ans.append((i, 31)) K -= 1 print 32, len(ans) for a in ans: print a[0]+1, a[1]+1