######################################## from heapq import heappush, heappop def dijkstra( G, s, INF=10 ** 18): """ https://tjkendev.github.io/procon-library/python/graph/dijkstra.html O((|E|+|V|)log|V|) V: 頂点数 G[v] = [(nod, cost)]: 頂点vから遷移可能な頂点(nod)とそのコスト(cost) s: 始点の頂点""" N=len(G) N+=1 dist = [INF] * N hp = [(0, s)] # (c, v) dist[s] = 0 cnt=[0]*N cnt[s]=1 while hp: c, v = heappop(hp) #vまで行くコストがc if dist[v] < c: continue for u, cost in G[v]: if dist[v] + cost < dist[u]: dist[u] = dist[v] + cost cnt[u]=cnt[v] heappush(hp, (dist[u], u)) elif dist[v]+cost==dist[u]: cnt[u]+=cnt[v] return dist,cnt ################################################## a=int(input()) if a==0: print(2,0) exit() if a==1: print(1,0) exit() if a==3: print(5,6) for i in range(2,5): print(1,i) print(i,5) exit() k=1 while 2**(k+1)<=a:k+=1 n=128 ans=[] root=[[] for i in range(n+1)] def add(u,v): ans.append((u,v)) root[u].append((v,1)) root[v].append((u,1)) add(1,2) add(1,3) for i in range(1,k): add(2*i,2*i+2) add(2*i,2*i+3) add(2 * i+1, 2 * i + 2) add(2 * i+1, 2 * i + 3) add(2*k,n) add(2*k+1,n) add(1,2*k+2) for i in range(1,k): add(2*k+i+1,2*k+i+2) a-=2**k for i in range(k,-1,-1): if a>=2**i: if i==k-1: add(1,126) add(1,127) add(126,4) add(127,4) else: add(2*k+k-i,2*(k-i)+1) a-=2**i print(n,len(ans)) for x,y in ans:print(x,y)