K = int(input()) N = K memo = [] while N: N, m = divmod(N, 2) memo.append(m) memo.reverse() n = len(memo) + 2 m = n * (n - 1) // 2 edge = [] for i, v in enumerate(memo, 2): if v: edge.append((1, i)) for i in range(2, n): for j in range(i + 1, n + 1): edge.append((i, j)) print(n, m) for s, t in edge: print(s, t)