#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  int arr[6] = {0, 0, 0, 0, 0, 0};
  int indices[6] = {0, 0, 0, 0, 0, 0};
  for (int i = 0; i < n; i++) {
    int k;
    scanf("%d", &k);
    arr[k - 1]++;
    indices[k - 1] = i + 1;
  }
  if (arr[5] == 1)
    printf("%d\n", indices[5]);
  else if (arr[4] == 1)
    printf("%d\n", indices[4]);
  else if (arr[3] == 1)
    printf("%d\n", indices[3]);
  else if (arr[2] == 1)
    printf("%d\n", indices[2]);
  else if (arr[1] == 1)
    printf("%d\n", indices[1]);
  else if (arr[0] == 1)
    printf("%d\n", indices[0]);
  else
    printf("none\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1040 <memset@plt>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1040 <memset@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c5 <main+0x95>
lea    0xe77(%rip),%rdi
lea    -0x48(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x48(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x20(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x20(%rbp,%rax,4)
mov    -0x44(%rbp),%ecx
add    $0x1,%ecx
mov    -0x48(%rbp),%eax
sub    $0x1,%eax
cltq
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1176 <main+0x46>
cmpl   $0x1,-0xc(%rbp)
jne    11e5 <main+0xb5>
mov    -0x2c(%rbp),%esi
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ac <main+0x17c>
cmpl   $0x1,-0x10(%rbp)
jne    1205 <main+0xd5>
mov    -0x30(%rbp),%esi
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a7 <main+0x177>
cmpl   $0x1,-0x14(%rbp)
jne    1225 <main+0xf5>
mov    -0x34(%rbp),%esi
lea    0xdea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a2 <main+0x172>
cmpl   $0x1,-0x18(%rbp)
jne    1245 <main+0x115>
mov    -0x38(%rbp),%esi
lea    0xdca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    129d <main+0x16d>
cmpl   $0x1,-0x1c(%rbp)
jne    1265 <main+0x135>
mov    -0x3c(%rbp),%esi
lea    0xdaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1298 <main+0x168>
cmpl   $0x1,-0x20(%rbp)
jne    1285 <main+0x155>
mov    -0x40(%rbp),%esi
lea    0xd8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1293 <main+0x163>
lea    0xd7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1298 <main+0x168>
jmp    129d <main+0x16d>
jmp    12a2 <main+0x172>
jmp    12a7 <main+0x177>
jmp    12ac <main+0x17c>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x50,%rsp
lea    0xec1(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movq   $0x0,0x40(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x20(%rsp)
cmpl   $0x0,0x8(%rsp)
jle    11af <main+0x7f>
xor    %ebp,%ebp
lea    0xe88(%rip),%r14
lea    0xc(%rsp),%rbx
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
movslq 0xc(%rsp),%rax
addl   $0x1,0x2c(%rsp,%rax,4)
add    $0x1,%ebp
mov    %ebp,0xc(%rsp,%rax,4)
cmp    0x8(%rsp),%ebp
jl     1180 <main+0x50>
cmpl   $0x1,0x44(%rsp)
jne    11af <main+0x7f>
mov    0x24(%rsp),%esi
jmp    11ee <main+0xbe>
cmpl   $0x1,0x40(%rsp)
jne    11bc <main+0x8c>
mov    0x20(%rsp),%esi
jmp    11ee <main+0xbe>
cmpl   $0x1,0x3c(%rsp)
jne    11c9 <main+0x99>
mov    0x1c(%rsp),%esi
jmp    11ee <main+0xbe>
cmpl   $0x1,0x38(%rsp)
jne    11d6 <main+0xa6>
mov    0x18(%rsp),%esi
jmp    11ee <main+0xbe>
cmpl   $0x1,0x34(%rsp)
jne    11e3 <main+0xb3>
mov    0x14(%rsp),%esi
jmp    11ee <main+0xbe>
cmpl   $0x1,0x30(%rsp)
jne    1207 <main+0xd7>
mov    0x10(%rsp),%esi
lea    0xe0e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xdf9(%rip),%rdi
call   1030 <puts@plt>
jmp    11fc <main+0xcc>

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

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