#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 a[10001];
  int i, n, m;
  for (i = 0; i < 10001; i++) {
    a[i] = 0;
  }
  int N, M;
  scanf("%d", &N);
  int temp;
  for (n = 0; n < N; n++) {
    scanf("%d", &temp);
    a[temp] += 1;
  }
  scanf("%d", &M);
  for (m = 0; m < M; m++) {
    scanf("%d", &temp);
    a[temp] -= 1;
  }
  for (i = 0; i < 10001; i++) {
    if (a[i] < 0)
      printf("%d ", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9c70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x9c54(%rbp)
cmpl   $0x2711,-0x9c54(%rbp)
jge    1172 <main+0x52>
movslq -0x9c54(%rbp),%rax
movl   $0x0,-0x9c50(%rbp,%rax,4)
mov    -0x9c54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c54(%rbp)
jmp    113c <main+0x1c>
lea    0xe87(%rip),%rdi
lea    -0x9c60(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x9c58(%rbp)
mov    -0x9c58(%rbp),%eax
cmp    -0x9c60(%rbp),%eax
jge    11e0 <main+0xc0>
lea    0xe58(%rip),%rdi
lea    -0x9c68(%rbp),%rsi
call   1040 <scanf@plt>
movslq -0x9c68(%rbp),%rax
mov    -0x9c50(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x9c50(%rbp,%rax,4)
mov    -0x9c58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c58(%rbp)
jmp    118f <main+0x6f>
lea    0xe19(%rip),%rdi
lea    -0x9c64(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x9c5c(%rbp)
mov    -0x9c5c(%rbp),%eax
cmp    -0x9c64(%rbp),%eax
jge    124e <main+0x12e>
lea    0xdea(%rip),%rdi
lea    -0x9c68(%rbp),%rsi
call   1040 <scanf@plt>
movslq -0x9c68(%rbp),%rax
mov    -0x9c50(%rbp,%rax,4),%ecx
sub    $0x1,%ecx
mov    %ecx,-0x9c50(%rbp,%rax,4)
mov    -0x9c5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c5c(%rbp)
jmp    11fd <main+0xdd>
movl   $0x0,-0x9c54(%rbp)
cmpl   $0x2711,-0x9c54(%rbp)
jge    12a8 <main+0x188>
movslq -0x9c54(%rbp),%rax
cmpl   $0x0,-0x9c50(%rbp,%rax,4)
jge    128f <main+0x16f>
mov    -0x9c54(%rbp),%esi
lea    0xd79(%rip),%rdi
call   1030 <printf@plt>
jmp    1294 <main+0x174>
mov    -0x9c54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c54(%rbp)
jmp    1258 <main+0x138>
xor    %eax,%eax
add    $0x9c70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x9c60,%rsp
lea    0x10(%rsp),%rdi
xor    %ebp,%ebp
mov    $0x9c44,%edx
xor    %esi,%esi
call   1040 <memset@plt>
lea    0xeab(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    119e <main+0x6e>
lea    0xe93(%rip),%r14
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
movslq 0x4(%rsp),%rax
addl   $0x1,0x10(%rsp,%rax,4)
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jl     1180 <main+0x50>
lea    0xe5b(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    11ee <main+0xbe>
xor    %ebp,%ebp
lea    0xe41(%rip),%r14
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
movslq 0x4(%rsp),%rax
addl   $0xffffffff,0x10(%rsp,%rax,4)
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jl     11d0 <main+0xa0>
xor    %ebx,%ebx
lea    0xe0c(%rip),%r14
jmp    120d <main+0xdd>
nopl   0x0(%rax)
add    $0x1,%rbx
cmp    $0x2711,%rbx
je     1220 <main+0xf0>
cmpl   $0x0,0x10(%rsp,%rbx,4)
jns    1200 <main+0xd0>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1200 <main+0xd0>
xor    %eax,%eax
add    $0x9c60,%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() {
%1 = alloca i32
%2 = alloca [10001 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %9
9: ; preds = %16, %0
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 10001
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [10001 x i32], [10001 x i32]* %2, i64 0, i64 %14
store i32 0, i32* %15
br label %16
16: ; preds = %12
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %9
19: ; preds = %9
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
store i32 0, i32* %4
br label %21
21: ; preds = %32, %19
%22 = load i32, i32* %4
%23 = load i32, i32* %6
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %35
25: ; preds = %21
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%27 = load i32, i32* %8
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [10001 x i32], [10001 x i32]* %2, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = add nsw i32 %30, 1
store i32 %31, i32* %29
br label %32
32: ; preds = %25
%33 = load i32, i32* %4
%34 = add nsw i32 %33, 1
store i32 %34, i32* %4
br label %21
35: ; preds = %21
%36 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
store i32 0, i32* %5
br label %37
37: ; preds = %48, %35
%38 = load i32, i32* %5
%39 = load i32, i32* %7
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %51
41: ; preds = %37
%42 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%43 = load i32, i32* %8
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [10001 x i32], [10001 x i32]* %2, i64 0, i64 %44
%46 = load i32, i32* %45
%47 = sub nsw i32 %46, 1
store i32 %47, i32* %45
br label %48
48: ; preds = %41
%49 = load i32, i32* %5
%50 = add nsw i32 %49, 1
store i32 %50, i32* %5
br label %37
51: ; preds = %37
store i32 0, i32* %3
br label %52
52: ; preds = %65, %51
%53 = load i32, i32* %3
%54 = icmp slt i32 %53, 10001
br i1 %54, label %55, label %68
55: ; preds = %52
%56 = load i32, i32* %3
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [10001 x i32], [10001 x i32]* %2, i64 0, i64 %57
%59 = load i32, i32* %58
%60 = icmp slt i32 %59, 0
br i1 %60, label %61, label %64
61: ; preds = %55
%62 = load i32, i32* %3
%63 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %62)
br label %64
64: ; preds = %61, %55
br label %65
65: ; preds = %64
%66 = load i32, i32* %3
%67 = add nsw i32 %66, 1
store i32 %67, i32* %3
br label %52
68: ; preds = %52
ret i32 0
}

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