a = int(input()) m = 40 n = m+2*(m-1)+1 E = [] for i in range(m-1): E.append((i,m+2*i)) E.append((i,m+2*i+1)) E.append((m+2*i,i+1)) E.append((m+2*i+1,i+1)) for i in range(m): if a>>i&1: E.append((i,n-1)) print(n,len(E)) for a,b in E: print(a+1,b+1)