mod = 998244353 def main(): import sys input = sys.stdin.readline A = int(input()) if A == 0: print(2, 0) exit() L = 40 N = 122 K = 83 adj = [[] for _ in range(N + 1)] adj[1].append(2) adj[1].append(3) adj[1].append(83) for l in range(L - 1): adj[l * 2 + 2].append(l * 2 + 4) adj[l * 2 + 2].append(l * 2 + 5) adj[l * 2 + 3].append(l * 2 + 4) adj[l * 2 + 3].append(l * 2 + 5) adj[K + l].append(K + l + 1) adj[N].append(K - 1) A -= 1 for lv in range(1, L): if A >> lv & 1: v = lv * 2 + 2 u = K + lv + 1 if u > N: u = K - 1 adj[v].append(u) M = 0 for v in range(1, N + 1): M += len(adj[v]) print(N, M) for v in range(1, N + 1): for u in adj[v]: print(v, u) if __name__ == '__main__': main()