import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = sc.nextInt(); ArrayList ans = new ArrayList<>(); for (int i = 1; i <= 30; i++) { for (int j = i + 1; j <= 31; j++) { ans.add(new Path(i, j)); } } for (int i = 29; i >= 0; i--) { if (k >= (1 << i)) { ans.add(new Path(i + 2, 32)); k -= (1 << i); } } StringBuilder sb = new StringBuilder(); sb.append("32 ").append(ans.size()).append("\n"); for (Path p : ans) { sb.append(p).append("\n"); } System.out.print(sb); } static class Path { int from; int to; public Path(int from, int to) { this.from = from; this.to = to; } public String toString() { return new StringBuilder().append(from).append(" ").append(to).toString(); } } }