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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xebb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
lea    0xf(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,-0x30(%rbp)
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
movl   $0x1,(%rax)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c5 <main+0x95>
lea    0xe69(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x30(%rbp),%rax
mov    -0x1c(%rbp),%edx
add    $0x1,%edx
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1185 <main+0x55>
mov    $0x31,%edi
call   1030 <putchar@plt>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1207 <main+0xd7>
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe0c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11d6 <main+0xa6>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%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
push   %rax
lea    0xebc(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   1050 <scanf@plt>
mov    %rsp,%r15
mov    -0x2c(%rbp),%eax
mov    %rsp,%rcx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
mov    %rcx,%r13
sub    %rax,%r13
mov    %r13,%rsp
neg    %rax
movl   $0x1,(%rcx,%rax,1)
cmpl   $0x2,-0x2c(%rbp)
jl     11ac <main+0x7c>
mov    $0x1,%ebx
lea    0xe79(%rip),%r14
lea    -0x30(%rbp),%r12
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
add    $0x1,%ebx
movslq -0x30(%rbp),%rax
mov    %ebx,0x4(%r13,%rax,4)
cmp    -0x2c(%rbp),%ebx
jl     1190 <main+0x60>
mov    $0x31,%edi
call   1030 <putchar@plt>
cmpl   $0x2,-0x2c(%rbp)
jl     11ea <main+0xba>
mov    $0x1,%ebx
lea    0xe38(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    0x0(%r13,%rbx,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
movslq -0x2c(%rbp),%rax
cmp    %rax,%rbx
jl     11d0 <main+0xa0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%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 = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c" %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 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** %3
%12 = alloca i32, i64 %10
store i64 %10, i64* %4
%13 = getelementptr inbounds i32, i32* %12, i64 0
store i32 1, i32* %13
store i32 1, i32* %5
br label %14
14: ; preds = %26, %0
%15 = load i32, i32* %5
%16 = load i32, i32* %2
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %29
18: ; preds = %14
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %12, i64 %24
store i32 %21, i32* %25
br label %26
26: ; preds = %18
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %14
29: ; preds = %14
%30 = call i32 @putchar(i8 signext 49)
store i32 1, i32* %7
br label %31
31: ; preds = %41, %29
%32 = load i32, i32* %7
%33 = load i32, i32* %2
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %44
35: ; preds = %31
%36 = load i32, i32* %7
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i32, i32* %12, i64 %37
%39 = load i32, i32* %38
%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 = %35
%42 = load i32, i32* %7
%43 = add nsw i32 %42, 1
store i32 %43, i32* %7
br label %31
44: ; preds = %31
%45 = call i32 @putchar(i8 signext 10)
store i32 0, i32* %1
%46 = load i8*, i8** %3
%47 = load i32, i32* %1
ret i32 %47
}

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