import java.io.*; import java.util.*; public class Main_yukicoder690 { private static Scanner sc; private static Printer pr; private static void solve() { int k = sc.nextInt(); if (k == 0) { pr.println("1 0"); return; } int n = 32; List d1 = new ArrayList<>(); List d2 = new ArrayList<>(); for (int i = 1; i < n - 1; i++) { for (int j = 0; j < i; j++) { d1.add(j); d2.add(i); } if ((k & 0x1 << (i - 1)) != 0) { d1.add(i); d2.add(n - 1); } } pr.printf("%d %d\n", n, d1.size()); for (int i = 0, size = d1.size(); i < size; i++) { pr.printf("%d %d\n", d1.get(i) + 1, d2.get(i) + 1); } } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes())); pr = new Printer(System.out); solve(); // pr.close(); pr.flush(); // sc.close(); } static String INPUT = null; private static class Printer extends PrintWriter { Printer(OutputStream out) { super(out); } } }