#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 */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int t;
  scanf("%d", &t);
  int *a = (int *)calloc(1000001, 4);
  int i;
  for (i = 0; i < t; i++) {
    int x;
    scanf("%d", &x);
    a[x]++;
  }
  for (i = 0; i < 1000001; i++) {
    while (a[i] > 0) {
      printf("%d\n", i);
      a[i]--;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    $0xf4241,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11a4 <main+0x74>
lea    0xe84(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1169 <main+0x39>
movl   $0x0,-0x14(%rbp)
cmpl   $0xf4241,-0x14(%rbp)
jge    1207 <main+0xd7>
jmp    11bd <main+0x8d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jle    11f4 <main+0xc4>
mov    -0x14(%rbp),%esi
lea    0xe2a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0xffffffff,%edx
mov    %edx,(%rax,%rcx,4)
jmp    11bd <main+0x8d>
jmp    11f9 <main+0xc9>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ab <main+0x7b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xec2(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    $0xf4241,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,%r14
cmpl   $0x0,(%rsp)
jle    118d <main+0x5d>
xor    %ebp,%ebp
lea    0xe99(%rip),%r15
lea    0x4(%rsp),%rbx
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
movslq 0x4(%rsp),%rax
addl   $0x1,(%r14,%rax,4)
add    $0x1,%ebp
cmp    (%rsp),%ebp
jl     1170 <main+0x40>
xor    %ebx,%ebx
lea    0xe6d(%rip),%r15
jmp    11ad <main+0x7d>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    $0xf4241,%rbx
je     11dc <main+0xac>
cmpl   $0x0,(%r14,%rbx,4)
jle    11a0 <main+0x70>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    (%r14,%rbx,4),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,(%r14,%rbx,4)
cmp    $0x1,%eax
jg     11c0 <main+0x90>
jmp    11a0 <main+0x70>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
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 i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = call i64 @calloc(i32 1000001, i32 4)
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %3
store i32 0, i32* %4
br label %9
9: ; preds = %21, %0
%10 = load i32, i32* %4
%11 = load i32, i32* %2
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %24
13: ; preds = %9
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%15 = load i32*, i32** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = add nsw i32 %19, 1
store i32 %20, i32* %18
br label %21
21: ; preds = %13
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %9
24: ; preds = %9
store i32 0, i32* %4
br label %25
25: ; preds = %46, %24
%26 = load i32, i32* %4
%27 = icmp slt i32 %26, 1000001
br i1 %27, label %28, label %49
28: ; preds = %25
br label %29
29: ; preds = %36, %28
%30 = load i32*, i32** %3
%31 = load i32, i32* %4
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %30, i64 %32
%34 = load i32, i32* %33
%35 = icmp sgt i32 %34, 0
br i1 %35, label %36, label %45
36: ; preds = %29
%37 = load i32, i32* %4
%38 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %37)
%39 = load i32*, i32** %3
%40 = load i32, i32* %4
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %39, i64 %41
%43 = load i32, i32* %42
%44 = add nsw i32 %43, -1
store i32 %44, i32* %42
br label %29
45: ; preds = %29
br label %46
46: ; preds = %45
%47 = load i32, i32* %4
%48 = add nsw i32 %47, 1
store i32 %48, i32* %4
br label %25
49: ; preds = %25
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 i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = call i64 @calloc(i32 1000001, i32 4)
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* %1
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %22
9: ; preds = %0
%10 = bitcast i32* %2 to i8*
br label %11
11: ; preds = %9, %11
%12 = phi i32 [ 0, %9 ], [ %19, %11 ]
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %6, i64 %15
%17 = load i32, i32* %16
%18 = add nsw i32 %17, 1
store i32 %18, i32* %16
%19 = add nuw nsw i32 %12, 1
%20 = load i32, i32* %1
%21 = icmp slt i32 %19, %20
br i1 %21, label %11, label %22
22: ; preds = %11, %0
br label %23
23: ; preds = %22, %35
%24 = phi i64 [ %36, %35 ], [ 0, %22 ]
%25 = getelementptr inbounds i32, i32* %6, i64 %24
%26 = load i32, i32* %25
%27 = icmp sgt i32 %26, 0
br i1 %27, label %28, label %35
28: ; preds = %23
%29 = trunc i64 %24 to i32
br label %30
30: ; preds = %28, %30
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%32 = load i32, i32* %25
%33 = add nsw i32 %32, -1
store i32 %33, i32* %25
%34 = icmp sgt i32 %32, 1
br i1 %34, label %30, label %35
35: ; preds = %30, %23
%36 = add nuw nsw i64 %24, 1
%37 = icmp eq i64 %36, 1000001
br i1 %37, label %38, label %23
38: ; preds = %35
ret i32 0
}