A = int(input()) edge = [] edge.append((1,39 + 2)) edge.append((1,40 + 2)) for i in range(2,38 + 2): edge.append((i,i+1)) edge.append((38 + 2,128)) for i in range(39 + 2,39 + 2 + 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: if k < 39: edge.append((39 + 2 + k * 2,k + 2)) else: edge.append((39 + 2 + 2 * k,128)) print(128,len(edge)) for a,b in edge: print(a,b)