mod = 998244353 def main(): import sys input = sys.stdin.readline A = int(input()) #if A == 0: # print(2, 0) # exit() L = 40 N = 122 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 * 3 + 2].append(l * 3 + 5) adj[l * 3 + 2].append(l * 3 + 6) adj[l * 3 + 3].append(l * 3 + 5) adj[l * 3 + 3].append(l * 3 + 6) adj[l * 3 + 4].append(l * 3 + 7) adj[N - 1].append(N) for lv in range(L): if A >> lv & 1: v = lv * 3 + 2 u = v + 5 if u > N: u = N 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()