int main() {
  int n, pnc[30], i;
  while (~scanf("%d", &pnc[0])) {
    n = 0;
    while (getchar() != '\n')
      scanf("%d", &pnc[++n]);
    for (i = 0; i <= n; ++i)
      printf("%d%c", pnc[i], i == n ? '\n' : ' ');
    sort(pnc, n, n);
    printf("0\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x80(%rbp),%rsi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
xor    $0xffffffff,%eax
cmp    $0x0,%eax
je     1232 <main+0xf2>
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
cmp    $0xa,%eax
je     11b0 <main+0x70>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cltq
lea    -0x80(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
jmp    1177 <main+0x37>
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     120e <main+0xce>
movslq -0x84(%rbp),%rax
mov    -0x80(%rbp,%rax,4),%esi
mov    -0x84(%rbp),%ecx
mov    -0x8(%rbp),%edi
mov    $0x20,%edx
mov    $0xa,%eax
cmp    %edi,%ecx
cmove  %eax,%edx
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    11ba <main+0x7a>
lea    -0x80(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x0,%al
call   1040 <sort@plt>
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1152 <main+0x12>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
lea    0xe9b(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
cmp    $0xffffffff,%eax
je     1235 <main+0xe5>
mov    $0xa,%ebp
lea    0xe7f(%rip),%r13
lea    0xe75(%rip),%r12
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <getchar@plt>
mov    $0x0,%r15d
cmp    $0xa,%eax
je     11d1 <main+0x81>
xor    %r15d,%r15d
lea    0x4(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
add    $0x1,%r15d
add    $0x4,%rbx
cmp    $0xa,%eax
jne    11b0 <main+0x60>
mov    %r15d,%ebx
add    $0x1,%r15d
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
mov    (%rsp,%r14,4),%esi
cmp    %r14,%rbx
mov    $0x20,%edx
cmove  %ebp,%edx
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r14
cmp    %r14,%r15
jne    11e0 <main+0x90>
mov    %rsp,%r14
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <sort@plt>
lea    0xdee(%rip),%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
cmp    $0xffffffff,%eax
jne    1190 <main+0x40>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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