#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 obterIndiceDoMaiorElemento(int *, int);
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *);
int main(void) {
  int quantidadeDeSuspeitos, suspeitos[10000], i, indiceDoMaisSuspeito;
  while (scanf("%d", &quantidadeDeSuspeitos), quantidadeDeSuspeitos != 0) {
    for (i = 0; i < quantidadeDeSuspeitos; i++) {
      scanf("%d", &suspeitos[i]);
    }
    indiceDoMaisSuspeito =
        obterIndiceDoMaiorElemento(suspeitos, quantidadeDeSuspeitos);
    suspeitos[indiceDoMaisSuspeito] = -1;
    indiceDoMaisSuspeito =
        obterIndiceDoMaiorElemento(suspeitos, quantidadeDeSuspeitos);
    printf("%d\n", indiceDoMaisSuspeito + 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9c60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     1200 <main+0xd0>
movl   $0x0,-0x9c54(%rbp)
mov    -0x9c54(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11aa <main+0x7a>
movslq -0x9c54(%rbp),%rax
lea    -0x9c50(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe6f(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x9c54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c54(%rbp)
jmp    1166 <main+0x36>
lea    -0x9c50(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <obterIndiceDoMaiorElemento@plt>
mov    %eax,-0x9c58(%rbp)
movslq -0x9c58(%rbp),%rax
movl   $0xffffffff,-0x9c50(%rbp,%rax,4)
ff ff ff ff
lea    -0x9c50(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <obterIndiceDoMaiorElemento@plt>
mov    %eax,-0x9c58(%rbp)
mov    -0x9c58(%rbp),%esi
add    $0x1,%esi
lea    0xe0d(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <main+0x12>
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    0xeb8(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
je     11ef <main+0xbf>
lea    0x10(%rsp),%r14
lea    0xe96(%rip),%r13
lea    0xe92(%rip),%r15
lea    0xc(%rsp),%r12
jmp    11bc <main+0x8c>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1050 <obterIndiceDoMaiorElemento@plt>
cltq
movl   $0xffffffff,0x10(%rsp,%rax,4)
ff
mov    0xc(%rsp),%esi
mov    %r14,%rdi
call   1050 <obterIndiceDoMaiorElemento@plt>
lea    0x1(%rax),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
mov    %r13,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
je     11ef <main+0xbf>
test   %esi,%esi
jle    1180 <main+0x50>
mov    %r14,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r13,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    $0x1,%rbp
movslq 0xc(%rsp),%rsi
add    $0x4,%rbx
cmp    %rsi,%rbp
jl     11d0 <main+0xa0>
jmp    1180 <main+0x50>
xor    %eax,%eax
add    $0x9c58,%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\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10000 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
br label %6
6: ; preds = %23, %0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %36
10: ; preds = %6
store i32 0, i32* %4
br label %11
11: ; preds = %20, %10
%12 = load i32, i32* %4
%13 = load i32, i32* %2
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %23
15: ; preds = %11
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [10000 x i32], [10000 x i32]* %3, 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* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %11
23: ; preds = %11
%24 = getelementptr inbounds [10000 x i32], [10000 x i32]* %3, i64 0, i64 0
%25 = load i32, i32* %2
%26 = call i32 @obterIndiceDoMaiorElemento(i32* %24, i32 %25)
store i32 %26, i32* %5
%27 = load i32, i32* %5
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [10000 x i32], [10000 x i32]* %3, i64 0, i64 %28
store i32 -1, i32* %29
%30 = getelementptr inbounds [10000 x i32], [10000 x i32]* %3, i64 0, i64 0
%31 = load i32, i32* %2
%32 = call i32 @obterIndiceDoMaiorElemento(i32* %30, i32 %31)
store i32 %32, i32* %5
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %34)
br label %6
36: ; preds = %6
ret i32 0
}

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