#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 scanf(char *, int *, ...);
int main(void) {
  int foram, voltaram, mergulhadoresQueVoltaram[10001], i, mergulhadorQueVoltou;
  for (i = 0; i < 10001; i++) {
    mergulhadoresQueVoltaram[i] = 0;
  }
  while (scanf("%d %d", &foram, &voltaram) == 2) {
    if (foram == voltaram) {
      for (i = 1; i <= voltaram; i++) {
        scanf("%d", &mergulhadorQueVoltou);
      }
      printf("*");
    } else {
      for (i = 1; i <= voltaram; i++) {
        scanf("%d", &mergulhadorQueVoltou);
        mergulhadoresQueVoltaram[mergulhadorQueVoltou] = 1;
      }
      for (i = 1; i <= foram; i++) {
        if (!mergulhadoresQueVoltaram[i]) {
          printf("%d ", i);
        }
        mergulhadoresQueVoltaram[i] = 0;
      }
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9c60,%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>
jmp    1177 <main+0x57>
lea    0xe82(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    12cb <main+0x1ab>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    11f7 <main+0xd7>
movl   $0x1,-0x9c54(%rbp)
mov    -0x9c54(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11e4 <main+0xc4>
lea    0xe41(%rip),%rdi
lea    -0x9c58(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x9c54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c54(%rbp)
jmp    11ac <main+0x8c>
lea    0xe1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12b8 <main+0x198>
movl   $0x1,-0x9c54(%rbp)
mov    -0x9c54(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     124b <main+0x12b>
lea    0xdec(%rip),%rdi
lea    -0x9c58(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movslq -0x9c58(%rbp),%rax
movl   $0x1,-0x9c50(%rbp,%rax,4)
mov    -0x9c54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c54(%rbp)
jmp    1201 <main+0xe1>
movl   $0x1,-0x9c54(%rbp)
mov    -0x9c54(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     12b3 <main+0x193>
movslq -0x9c54(%rbp),%rax
cmpl   $0x0,-0x9c50(%rbp,%rax,4)
jne    128d <main+0x16d>
mov    -0x9c54(%rbp),%esi
lea    0xd82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x9c54(%rbp),%rax
movl   $0x0,-0x9c50(%rbp,%rax,4)
mov    -0x9c54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c54(%rbp)
jmp    1255 <main+0x135>
jmp    12b8 <main+0x198>
lea    0xd4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1177 <main+0x57>
xor    %eax,%eax
add    $0x9c60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x9c58,%rsp
lea    0x10(%rsp),%rdi
mov    $0x9c44,%edx
xor    %esi,%esi
call   1050 <memset@plt>
lea    0xe97(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1060 <scanf@plt>
cmp    $0x2,%eax
jne    1297 <main+0x157>
lea    0xe79(%rip),%r14
lea    0xc(%rsp),%rbx
lea    0x4(%rsp),%r13
lea    0xe6b(%rip),%r12
jmp    11d3 <main+0x93>
nopl   (%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe45(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1060 <scanf@plt>
cmp    $0x2,%eax
jne    1297 <main+0x157>
mov    0x8(%rsp),%eax
mov    0x4(%rsp),%ecx
cmp    %ecx,%eax
jne    1210 <main+0xd0>
test   %eax,%eax
jle    11a0 <main+0x60>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     11f0 <main+0xb0>
jmp    11a0 <main+0x60>
nopl   0x0(%rax,%rax,1)
test   %ecx,%ecx
jle    1247 <main+0x107>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
movslq 0xc(%rsp),%rax
movl   $0x1,0x10(%rsp,%rax,4)
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     1220 <main+0xe0>
mov    0x8(%rsp),%eax
test   %eax,%eax
jle    11aa <main+0x6a>
mov    $0x1,%r15d
jmp    127c <main+0x13c>
nopw   0x0(%rax,%rax,1)
movl   $0x0,0x10(%rsp,%r15,4)
lea    0x1(%r15),%rcx
movslq %eax,%rdx
cmp    %rdx,%r15
mov    %rcx,%r15
jge    11aa <main+0x6a>
cmpl   $0x0,0x10(%rsp,%r15,4)
jne    1260 <main+0x120>
mov    %r12,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%eax
jmp    1260 <main+0x120>
xor    %eax,%eax
add    $0x9c58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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