#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 argc, const char *argv[]) {
  int i, n, insert, N, a[100000];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  scanf("%d%d", &insert, &N);
  insert--;
  if (insert == 0) {
    i = 0;
    printf("%d", N);
  } else {
    i = 1;
    printf("%d", a[0]);
  }
  for (; i < n; i++) {
    if (insert == i && insert != 0)
      printf(" %d", N);
    printf(" %d", a[i]);
  }
  if (insert >= n)
    printf(" %d", N);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x61aa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec6(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    118c <main+0x6c>
movslq -0x14(%rbp),%rax
lea    -0x61aa0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1152 <main+0x32>
lea    0xe6d(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    11d0 <main+0xb0>
movl   $0x0,-0x14(%rbp)
mov    -0x20(%rbp),%esi
lea    0xe40(%rip),%rdi
call   1030 <printf@plt>
jmp    11e9 <main+0xc9>
movl   $0x1,-0x14(%rbp)
mov    -0x61aa0(%rbp),%esi
lea    0xe22(%rip),%rdi
call   1030 <printf@plt>
jmp    11ee <main+0xce>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1244 <main+0x124>
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    121f <main+0xff>
cmpl   $0x0,-0x1c(%rbp)
je     121f <main+0xff>
mov    -0x20(%rbp),%esi
lea    0xdeb(%rip),%rdi
call   1030 <printf@plt>
movslq -0x14(%rbp),%rax
mov    -0x61aa0(%rbp,%rax,4),%esi
lea    0xdd4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ee <main+0xce>
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jl     125f <main+0x13f>
mov    -0x20(%rbp),%esi
lea    0xdab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x61aa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x61a90,%rsp
lea    0xed3(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    117f <main+0x5f>
lea    0x10(%rsp),%r15
lea    0xeb4(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
add    $0x1,%rbx
movslq 0x4(%rsp),%rax
add    $0x4,%r15
cmp    %rax,%rbx
jl     1160 <main+0x40>
lea    0xe7a(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%r14
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
xor    %ebx,%ebx
addl   $0xffffffff,0x8(%rsp)
setne  %bl
lea    0x10(%rsp),%rax
cmove  %r14,%rax
mov    (%rax),%esi
lea    0xe50(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%eax
cmp    %ebx,%eax
jle    1203 <main+0xe3>
lea    0xe3b(%rip),%r14
jmp    11e8 <main+0xc8>
nopl   0x0(%rax)
mov    0x10(%rsp,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
mov    0x4(%rsp),%eax
cmp    %ebx,%eax
jle    1203 <main+0xe3>
mov    0x8(%rsp),%eax
cmp    %rax,%rbx
jne    11d0 <main+0xb0>
test   %eax,%eax
je     11d0 <main+0xb0>
mov    0xc(%rsp),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
jmp    11d0 <main+0xb0>
cmp    %eax,0x8(%rsp)
jl     1219 <main+0xf9>
mov    0xc(%rsp),%esi
lea    0xdf1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x61a90,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [4 x i8] c" %d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [100000 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
store i32 0, i32* %6
br label %12
12: ; preds = %21, %2
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %24
16: ; preds = %12
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [100000 x i32], [100000 x i32]* %10, i64 0, i64 %18
%20 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %19)
br label %21
21: ; preds = %16
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %12
24: ; preds = %12
%25 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %8, i32* %9)
%26 = load i32, i32* %8
%27 = add nsw i32 %26, -1
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %24
store i32 0, i32* %6
%31 = load i32, i32* %9
%32 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %31)
br label %37
33: ; preds = %24
store i32 1, i32* %6
%34 = getelementptr inbounds [100000 x i32], [100000 x i32]* %10, i64 0, i64 0
%35 = load i32, i32* %34
%36 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %35)
br label %37
37: ; preds = %33, %30
br label %38
38: ; preds = %58, %37
%39 = load i32, i32* %6
%40 = load i32, i32* %7
%41 = icmp slt i32 %39, %40
br i1 %41, label %42, label %61
42: ; preds = %38
%43 = load i32, i32* %8
%44 = load i32, i32* %6
%45 = icmp eq i32 %43, %44
br i1 %45, label %46, label %52
46: ; preds = %42
%47 = load i32, i32* %8
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %52
49: ; preds = %46
%50 = load i32, i32* %9
%51 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %50)
br label %52
52: ; preds = %49, %46, %42
%53 = load i32, i32* %6
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [100000 x i32], [100000 x i32]* %10, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %56)
br label %58
58: ; preds = %52
%59 = load i32, i32* %6
%60 = add nsw i32 %59, 1
store i32 %60, i32* %6
br label %38
61: ; preds = %38
%62 = load i32, i32* %8
%63 = load i32, i32* %7
%64 = icmp sge i32 %62, %63
br i1 %64, label %65, label %68
65: ; preds = %61
%66 = load i32, i32* %9
%67 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %66)
br label %68
68: ; preds = %65, %61
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [4 x i8] c" %d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [100000 x i32]
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = bitcast [100000 x i32]* %6 to i8*
%11 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %22
14: ; preds = %2, %14
%15 = phi i64 [ %18, %14 ], [ 0, %2 ]
%16 = getelementptr inbounds [100000 x i32], [100000 x i32]* %6, i64 0, i64 %15
%17 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %16)
%18 = add nuw nsw i64 %15, 1
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = icmp slt i64 %18, %20
br i1 %21, label %14, label %22
22: ; preds = %14, %2
%23 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5)
%24 = load i32, i32* %4
%25 = add nsw i32 %24, -1
store i32 %25, i32* %4
%26 = icmp eq i32 %25, 0
%27 = getelementptr inbounds [100000 x i32], [100000 x i32]* %6, i64 0, i64 0
%28 = load i32, i32* %27
%29 = load i32, i32* %5
%30 = select i1 %26, i32 %29, i32 %28
%31 = xor i1 %26, true
%32 = zext i1 %31 to i32
%33 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %30)
%34 = load i32, i32* %3
%35 = icmp sgt i32 %34, %32
br i1 %35, label %36, label %56
36: ; preds = %22
%37 = zext i1 %31 to i64
br label %38
38: ; preds = %36, %48
%39 = phi i64 [ %37, %36 ], [ %52, %48 ]
%40 = load i32, i32* %4
%41 = zext i32 %40 to i64
%42 = icmp eq i64 %39, %41
%43 = icmp ne i32 %40, 0
%44 = and i1 %42, %43
br i1 %44, label %45, label %48
45: ; preds = %38
%46 = load i32, i32* %5
%47 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %46)
br label %48
48: ; preds = %45, %38
%49 = getelementptr inbounds [100000 x i32], [100000 x i32]* %6, i64 0, i64 %39
%50 = load i32, i32* %49
%51 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %50)
%52 = add nuw nsw i64 %39, 1
%53 = load i32, i32* %3
%54 = trunc i64 %52 to i32
%55 = icmp sgt i32 %53, %54
br i1 %55, label %38, label %56
56: ; preds = %48, %22
%57 = phi i32 [ %34, %22 ], [ %53, %48 ]
%58 = load i32, i32* %4
%59 = icmp slt i32 %58, %57
br i1 %59, label %63, label %60
60: ; preds = %56
%61 = load i32, i32* %5
%62 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %61)
br label %63
63: ; preds = %60, %56
ret i32 0
}