#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i, n;
  scanf("%d", &n);
  printf("%d %d %d\n", 1, 1, n);
  for (i = 1; i <= n; i++) {
    printf("%d %d %d\n", 1, i % 2 ? (i + 1) / 2 : n - (i - 1) / 2, i);
  }
  for (i = 1; i <= n; i++) {
    printf("%d \n", 2);
  }
  printf("\n %d \n", 8);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%ecx
lea    0xeba(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11d9 <main+0xb9>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1194 <main+0x74>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
jmp    11b2 <main+0x92>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xe44(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115e <main+0x3e>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     120d <main+0xed>
lea    0xe1c(%rip),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11e0 <main+0xc0>
lea    0xdf9(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ecx
lea    0xebf(%rip),%rdi
mov    $0x1,%ebx
mov    $0x1,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%edx
test   %edx,%edx
jle    11d8 <main+0xb8>
lea    0xe9a(%rip),%r14
jmp    119d <main+0x7d>
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rbx),%eax
shr    $0x1f,%eax
add    %ebx,%eax
add    $0xffffffff,%eax
sar    %eax
sub    %eax,%edx
lea    0x1(%rbx),%ebp
mov    %r14,%rdi
mov    $0x1,%esi
mov    %ebx,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%edx
cmp    %edx,%ebx
mov    %ebp,%ebx
jge    11ab <main+0x8b>
test   $0x1,%bl
je     1170 <main+0x50>
lea    0x1(%rbx),%ebp
mov    %ebp,%edx
shr    %edx
jmp    1182 <main+0x62>
test   %edx,%edx
jle    11d8 <main+0xb8>
lea    0xe59(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jl     11c0 <main+0xa0>
lea    0xe2e(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"%d %d %d\0A\00"
@.str.2 = [5 x i8] c"%d \0A\00"
@.str.3 = [7 x i8] c"\0A %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = load i32, i32* %3
%6 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 1, i32 %5)
store i32 1, i32* %2
br label %7
7: ; preds = %29, %0
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %32
11: ; preds = %7
%12 = load i32, i32* %2
%13 = srem i32 %12, 2
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
%18 = sdiv i32 %17, 2
br label %25
19: ; preds = %11
%20 = load i32, i32* %3
%21 = load i32, i32* %2
%22 = sub nsw i32 %21, 1
%23 = sdiv i32 %22, 2
%24 = sub nsw i32 %20, %23
br label %25
25: ; preds = %19, %15
%26 = phi i32 [ %18, %15 ], [ %24, %19 ]
%27 = load i32, i32* %2
%28 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 %26, i32 %27)
br label %29
29: ; preds = %25
%30 = load i32, i32* %2
%31 = add nsw i32 %30, 1
store i32 %31, i32* %2
br label %7
32: ; preds = %7
store i32 1, i32* %2
br label %33
33: ; preds = %39, %32
%34 = load i32, i32* %2
%35 = load i32, i32* %3
%36 = icmp sle i32 %34, %35
br i1 %36, label %37, label %42
37: ; preds = %33
%38 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 2)
br label %39
39: ; preds = %37
%40 = load i32, i32* %2
%41 = add nsw i32 %40, 1
store i32 %41, i32* %2
br label %33
42: ; preds = %33
%43 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 8)
%44 = load i32, i32* %1
ret i32 %44
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"%d %d %d\0A\00"
@.str.2 = [5 x i8] c"%d \0A\00"
@.str.3 = [7 x i8] c"\0A %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 1, i32 %4)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 1
br i1 %7, label %35, label %10
8: ; preds = %23
%9 = icmp slt i32 %27, 1
br i1 %9, label %35, label %29
10: ; preds = %0, %23
%11 = phi i32 [ %27, %23 ], [ %6, %0 ]
%12 = phi i32 [ %24, %23 ], [ 1, %0 ]
%13 = and i32 %12, 1
%14 = icmp eq i32 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %10
%16 = add nuw nsw i32 %12, 1
%17 = lshr i32 %16, 1
br label %23
18: ; preds = %10
%19 = add nsw i32 %12, -1
%20 = sdiv i32 %19, -2
%21 = add i32 %20, %11
%22 = add nuw nsw i32 %12, 1
br label %23
23: ; preds = %18, %15
%24 = phi i32 [ %22, %18 ], [ %16, %15 ]
%25 = phi i32 [ %21, %18 ], [ %17, %15 ]
%26 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 %25, i32 %12)
%27 = load i32, i32* %1
%28 = icmp slt i32 %12, %27
br i1 %28, label %10, label %8
29: ; preds = %8, %29
%30 = phi i32 [ %32, %29 ], [ 1, %8 ]
%31 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 2)
%32 = add nuw nsw i32 %30, 1
%33 = load i32, i32* %1
%34 = icmp slt i32 %30, %33
br i1 %34, label %29, label %35
35: ; preds = %29, %0, %8
%36 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 8)
ret i32 0
}