#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 n;
  scanf("%d", &n);
  int a;
  int c = 0;
  int cc = 0;
  int d = 0;
  int dd = 0;
  int k = 0;
  for (k = 0; k < n; k++) {
    scanf("%d", &a);
    if (a % 2 == 0) {
      cc = k + 1;
      c++;
    } else {
      dd = k + 1;
      d++;
    }
  }
  if (d == 1) {
    printf("%d\n", dd);
  }
  if (c == 1) {
    printf("%d\n", cc);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d5 <main+0xb5>
lea    0xe84(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11b0 <main+0x90>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11c2 <main+0xa2>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11c7 <main+0xa7>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1169 <main+0x49>
cmpl   $0x1,-0x18(%rbp)
jne    11ee <main+0xce>
mov    -0x1c(%rbp),%esi
lea    0xe1a(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x1,-0x10(%rbp)
jne    1207 <main+0xe7>
mov    -0x14(%rbp),%esi
lea    0xe01(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecb(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x10(%rsp)
jle    11c9 <main+0xa9>
xor    %ebx,%ebx
lea    0xead(%rip),%r15
lea    0x14(%rsp),%r12
xor    %r13d,%r13d
xor    %r14d,%r14d
movl   $0x0,0xc(%rsp)
xor    %ebp,%ebp
jmp    117d <main+0x5d>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r14d
mov    %ebx,%r13d
cmp    0x10(%rsp),%ebx
jge    119f <main+0x7f>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
add    $0x1,%ebx
testb  $0x1,0x14(%rsp)
jne    1170 <main+0x50>
add    $0x1,%ebp
mov    %ebx,0xc(%rsp)
cmp    0x10(%rsp),%ebx
jl     117d <main+0x5d>
cmp    $0x1,%r14d
jne    11b4 <main+0x94>
lea    0xe57(%rip),%rdi
mov    %r13d,%esi
call   1030 <printf@plt>
cmp    $0x1,%ebp
jne    11c9 <main+0xa9>
lea    0xe43(%rip),%rdi
mov    0xc(%rsp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%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 i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %8
br label %10
10: ; preds = %30, %0
%11 = load i32, i32* %8
%12 = load i32, i32* %2
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %33
14: ; preds = %10
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%16 = load i32, i32* %3
%17 = srem i32 %16, 2
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %14
%20 = load i32, i32* %8
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %29
24: ; preds = %14
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %7
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %29
29: ; preds = %24, %19
br label %30
30: ; preds = %29
%31 = load i32, i32* %8
%32 = add nsw i32 %31, 1
store i32 %32, i32* %8
br label %10
33: ; preds = %10
%34 = load i32, i32* %6
%35 = icmp eq i32 %34, 1
br i1 %35, label %36, label %39
36: ; preds = %33
%37 = load i32, i32* %7
%38 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %37)
br label %39
39: ; preds = %36, %33
%40 = load i32, i32* %4
%41 = icmp eq i32 %40, 1
br i1 %41, label %42, label %45
42: ; preds = %39
%43 = load i32, i32* %5
%44 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %43)
br label %45
45: ; preds = %42, %39
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 i32
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = bitcast i32* %2 to i8*
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %38
8: ; preds = %0, %23
%9 = phi i32 [ %18, %23 ], [ 0, %0 ]
%10 = phi i32 [ %27, %23 ], [ 0, %0 ]
%11 = phi i32 [ %26, %23 ], [ 0, %0 ]
%12 = phi i32 [ %25, %23 ], [ 0, %0 ]
%13 = phi i32 [ %24, %23 ], [ 0, %0 ]
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%15 = load i32, i32* %2
%16 = and i32 %15, 1
%17 = icmp eq i32 %16, 0
%18 = add nuw nsw i32 %9, 1
br i1 %17, label %19, label %21
19: ; preds = %8
%20 = add nsw i32 %13, 1
br label %23
21: ; preds = %8
%22 = add nsw i32 %11, 1
br label %23
23: ; preds = %19, %21
%24 = phi i32 [ %20, %19 ], [ %13, %21 ]
%25 = phi i32 [ %18, %19 ], [ %12, %21 ]
%26 = phi i32 [ %11, %19 ], [ %22, %21 ]
%27 = phi i32 [ %10, %19 ], [ %18, %21 ]
%28 = load i32, i32* %1
%29 = icmp slt i32 %18, %28
br i1 %29, label %8, label %30
30: ; preds = %23
%31 = icmp eq i32 %26, 1
br i1 %31, label %32, label %34
32: ; preds = %30
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %27)
br label %34
34: ; preds = %32, %30
%35 = icmp eq i32 %24, 1
br i1 %35, label %36, label %38
36: ; preds = %34
%37 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %25)
br label %38
38: ; preds = %0, %36, %34
ret i32 0
}