A = int(input()) edge = [] edge.append((1,39)) edge.append((1,40)) for i in range(2,38): edge.append((i,i+1)) edge.append((38,128)) for i in range(39,39 + 2 * 39,2): edge.append((i,i+2)) if i + 3 < 40 + 2 * 39: edge.append((i,i+3)) edge.append((i+1,i+3)) edge.append((i+1,i+2)) for k in range(40): mask = 1 << k if A & mask: edge.append((39 + k,k + 2)) print(128,len(edge)) for a,b in edge: print(a,b)