#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 a[1000000], n, i, d;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  scanf("%d", &d);
  if (a[0] == d) {
    printf("%d", a[1]);
    i = 2;
  } else {
    printf("%d", a[0]);
    i = 1;
  }
  for (; i < n; i++) {
    if (a[i] == d)
      continue;
    printf(" %d", a[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3d0920,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec1(%rip),%rdi
lea    -0x3d0914(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x3d0918(%rbp)
mov    -0x3d0918(%rbp),%eax
cmp    -0x3d0914(%rbp),%eax
jge    119d <main+0x7d>
movslq -0x3d0918(%rbp),%rax
lea    -0x3d0910(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe7d(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x3d0918(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3d0918(%rbp)
jmp    1156 <main+0x36>
lea    0xe5d(%rip),%rdi
lea    -0x3d091c(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x3d0910(%rbp),%eax
cmp    -0x3d091c(%rbp),%eax
jne    11e3 <main+0xc3>
mov    -0x3d090c(%rbp),%esi
lea    0xe32(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2,-0x3d0918(%rbp)
jmp    11ff <main+0xdf>
mov    -0x3d0910(%rbp),%esi
lea    0xe11(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x3d0918(%rbp)
jmp    1204 <main+0xe4>
mov    -0x3d0918(%rbp),%eax
cmp    -0x3d0914(%rbp),%eax
jge    1263 <main+0x143>
movslq -0x3d0918(%rbp),%rax
mov    -0x3d0910(%rbp,%rax,4),%eax
cmp    -0x3d091c(%rbp),%eax
jne    1235 <main+0x115>
jmp    124f <main+0x12f>
movslq -0x3d0918(%rbp),%rax
mov    -0x3d0910(%rbp,%rax,4),%esi
lea    0xdb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x3d0918(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3d0918(%rbp)
jmp    1204 <main+0xe4>
xor    %eax,%eax
add    $0x3d0920,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x3d0910,%rsp
lea    0xecf(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    117d <main+0x5d>
lea    0x10(%rsp),%rbx
xor    %ebp,%ebp
lea    0xeb0(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    $0x1,%rbp
movslq 0x8(%rsp),%rax
add    $0x4,%rbx
cmp    %rax,%rbp
jl     1160 <main+0x40>
lea    0xe7d(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x10(%rsp),%esi
xor    %ebp,%ebp
cmp    0xc(%rsp),%esi
sete   %al
jne    11a4 <main+0x84>
mov    0x14(%rsp),%esi
mov    %al,%bpl
add    $0x1,%ebp
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%eax
cmp    %eax,%ebp
jge    11f0 <main+0xd0>
mov    %ebp,%ebx
lea    0xe3d(%rip),%r14
jmp    11d8 <main+0xb8>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rbx
cmp    %ebx,%eax
jle    11f0 <main+0xd0>
mov    0x10(%rsp,%rbx,4),%esi
cmp    0xc(%rsp),%esi
je     11d0 <main+0xb0>
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%eax
jmp    11d0 <main+0xb0>
xor    %eax,%eax
add    $0x3d0910,%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\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1000000 x i32]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
store i32 0, i32* %8
br label %11
11: ; preds = %20, %2
%12 = load i32, i32* %8
%13 = load i32, i32* %7
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %23
15: ; preds = %11
%16 = load i32, i32* %8
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [1000000 x i32], [1000000 x i32]* %6, i64 0, i64 %17
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %18)
br label %20
20: ; preds = %15
%21 = load i32, i32* %8
%22 = add nsw i32 %21, 1
store i32 %22, i32* %8
br label %11
23: ; preds = %11
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%25 = getelementptr inbounds [1000000 x i32], [1000000 x i32]* %6, i64 0, i64 0
%26 = load i32, i32* %25
%27 = load i32, i32* %9
%28 = icmp eq i32 %26, %27
br i1 %28, label %29, label %33
29: ; preds = %23
%30 = getelementptr inbounds [1000000 x i32], [1000000 x i32]* %6, i64 0, i64 1
%31 = load i32, i32* %30
%32 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %31)
store i32 2, i32* %8
br label %37
33: ; preds = %23
%34 = getelementptr inbounds [1000000 x i32], [1000000 x i32]* %6, 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)
store i32 1, i32* %8
br label %37
37: ; preds = %33, %29
br label %38
38: ; preds = %56, %37
%39 = load i32, i32* %8
%40 = load i32, i32* %7
%41 = icmp slt i32 %39, %40
br i1 %41, label %42, label %59
42: ; preds = %38
%43 = load i32, i32* %8
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [1000000 x i32], [1000000 x i32]* %6, i64 0, i64 %44
%46 = load i32, i32* %45
%47 = load i32, i32* %9
%48 = icmp eq i32 %46, %47
br i1 %48, label %49, label %50
49: ; preds = %42
br label %56
50: ; preds = %42
%51 = load i32, i32* %8
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [1000000 x i32], [1000000 x i32]* %6, i64 0, i64 %52
%54 = load i32, i32* %53
%55 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %54)
br label %56
56: ; preds = %50, %49
%57 = load i32, i32* %8
%58 = add nsw i32 %57, 1
store i32 %58, i32* %8
br label %38
59: ; preds = %38
ret i32 0
}

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