K=int(input()) DP=[0]*32 DP[0]=1 SET=set() for i in range(32): for j in range(i+1,32): DP[j]+=DP[i] SET.add((i,j)) NOW=DP[-1] for j in range(30,-1,-1): if NOW-DP[j]>=K: NOW-=DP[j] SET.remove((j,31)) print(32,len(SET)) for x,y in SET: print(x+1,y+1)