def main(): import sys A = int(sys.stdin.readline()) if A == 0: print("2 0") elif A == 1: print("1 0") else: if A <= 126: N = A + 2 M = 2 * A print(N, M) # Add edges from 1 to each intermediate for i in range(2, A + 2): print(1, i) # Add edges from each intermediate to N for i in range(2, A + 2): print(i, A + 2) else: # For A > 126, we need another approach # Let's handle A as a product of factors, trying to fit within N=128 # Example: For A=127, we can have node 1 connected to 2-128, each connected to 128 # This gives 127 paths N = 128 # Number of intermediate nodes is 127 (from 2 to 128) # Each connected to 128 M = 127 + 127 # 127 edges from 1 and 127 edges to 128 print(N, M) # Add edges from 1 to 2-128 for i in range(2, 129): print(1, i) # Add edges from 2-127 to 128 (node 128 can't connect to itself) for i in range(2, 128): print(i, 128) if __name__ == "__main__": main()