#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*/ init_arr(int *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int arr[1000000 + 1];
  init_arr(arr);
  int cases;
  scanf("%d", &cases);
  int i, n;
  for (i = 0; i < cases; i++) {
    scanf("%d", &n);
    arr[n]++;
  }
  int j, cur_val;
  for (i = 0; i <= 1000000; i++) {
    cur_val = arr[i];
    for (j = 0; j < cur_val; j++) {
      printf("%d\n", i);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3d0930,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3d0910(%rbp),%rdi
call   1030 <init_arr@plt>
lea    0xeab(%rip),%rdi
lea    -0x3d0914(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x0,-0x3d0918(%rbp)
mov    -0x3d0918(%rbp),%eax
cmp    -0x3d0914(%rbp),%eax
jge    11bc <main+0x8c>
lea    0xe7c(%rip),%rdi
lea    -0x3d091c(%rbp),%rsi
call   1050 <scanf@plt>
movslq -0x3d091c(%rbp),%rax
mov    -0x3d0910(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x3d0910(%rbp,%rax,4)
mov    -0x3d0918(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3d0918(%rbp)
jmp    116b <main+0x3b>
movl   $0x0,-0x3d0918(%rbp)
cmpl   $0xf4240,-0x3d0918(%rbp)
jg     1245 <main+0x115>
movslq -0x3d0918(%rbp),%rax
mov    -0x3d0910(%rbp,%rax,4),%eax
mov    %eax,-0x3d0924(%rbp)
movl   $0x0,-0x3d0920(%rbp)
mov    -0x3d0920(%rbp),%eax
cmp    -0x3d0924(%rbp),%eax
jge    122c <main+0xfc>
mov    -0x3d0918(%rbp),%esi
lea    0xdf0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x3d0920(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3d0920(%rbp)
jmp    11f4 <main+0xc4>
jmp    1231 <main+0x101>
mov    -0x3d0918(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3d0918(%rbp)
jmp    11c6 <main+0x96>
xor    %eax,%eax
add    $0x3d0930,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x3d0920,%rsp
lea    0x10(%rsp),%rdi
call   1030 <init_arr@plt>
lea    0xeb4(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    118e <main+0x5e>
xor    %ebp,%ebp
lea    0xe9a(%rip),%r14
lea    0xc(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
movslq 0xc(%rsp),%rax
addl   $0x1,0x10(%rsp,%rax,4)
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jl     1170 <main+0x40>
xor    %ebx,%ebx
lea    0xe6c(%rip),%r14
jmp    11ad <main+0x7d>
nopl   0x0(%rax)
add    $0x1,%rbx
cmp    $0xf4241,%rbx
je     11d1 <main+0xa1>
mov    0x10(%rsp,%rbx,4),%ebp
test   %ebp,%ebp
jle    11a0 <main+0x70>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    11c0 <main+0x90>
jmp    11a0 <main+0x70>
xor    %eax,%eax
add    $0x3d0920,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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