#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 n, i, j, k;
  scanf("%d\n", &n);
  int a[n];
  for (i = 0; i <= n; i++) {
    scanf("%d ", &a[i]);
  }
  for (j = 1; j <= n; j++) {
    for (k = 1; k <= j; k++) {
      printf("%d\n", a[n - k]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11a2 <main+0x82>
mov    -0x30(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe75(%rip),%rdi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116d <main+0x4d>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1205 <main+0xe5>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11f2 <main+0xd2>
mov    -0x30(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    -0x14(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe21(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11bc <main+0x9c>
jmp    11f7 <main+0xd7>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11a9 <main+0x89>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xec8(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   1040 <scanf@plt>
mov    %rsp,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
mov    %rsp,%r12
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
cmpl   $0x0,-0x2c(%rbp)
js     1222 <main+0x102>
mov    $0xffffffffffffffff,%r15
lea    0xe8f(%rip),%r14
mov    %r12,%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movslq -0x2c(%rbp),%rax
add    $0x1,%r15
add    $0x4,%rbx
cmp    %rax,%r15
jl     1180 <main+0x60>
test   %eax,%eax
jle    1222 <main+0x102>
mov    $0x1,%ecx
mov    $0x2,%r14d
xor    %ebx,%ebx
lea    0xe48(%rip),%r13
jmp    11d6 <main+0xb6>
nopw   0x0(%rax,%rax,1)
mov    -0x40(%rbp),%rdx
lea    0x1(%rdx),%ecx
mov    -0x2c(%rbp),%eax
add    $0x1,%r14d
add    $0x1,%rbx
cmp    %eax,%edx
jge    1222 <main+0x102>
mov    %rcx,-0x40(%rbp)
cltq
mov    -0x4(%r12,%rax,4),%esi
mov    %r13,%rdi
call   1030 <printf@plt>
cmp    $0x2,%r14d
je     11c0 <main+0xa0>
mov    $0xfffffffffffffffe,%r15
cs nopw 0x0(%rax,%rax,1)
movslq -0x2c(%rbp),%rax
add    %r15,%rax
mov    (%r12,%rax,4),%esi
mov    %r13,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%r15
lea    (%r15,%rbx,1),%eax
cmp    $0xfffffffe,%eax
jne    1200 <main+0xe0>
jmp    11c0 <main+0xa0>
mov    -0x38(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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