import sys input = lambda : sys.stdin.readline().rstrip() write = lambda x: sys.stdout.write(x+"\n"); writef = lambda x: print("{:.12f}".format(x)) debug = lambda x: sys.stderr.write(x+"\n") YES="Yes"; NO="No"; pans = lambda v: print(YES if v else NO) LI = lambda : list(map(int, input().split())) def dlist(*l, fill=0): if len(l)==1: return [fill]*l[0] ll = l[1:] return [dlist(*ll, fill=fill) for _ in range(l[0])] sys.setrecursionlimit(3*10**5+10) N = int(input()) def main(N): s = 0 m = 40 t = 3*m+1 uv = [] p = [0] for i in range(m): c = [3*i+1, 3*i+2, 3*i+3] for u in p[:2]: for v in c[:2]: uv.append((u,v)) if i>0: uv.append((p[-1], c[-1])) p = c uv.append((3*m,t)) for i in range(40): if N>>i&1: if i+1v: u,v = v,u ns[v].append(u) dp[0] = 1 for u in range(n): for v in ns[u]: dp[u] += dp[v] assert dp[n-1]==N check() return uv uv = main(N) print(3*m+2, len(uv)) for u,v in uv: print(u+1,v+1)