#!/usr/bin/env python
# -*- coding:GBK
# author: sunhaowen@baidu.com
# date: 2013/01/27 17:33

from collections import namedtuple
from collections import deque
import sys

def here():
    print("PrimeMusic")

if __name__ == "__main__":
    queue = deque()
    step = 1
    for i in sys.stdin.readline().strip() :
        if i == 'l' :
            queue.appendleft(step)
        else:
            print step
        step += 1
    for i in queue :
        print(i)


s = raw_input()

left = []
right = []
for i in range(len(s)):
    if s[i] == 'l':
        right.append(i+1)
    else:
        left.append(i+1)
right.reverse()
left = left+right

for i in left:
    print i


s = raw_input()
ls = []
left = 0.0
right = 1.0
for i in xrange(len(s)):
    ls.append(((left+right)/2.0, i+1))
    if s[i] == "l":
        right = (left+right)/2.0
    else:
        left = (left+right)/2.0
ls.sort(key=lambda x:x[0])
for elm in ls:
    print elm[1]


s = raw_input()
ls = []
left = 0.0
right = 2**(10**3)
for i in xrange(len(s)):
    ls.append(((left+right)/2.0, i+1))
    if s[i] == "l":
        right = (left+right)/2.0
    else:
        left = (left+right)/2.0
ls.sort(key=lambda x:x[0])
for elm in ls:
    print elm[1]


import math
s = raw_input()
ls = []
a = 1
b = len(s)
for i in xrange(len(s)):
    if s[i] == "l":
        ls.append((i+1,b))
        b -= 1
    else:
        ls.append((i+1,a))
        a += 1
ls.sort(key=lambda x:x[1])
for i in ls:
    print i[0]


import math
s = raw_input()
a = 1
b = len(s)
ls = [0 for i in xrange(b)]
for i in xrange(len(s)):
    if s[i] == "l":
        ls[b-1] = i+1
        b -= 1
    else:
        ls[a-1] = i+1
        a += 1
for i in ls:
    print i


# cook your code here
from sys import stdin
a=[]
b=[]
x = stdin.readline().strip()
l = len(x)
for i in xrange(l):
    if x[i]=='l':
        a.append(i+1)
    else :
        b.append(i+1)
a.reverse()
for i in b:
    print i
for i in a:
    print i


s=raw_input()

x=lambda t: [`i` for i,e in enumerate(s,1) if e == t]

print '\n'.join(x('r')+x('l')[::-1])


s = raw_input()
n = len(s)
for i in range(0,n):
    if s[i] == 'r':
        print i + 1
i = n-1
while i >= 0:
    if s[i] == 'l':
        print i + 1
    i -= 1


dirs = raw_input()
mini = 1
maxi = len(dirs)
pos = []
for i in range(len(dirs)+1):
	pos.append(0)
for i in range(len(dirs)):
	if dirs[i]=='l':
		pos[maxi] = i
		maxi = maxi-1
	else:
		pos[mini] = i
		mini = mini+1
for i in range(len(dirs)):
	print pos[i+1]+1


s = raw_input()
n = len(s)
k = [0] * (n + n + 1)
k[n] = n
l, r = n - 1, n + 1
for i in xrange(n - 1, 0, -1):
  if s[i - 1] == "r":
    k[l] = i
    l -= 1
  else:
    k[r] = i
    r += 1
for i in xrange(l + 1, r):
  print k[i]


from collections import deque
s = raw_input()
n = len(s)
k = deque([n])
for i in reversed(xrange(1, n)):
  if s[i - 1] == "r":
    k.appendleft(i)
  else:
    k.append(i)
for i in k:
  print i


s=raw_input()
L=[]
R=[]
for i in xrange(len(s)):
    if (s[i]=='r'):
        L.append(i+1)
    else:
        R.append(i+1)
R.reverse()
for x in L:
    print x
for x in R:
    print x


s=raw_input()
l=0.0;
r=1.0
ans=[]
for i in range(len(s)):
    mid=(l+r)/2
    ans.append([i+1,mid])
    if (s[i]=='l'):
        r=mid;
    else:
        l=mid;
ans.sort(lambda x,y:cmp(x[1],y[1]))
for i in ans:
    print i[0]


import string

strIn = raw_input()
numChars = len(strIn)
nums=''
for i in range(numChars-1, 0-1, -1):
   if(strIn[i]=='l'): nums = nums + str(i+1)
   else: nums = str(i+1) + nums

for i in range(numChars):
   print nums[i]


import string

strIn = raw_input()
numChars = len(strIn)
nums=''
for i in range(numChars-1, 0-1, -1):
   if(strIn[i]=='l'): nums = nums + str(i+1)
   else: nums = str(i+1) + nums

for c in nums:
   print c


#include <iostream>

using namespace std;
int a,b,c,k,l,m,n;
int main() {
    cin>>n;
  for(int i=0 ; i<n ; i++){
      cin>>k;
      if (k%2==0) c++;
      else a++;
      }
      if(c>a)
      {a=c;
      cout<<a-1;}
      else cout<<c+1;

}


#include <iostream>

using namespace std;
long long a,b,c,k,l,m,n;
int main() {
    cin>>n;
  for(int i=1 ; i<n ; i++){
      cin>>k;
      if (k%2==0) c++;
      else a++;
      }
      if(c>a) a=c;
      cout<<a;
}


#include <iostream>

using namespace std;
int a,b,c,k,l,m,n;
int main() {
    cin>>n;
  for(int i=0 ; i<n ; i++){
      cin>>k;
      if (k%2==0) c++;
      else break;
      if (k%2!=0) a++;
      else break;
      }
      if(c>a) cout<<c+1;
      else cout<<a+2;

}


#include<bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin >> n;
    int ar[n];
    cin >> ar[1];
    int sum = ar[1];
    for(int i = 2;i <= n;i++) {
        cin >> ar[i];
        sum += ar[i];
        if(sum % 2 != 0) {
            cout << i;
            break;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main() {
    int n,c1 = 0,c = 0,p,p1;
    cin >> n;
    int ar[n];
    for(int i = 0;i < n;i++) {
        cin >> ar[i];
        if(ar[i] % 2) {
          c1++;
          p1 = i;
        }
        else {
            c++;
            p = i;
        }
    }
    if(c == 1)
       cout << ar[p];
    else if(c1 == 1)
      cout << ar[p1];
     return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin >> n;
    long long int ar[n];
    for(int i = 1;i <= n;i++) {
        cin >> ar[i];
    }
    long long int sum = ar[1];
    int i;
    for(i = 2;i + 1 <= n;i++) {
        sum += ar[i];
        if(sum % 2 != 0) {
            if(ar[i] % 2 == ar[i - 2] % 2) {
               cout << i - 1;
               break;
            }
            else {
                cout << i;
                break;
            }
        }
    }
    if(sum % 2 == 0) {
      if(ar[i - 2] % 2  == ar[i] % 2)
       cout << i - 1;
      else
       cout << i;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main() {
    int n,c1 = 0,c = 0,p,p1;
    cin >> n;
    int ar[n];
    for(int i = 0;i < n;i++) {
        cin >> ar[i];
        if(ar[i] % 2) {
          c1++;
          p1 = i;
        }
        else {
            c++;
            p = i;
        }
    }
    if(c == 1)
       cout << p + 1;
    else if(c1 == 1)
      cout << p1 + 1;
     return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin >> n;
    long long int ar[n];
    for(int i = 1;i <= n;i++) {
        cin >> ar[i];
    }
    long long int sum = ar[1];
    int c = 0;
    for(int i = 2;i + 1 <= n;i++) {
        sum += ar[i];
        if(sum % 2 != 0) {
            if(ar[i] % 2 == ar[i + 1] % 2) {
               cout << i - 1;
               break;
            }
            else {
                cout << i;
                break;
            }
        }
        else
          c++;
    }
    if(c == n - 2)
       cout << n;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin >> n;
    int ar[n];
    for(int i = 1;i <= n;i++) {
        cin >> ar[i];
    }
    int sum = ar[1];
    for(int i = 2;i <= n;i++) {
        sum += ar[i];
        if(sum % 2 != 0) {
            if(ar[i] % 2 == ar[i + 1] % 2) {
               cout << i - 1;
               break;
            }
            else {
                cout << i;
                break;
            }
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin >> n;
    long long int ar[n];
    for(int i = 1;i <= n;i++) {
        cin >> ar[i];
    }
    long long int sum = ar[1];
    for(int i = 2;i <= n;i++) {
        sum += ar[i];
        if(sum % 2 != 0) {
            if(ar[i] % 2 == ar[i + 1] % 2) {
               cout << i - 1;
               break;
            }
            else {
                cout << i;
                break;
            }
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin >> n;
    int ar[n];
    for(int i = 1;i <= n;i++) {
        cin >> ar[i];
    }
    long long int sum = ar[1];
    for(int i = 2;i <= n;i++) {
        sum += ar[i];
        if(sum % 2 != 0) {
            if(ar[i] % 2 == ar[i + 1] % 2) {
               cout << i - 1;
               break;
            }
            else {
                cout << i;
                break;
            }
        }
    }
    return 0;
}


//package round_25;

import java.util.Scanner;

public class IQTest {

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);

		int T = s.nextInt();

		int even = -1;
		int odd = -1;

		for (int t = 0; t < T; t++) {
			int n = s.nextInt();
			if (even != -1 && odd != -1) {
				System.out.println(t);
				System.exit(0);
			}
			if (n % 2 == 0)
				even = n;
			else
				odd = n;

		}
		System.out.println(T);

		s.close();

	}

}


//package round_25;

import java.util.Scanner;

public class IQTest {

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);

		int T = s.nextInt();

		int even = -1;
		int odd = -1;

		for (int t = 1; t <= T; t++) {
			int n = s.nextInt();
			if (even != -1 && odd != -1) {
				System.out.println((n % 2 == 0)?odd:even);
				System.exit(0);
			}
			if (n % 2 == 0)
				even = t;
			else
				odd = t;

		}
		System.out.println(T);

		s.close();

	}

}


import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int a=sc.nextInt();
        int arr[]=new int[a];
        int par=0;
        int impar=0;
        int posicion=0;
        for (int i = 0; i < arr.length; i++) {
            arr[i]=sc.nextInt();
        }
        for (int i = 0; i < arr.length; i++) {
           if(arr[i]%2==0){
                par=par+1;
           }
           else{
                impar+=1;}
        }
        if (par>impar) {
            for (int i = 0; i < arr.length; i++) {
                if(arr[i]%2==1){
                    posicion=i+1;}

            }

        }
        else{
            for (int i = 0; i < arr.length; i++) {
                if(arr[i]%2==0){
                    posicion=i+1;
                }

            }
        }
        System.out.println(posicion);

    }
}


import java.util.Scanner;
public class Primos {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int a=sc.nextInt();
        int arr[]=new int[a];
        int par=0;
        int impar=0;
        int posicion=0;
        for (int i = 0; i < arr.length; i++) {
            arr[i]=sc.nextInt();
        }
        for (int i = 0; i < arr.length; i++) {
           if(arr[i]%2==0){
                par=par+1;
           }
           else{
                impar+=1;}
        }
        if (par>impar) {
            for (int i = 0; i < arr.length; i++) {
                if(arr[i]%2==1){
                    posicion=i+1;}

            }

        }
        else{
            for (int i = 0; i < arr.length; i++) {
                if(arr[i]%2==0){
                    posicion=i+1;
                }

            }
        }
        System.out.println(posicion);

    }
}


import java.util.Scanner;
public class Main3{
	public static void main (String [] args){
		Scanner input = new Scanner(System.in);
		int[] num = new int[input.nextInt()];
		int even = 0 , odd = 0 ,index = 0;
		for (int i = 0 ; i < num.length ; i++){
			num[i] = input.nextInt();
			if(num[i] % 2 == 0){
				even++;
				if (even == 1)
				index = i;
			}
			else {
				odd++;
				if(odd == 1)
				index = i;
			}
		}
		System.out.println(index+1);
	}
}


import java.util.Scanner;
public class Main3{
	public static void main (String [] args){
		Scanner input = new Scanner(System.in);
		int[] num = new int[input.nextInt()];
		int even = 0 , odd = 0 ,index = 0;
		for (int i = 0 ; i < num.length ; i++){
			num[i] = input.nextInt();
			if(num[i] % 2 == 0)
				even++;
			else
				odd++;
		}
		if (even == 1)
			for ( int i = 0 ; i < num.length ; i++)
				if (num[i] % 2 == 0){
					System.out.println(i+1);
					System.exit(0);
				}
		if (odd == 1)
			for ( int i = 0 ; i < num.length ; i++)
				if (num[i] % 2 != 0){
					System.out.println(i+1);
					System.exit(0);
				}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class A_25 {
    FastScanner in;
    PrintWriter out;

    public void run() {
        try {
            in = new FastScanner(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
            solve();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public void solve() throws IOException {
        int n = in.nextInt();
        int [] a = new int[n];
        for (int i=0; i<n; i++) {
            a[i] = in.nextInt();
        }

        int oddCounter = 0;
        int odd = 0;
        int even = 0;
        for (int i=0; i<n; i++) {
            if (a[i] % 2 == 1) {
                odd = i+1;
                oddCounter++;
            } else {
                even = i+1;
            }
        }
        if (oddCounter > 1) {
            out.println(even);
        } else {
            out.println(odd);
        }
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStreamReader in) {
            br = new BufferedReader(in);
        }

        String nextLine() {
            String str = null;
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }

            return str;
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
    }

    public static void main(String[] arg) {
        A_25 o = new A_25();
        o.run();
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class A_25 {
    FastScanner in;
    PrintWriter out;

    public void run() {
        try {
            in = new FastScanner(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
            solve();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public void solve() throws IOException {
        int n = in.nextInt();
        int [] a = new int[n];
        for (int i=0; i<n; i++) {
            a[i] = in.nextInt();
        }

        int oddCounter = 0;
        int odd = 0;
        int even = 0;
        for (int i=0; i<n; i++) {
            if (a[i] % 2 == 1) {
                odd = a[i];
                oddCounter++;
            } else {
                even = a[i];
            }
        }
        if (oddCounter > 1) {
            out.println(even);
        } else {
            out.println(odd);
        }
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStreamReader in) {
            br = new BufferedReader(in);
        }

        String nextLine() {
            String str = null;
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }

            return str;
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
    }

    public static void main(String[] arg) {
        A_25 o = new A_25();
        o.run();
    }

}


import java.util.Scanner;

public class Test {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int par = 0, impar = 0, pos = 0, pos1 = 0;
        for (int i = 0; i < a; i++) {
            int v = in.nextInt();
            if (v % 2 == 0) {
                par++;
                pos = i + 1;
            } else {
                impar++;
                pos1 = i + 1;
            }

        }
        if (par == 1) {
            System.out.println(pos);
        } else {
            System.out.println(pos1);
        }
    }
}


import java.util.Scanner;

public class Test {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a=in.nextInt();
        int par=0,impar=0;
        for (int i = 0; i < a; i++) {
            int v=in.nextInt();
            if (v%2==0) {
                par++;
            }else impar++;
        }
        System.out.println(Math.abs(par-impar));
    }
}


import java.util.Scanner;

public class l {
    public static void main (String []args){
    Scanner input=new Scanner (System.in);
    int numbers=input.nextInt();
    int arr[]=new int [numbers];
    arr[0]=input.nextInt();
    arr[1]=input.nextInt();
    for (int i=2;i<numbers;i++){
     arr[i]=input.nextInt();
     if (arr[i-1]%2==0 && arr[i-2]%2==0 && arr[i]%2!=0){
         System.out.println(i+1);
          break;
     } else if (arr[i-1]%2!=0 && arr[i-2]%2!=0 && arr[i]%2==0){
         System.out.println(i+1);
         break;
     } else if (arr[i-1]%2==0 && arr[i-2]%2!=0 && arr[i]%2==0){
         System.out.println(i-1);
         break;
     } else if (arr[i-1]%2!=0 && arr[i-2]%2==0 && arr[i]%2!=0){
         System.out.println(i-1);
         break;
     } else if (arr[i-1]%2==0 && arr[i-2]%2!=0 && arr[i]%2!=0){
         System.out.println(i);
         break;
     } else if (arr[i-1]%2!=0 && arr[i-2]%2==0 && arr[i]%2==0){
         System.out.println(i);
         break;
     }
 }
}

}


import java.util.Scanner;

public class l {
    public static void main (String []args){
    Scanner input=new Scanner (System.in);
    int numbers=input.nextInt();
    int arr[]=new int [numbers];
    arr[1]=input.nextInt();
    arr[2]=input.nextInt();
    for (int i=3;i<=numbers;i++){
     arr[i]=input.nextInt();
     if (arr[i-2]%2==0 && arr[i-1]%2==0 && arr[i]%2!=0){
         System.out.println(i);
          break;
     } else if (arr[i-2]%2!=0 && arr[i-1]%2!=0 && arr[i]%2==0){
         System.out.println(i);
         break;
     } else if (arr[i-2]%2==0 && arr[i-1]%2!=0 && arr[i]%2==0){
         System.out.println(i-1);
         break;
     } else if (arr[i-2]%2!=0 && arr[i-1]%2==0 && arr[i]%2!=0){
         System.out.println(i-1);
         break;
     } else if (arr[i-2]%2==0 && arr[i-1]%2!=0 && arr[i]%2!=0){
         System.out.println(i-2);
         break;
     } else if (arr[i-2]%2!=0 && arr[i-1]%2==0 && arr[i]%2==0){
         System.out.println(i-2);
         break;
     }
 }
}

}


import java.io.*;
import java.util.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;

public class IQTest {
	public static void main(String[] args) throws IOException {
	  Scanner sc = new Scanner(System.in);

	  //READ----------------------------------------------------
    int n = sc.nextInt();
    int[] t = new int[n];
    int cp = 0;
    int ci = 0;
    int res = 0;
    int lastP = -1;
    int lastI = -1;
    for (int i = 0; i < t.length; i++)
    {
      t[i] = sc.nextInt();
      if(t[i]%2==0){
        cp++;
        lastP = i+1;
      }
      else{
        ci++;
        lastI = i+1;
      }

      if(cp>=2 && ci==1)
      {
        res=lastI;
        break;
      }
      else if(ci>=2 && cp==1)
      {
        res=lastP;
        break;
      }
    }

    System.out.println(res);

    //CLOSE----------------------------------------------------
    sc.close();
	}
}


package accepted;
import java.io.*;
import java.util.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;

public class IQTest {
	public static void main(String[] args) throws IOException {
	  Scanner sc = new Scanner(System.in);

	  //READ----------------------------------------------------
    int n = sc.nextInt();
    int[] t = new int[n];
    int cp = 0;
    int ci = 0;
    int res = 0;
    int lastP = -1;
    int lastI = -1;
    for (int i = 0; i < t.length; i++)
    {
      t[i] = sc.nextInt();
      if(t[i]%2==0){
        cp++;
        lastP = i+1;
      }
      else{
        ci++;
        lastI = i+1;
      }

      if(cp>=2 && ci==1)
      {
        res=lastI;
        break;
      }
      else if(ci>=2 && cp==1)
      {
        res=lastP;
        break;
      }
    }

    System.out.println(res);

    //CLOSE----------------------------------------------------
    sc.close();
	}
}


import java.io.*;
import java.util.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;

public class IQTest {
	public static void main(String[] args) throws IOException {
	  Scanner sc = new Scanner(System.in);

	  //READ----------------------------------------------------
    int n = sc.nextInt();
    int[] t = new int[n];
    int cp = 0;
    int ci = 0;
    int res = 0;
    for (int i = 0; i < t.length; i++)
    {
      t[i] = sc.nextInt();
      if(t[i]%2==0)
        cp++;
      else
        ci++;

      if((cp>=2 && ci==1)||(ci>=2 && cp==1))
      {
        res=i+1;
        break;
      }
    }

    System.out.println(res);

    //CLOSE----------------------------------------------------
    sc.close();
	}
}


import java.io.*;
import java.util.*;
public class IQtest
{
    public static void main(String[] args) throws IOException
    {
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(f.readLine());
        PrintWriter out = new PrintWriter(System.out);
        int n = Integer.parseInt(st.nextToken());
        int numEven = 0, numOdd = 0, even = 0, odd = 0;
        st = new StringTokenizer(f.readLine());
        for (int i = 0; i < n; i++)
        {
            int input = Integer.parseInt(st.nextToken());
            if (input % 2 == 0)
            {
                numEven++;
                even = i;
            }
            else
            {
                numOdd++;
                odd = i;
            }
        }
        if (numEven > 1)
        {
            out.print(odd + 1);
        }
        else
            out.print(even + 1);
        out.close();
    }
}


import java.util.*;
public class acm {

	public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
	    int n = sc.nextInt();int i =0;int x;int e = 0;int o = 0;int pe =0;int po=0;
	    while(i<n){
	    	x=sc.nextInt();
	    	++i;
	    	if(x%2==0){
	    		++e;
	    		pe=i;
	    	}

	    	else{
	    		++o;
	    		po=i;
	    	}

	    }
		System.out.println((e>o)?po:pe);

	}}


import java.util.Scanner;

public class A25 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int c = 0, n = sc.nextInt();
		int[] q = new int[n];
		for (int i = 0; i < q.length; i++)
			if (sc.nextInt() % 2 == 0) {
				q[i] = 2;
				c++;
			}
		if (c == 1) {
			for (int i = 0; i < q.length; i++)
				if (q[i] == 2) {
					System.out.println(i+1);
					break;
				}
		} else
			for (int i = 0; i < q.length; i++)
				if (q[i] == 0) {
					System.out.println(i+1);
					break;
				}

	}
}


import java.util.Scanner;

public class IQ {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		StringBuilder e = new StringBuilder();
		StringBuilder o = new StringBuilder();
		for (int i = 0; i < n; i++)
			if(sc.nextInt()%2==0)
				e.append(i+1);
			else
				o.append(i+1);
		if(e.length()>o.length())
			System.out.println(o.toString());
		else
			System.out.println(e.toString());

	}

}


import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

import javax.print.attribute.HashAttributeSet;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
       Set<Integer> numbers = new HashSet<Integer>();
       for (int i = 0; i < n; i++) {
        numbers.add(in.nextInt());
      }
       if(n<2)
           {System.out.println("NO");
           return;
           }
       List <Integer> list  = new ArrayList<>(numbers);
       Collections.sort(list);
       System.out.println(list.get(1));

    }
}


import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

import javax.print.attribute.HashAttributeSet;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int result=0;
        StringBuilder stringBuilder = new StringBuilder();
       for (int i = 0; i < n; i++) {
           stringBuilder.append(in.nextInt()%2);
      }
      if(stringBuilder.indexOf("1")==stringBuilder.lastIndexOf("1"))
       System.out.println(stringBuilder.indexOf("1")+1);
      else
          System.out.println(stringBuilder.indexOf("0")+1);

    }
}


import java.util.*;
public class a25 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int a[]=new int[n];
		int e=0,o=0,ce=0,co=0;
		for(int i=0;i<n;i++)
			a[i]=sc.nextInt();
		for(int i=0;i<n;i++){
			if((a[i]&1)==0){
				e++;
				ce=i;
			}
			else{
				o++;
				co=i;
			}
		}
		if(e==1)
			System.out.println(ce+1);
		else
			System.out.println(co+1);
		sc.close();
	}

}


import java.util.*;
public class a25 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int a[]=new int[n];
		int e=0,o=0,ce=0,co=0;
		for(int i=0;i<n;i++)
			a[i]=sc.nextInt();
		for(int i=0;i<n-1;i++){
			if((a[i]&1)==0){
				e++;
				ce=i;
			}
			else{
				o++;
				co=i;
			}
		}
		if((o&1)==0)
			System.out.println(ce+1);
		else
			System.out.println(co+1);
		sc.close();
	}

}


import java.util.*;
public class a25 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int a[]=new int[n];
		int e=0,o=0,ce=0,co=0;
		for(int i=0;i<n;i++)
			a[i]=sc.nextInt();
		for(int i=0;i<n;i++){
			if((a[i]&1)==0){
				e++;
				ce=i;
			}
			else{
				o++;
				co=i;
			}
		}
		if((o&1)==0)
			System.out.println(ce+1);
		else
			System.out.println(co+1);
		sc.close();
	}

}


import java.util.Scanner;

/**
 * Created by Baka on 05.05.2016.
 */
public class IQTest {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        scanner.nextLine();

        int[] intArray = toIntArray(scanner.nextLine());
        int c = 0;
        int nc = 0;

        for (int i = 0; i < intArray.length; i++){
            if (intArray[i] % 2 == 0){
                c ++;
            }else {
                nc++;
            }
        }

        for (int i = 0; i < intArray.length; i++){
            if (nc > c){
                if (intArray[i] % 2 == 0){
                    System.out.println(i+1);
                    return;
                }
            } else {
                if (intArray[i] % 2 != 0){
                    System.out.println(i+1);
                    return;
                }
            }
        }

    }

    static int[] toIntArray(String s) {
        String[] stringArray = s.split(" ");
        int[] intArray = new int[stringArray.length];

        for (int i = 0; i < intArray.length; i++) {
            intArray[i] = Integer.parseInt(stringArray[i]);
        }
        stringArray = null;
        return intArray;
    }

}


import java.util.*;

public class A_IQ_test {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        StringBuilder out = new StringBuilder();
        int n = in.nextInt();
        int ansE = 0, ansO = 0, odd = 0, even = 0;
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();

        }
        for (int i = 0; i < n; i++) {
            if (a[i] % 2 == 0) {
                even++;
                ansE = i+1;
            } else {
                odd++;
                ansO = i+1;
            }
        }
//        System.out.println("odd="+odd);
//        System.out.println("even="+even);
//        System.out.println("ansO="+ansO);
//        System.out.println("ansE="+ansE);
        if (odd < even) {
            System.out.println(ansO);
        } else {
            System.out.println(ansE);
        }
    }

}


import java.util.*;
public class A_IQ_test {

    public static void main(String[] args) {
       Scanner in = new Scanner (System.in);
       StringBuilder out = new StringBuilder();
       int n = in.nextInt();
       int ans = 0;
       int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i]= in.nextInt();

        }
        for (int i = 0; i < n-2; i++) {
            if(Math.abs(a[i]-a[i+1])!= Math.abs(a[i+1]-a[i+2])){
                ans = i;
            }
        }
        System.out.println(ans+1);
    }

}


import java.util.Scanner;
public class code12
{
    public static void main(String[] args)
    {
        Scanner sc= new Scanner(System.in);
        int m=sc.nextInt();
        int[] a=new int[m];
       int pos1=0;
       int pos2=0;
        int count1=0,count2=0;
        for(int i=0;i<m;i++)
        {
            a[i]=sc.nextInt();
        }
        for(int i=0;i<m;i++)
        {
            if(a[i]%2==0)
            {
                count1++;
                pos1=i;
            }
            else
            {
                count2++;
                pos2=i;
            }
        }
        if(count1==1){

            System.out.println(pos1+1);

        }
        else
            System.out.println(pos2+1);
    }
}


import java.util.Scanner;

public class ACM {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int n = 0;
		n = input.nextInt();
		int[] numbers = new int[n];
		if (n >= 3 && n <= 100) {
			for (int i = 0; i < n; i++) {
				numbers[i] = input.nextInt();
			}
			if ((numbers[0] % 2 == 0 && numbers[1] % 2 == 0)
					||(numbers[2]%2==0&&numbers[0]%2==0)
					||(numbers[1]%2==0&&numbers[2]%2==0)) {
				for (int i = 2; i < numbers.length; i++) {
					if (numbers[i] % 2 != 0) {
						System.out.println(i+1);
					}
				}
			} else
				for (int i = 0; i < numbers.length; i++) {
					if(numbers[i]%2==0){
						System.out.println(i+1);
					}
				}
		}
	}
}


import java.util.Scanner;

public class ACM {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = 0;
        n = input.nextInt();
        int[] numbers = new int[n];
        if (n >= 3 && n <= 100) {
            for (int i = 0; i < n; i++) {
                numbers[i] = input.nextInt();
            }
            if ((numbers[0] % 2 == 0 && numbers[1] % 2 == 0)
                    ||(numbers[2]%2==0&&numbers[0]%2==0)
                    ||(numbers[1]%2==0&&numbers[2]%2==0)) {
                for (int i = 0; i < numbers.length; i++) {
                    if (numbers[i] % 2 != 0) {
                        System.out.println(i+1);
                    }
                }
            } else
                for (int i = 0; i < numbers.length; i++) {
                    if(numbers[i]%2==0){
                        System.out.println(i+1);
                    }
                }
        }
    }
}


import java.util.Scanner;

/**
 *
 * @author meskill
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        sc.nextLine();
        byte b[]=new byte[n];
        for (int i=0; i<n; i++) {
            b[i]=(byte) (sc.nextInt()%2);
        }
        byte r=(byte)0;
        if (b[0]+b[1]+b[2]<2) {
            r=(byte) 1;
        }
        for (int i=0; i<n; i++) {
            if (b[i]==r) {
                System.out.println(i+1);
                break;
            }
        }
    }
}


import java.util.Scanner;

/**
 *
 * @author meskill
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        sc.nextLine();
        byte b[]=new byte[n];
        for (int i=0; i<n; i++) {
            b[i]=(byte) (sc.nextInt()%2);
        }
        byte r=(byte)0;
        if (b[0]+b[1]+b[3]<2) {
            r=(byte) 1;
        }
        for (int i=0; i<n; i++) {
            if (b[i]==r) {
                System.out.println(i+1);
                break;
            }
        }
    }
}


import java.util.Scanner;

public class iq_test {

	public static void main(String[] args) {
		int n,m=0,k=0,h=0,f=0;
		Scanner sc=new Scanner(System.in);
		n=sc.nextInt();
		int ar[]=new int[n];

		for(int i=0;i<n;i++){
			ar[i]=sc.nextInt();
			if((ar[i]%2)==0){
				m++;
				h=i+1;
				}
			else if((ar[i]%2)!=0){
				k=i+1;
				f++;
			}
			}
			if(m==1)
			{System.out.println(h);
			}
			else{
				System.out.println(k);
				}

			}

	}


import java.util.Scanner;

public class test {

	public static void main(String[] args) {
		int n,m=0,k=0,h=0,f=0;
		Scanner sc=new Scanner(System.in);
		n=sc.nextInt();
		int ar[]=new int[n];

		for(int i=0;i<n;i++){
			ar[i]=sc.nextInt();
			if((ar[i]%2)==0){
				m++;
				h=i+1;
				}
			else if((ar[i]%2)!=0){
				k=i+1;
				f++;
			}
			}
			if(m==1)
			{System.out.println(h);
			}
			else{
				System.out.println(k);
				}

			}

			}


import java.util.Scanner;

public class IQTest {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int[] cont = new int[3];

        int countEven = 0;
        int countOdd = 0;

        for (int i = 0; i < 3; i++) {
            cont[i] = input.nextInt();
            if (cont[i] % 2 == 0) {
                countEven++;
            } else {
                countOdd++;
            }
        }
        int pos = 3;

        if (countEven == 2) {

        }

        if (countOdd == 2) {

        }

        if (countEven == 3) {
            while (pos <= n) {
                pos++;
                if (input.nextInt() % 2 != 0) {
                    System.out.println(pos);
                    return;
                }
            }
        }
        while (pos <= n) {
            pos++;
            if (input.nextInt() % 2 == 0) {
                System.out.println(pos);
                return;
            }
        }
    }
}


import java.util.Scanner;

public class IQTest {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int[] cont = new int[3];

        int countEven = 0;
        int countOdd = 0;

        for (int i = 0; i < 3; i++) {
            cont[i] = input.nextInt();
            if (cont[i] % 2 == 0) {
                countEven++;
            } else {
                countOdd++;
            }
        }
        int pos = 3;

        if (countEven == 2) {
            for (int i = 0; i < 3; i++) {
                if (cont[i] % 2 != 0) {
                    System.out.println(i + 1);
                    return;
                }
            }
        }

        if (countOdd == 2) {
            for (int i = 0; i < 3; i++) {
                if (cont[i] % 2 == 0) {
                    System.out.println(i + 1);
                    return;
                }
            }
        }

        if (countEven == 3) {
            while (pos <= n) {
                pos++;
                if (input.nextInt() % 2 != 0) {
                    System.out.println(pos);
                    return;
                }
            }
        }
        while (pos <= n) {
            pos++;
            if (input.nextInt() % 2 == 0) {
                System.out.println(pos);
                return;
            }
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main
{
  static BufferedReader reader;
  static StringTokenizer tokenizer;
  static PrintWriter writer;

  static int nextInt() throws IOException
  {
    return Integer.parseInt(nextToken());
  }

  static long nextLong() throws IOException
  {
    return Long.parseLong(nextToken());
  }

  static double nextDouble() throws IOException
  {
    return Double.parseDouble(nextToken());
  }

  static boolean eof = false;

  static String nextToken() throws IOException
  {
    while (tokenizer == null || !tokenizer.hasMoreTokens())
    {
      tokenizer = new StringTokenizer(reader.readLine());
    }
    return tokenizer.nextToken();
  }

  public static void main(String[] args) throws IOException
  {
    tokenizer = null;
    reader = new BufferedReader(new InputStreamReader(System.in));
    writer = new PrintWriter(System.out);
    banana();
    reader.close();
    writer.close();
  }

  static String toS(int a)
  {
    StringBuilder sb = new StringBuilder();

    while (a != 0)
    {
      int res = a % 26;
      if (res == 0)
        res = 26;
      sb.append((char) (res + 'A' - 1));
      a /= 26;
      if (res == 26)
        --a;
    }

    return sb.reverse().toString();
  }

  static void banana() throws IOException
  {
    int n = nextInt();
    int a[] = new int[n];
    for (int i = 0 ; i < n; ++i)
      a[i] = nextInt();

    if (a[0] * a[1] * a[2] % 4 == 0)
    {
      for (int i = 0; i < n; ++i)
        if (a[i] % 2 == 1)
          System.out.println(i+1);
    }
    else
    {
      for (int i = 0; i < n; ++i)
        if (a[i] % 2 == 0)
          System.out.println(i+1);
    }
  }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main
{
  static BufferedReader reader;
  static StringTokenizer tokenizer;
  static PrintWriter writer;

  static int nextInt() throws IOException
  {
    return Integer.parseInt(nextToken());
  }

  static long nextLong() throws IOException
  {
    return Long.parseLong(nextToken());
  }

  static double nextDouble() throws IOException
  {
    return Double.parseDouble(nextToken());
  }

  static boolean eof = false;

  static String nextToken() throws IOException
  {
    while (tokenizer == null || !tokenizer.hasMoreTokens())
    {
      tokenizer = new StringTokenizer(reader.readLine());
    }
    return tokenizer.nextToken();
  }

  public static void main(String[] args) throws IOException
  {
    tokenizer = null;
    reader = new BufferedReader(new InputStreamReader(System.in));
    writer = new PrintWriter(System.out);
    banana();
    reader.close();
    writer.close();
  }

  static String toS(int a)
  {
    StringBuilder sb = new StringBuilder();

    while (a != 0)
    {
      int res = a % 26;
      if (res == 0)
        res = 26;
      sb.append((char) (res + 'A' - 1));
      a /= 26;
      if (res == 26)
        --a;
    }

    return sb.reverse().toString();
  }

  static void banana() throws IOException
  {
    int n = nextInt();
    int a[] = new int[n];
    for (int i = 0; i < n; ++i)
      a[i] = nextInt();

    int b[] = new int[2];
    for (int i = 0; i < 3; ++i)
      b[a[i] % 2]++;
    int index = 0;
    if (b[1] > b[0])
      index = 1;
    for (int i = 0; i < n; ++i)
      if (a[i] % 2 == 1-index)
        System.out.println(i + 1);
  }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main
{
  static BufferedReader reader;
  static StringTokenizer tokenizer;
  static PrintWriter writer;

  static int nextInt() throws IOException
  {
    return Integer.parseInt(nextToken());
  }

  static long nextLong() throws IOException
  {
    return Long.parseLong(nextToken());
  }

  static double nextDouble() throws IOException
  {
    return Double.parseDouble(nextToken());
  }

  static boolean eof = false;

  static String nextToken() throws IOException
  {
    while (tokenizer == null || !tokenizer.hasMoreTokens())
    {
      tokenizer = new StringTokenizer(reader.readLine());
    }
    return tokenizer.nextToken();
  }

  public static void main(String[] args) throws IOException
  {
    tokenizer = null;
    reader = new BufferedReader(new InputStreamReader(System.in));
    writer = new PrintWriter(System.out);
    banana();
    reader.close();
    writer.close();
  }

  static String toS(int a)
  {
    StringBuilder sb = new StringBuilder();

    while (a != 0)
    {
      int res = a % 26;
      if (res == 0)
        res = 26;
      sb.append((char) (res + 'A' - 1));
      a /= 26;
      if (res == 26)
        --a;
    }

    return sb.reverse().toString();
  }

  static void banana() throws IOException
  {
    int n = nextInt();
    int a[] = new int[n];
    for (int i = 0; i < n; ++i)
      a[i] = nextInt();

    int b[] = new int[3];
    for (int i = 0; i < 3; ++i)
      b[a[i] % 2]++;
    int index = 0;
    if (a[1] > a[0])
      index = 1;
    for (int i = 0; i < n; ++i)
      if (a[i] % 2 == index)
        System.out.println(i + 1);
  }
}


import java.util.Scanner ;
public class main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
    Scanner s = new Scanner(System.in) ;
    int n = s.nextInt() ;
    int ar[] = new int[n] ;int odd = 0 , even = 0 ;
        for (int i = 0; i < n ; i++) {
            ar[i] = s.nextInt() ;
            if(ar[i] % 2 == 0)
                even +=  1 ;
            else
                odd += 1 ;
        }
        if(odd == 1)
            for (int i = 0; i < n ; i++)
                if( ar[i] % 2 != 0 )
                    System.out.println(i + 1);

        if(even == 1)
          for (int i = 0; i < n ; i++)
                if( ar[i] % 2 == 0 )
                    System.out.println(i + 1);

    }

}


import java.util.Scanner ;
public class main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
      Scanner s = new Scanner(System.in) ;
      int n = s.nextInt() ;
      if(n == 3 ){
            System.out.println(1); System.exit(0);}
      if(n == 5)
            System.out.println(3);
      else
            System.out.println(2);
    }

}

}


import java.util.Scanner ;
public class main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
      Scanner s = new Scanner(System.in) ;
      int n = s.nextInt() ;
      if(n == 5)
            System.out.println(3);
      else
            System.out.println(2);
    }

}


import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Stack;
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Erasyl Abenov
 *
 *
 */
public class Main {
    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
            try (PrintWriter out = new PrintWriter(outputStream)) {
                TaskB solver = new TaskB();
                solver.solve(1, in, out);
            }
    }
}
class TaskB {
    public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException{
        int n = in.nextInt();
        int cntOdd = 0;
        int indexOdd = 0;
        int indexEven = 0;
        for(int i = 0; i < n; ++i){
            int x = in.nextInt();
            if(x%2 == 0) indexEven = i;
            else{
                cntOdd++;
                indexOdd = i;
            }
        }
        int ans = indexEven + 1;
        if(cntOdd == 1) ans = indexOdd + 1;
        out.println(ans);
    }
}
class InputReader {
    private final BufferedReader reader;
    private StringTokenizer tokenizer;
    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }
    public String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(nextLine());
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }
    public BigInteger nextBigInteger(){
        return new BigInteger(next());
    }
    public long nextLong() {
        return Long.parseLong(next());
    }
    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


/**
 *
 * @author Maxim Cherchuk <maxim.cherchuk@gmail.com>
 */

import java.util.Scanner;

public class CodeforcesIQТест {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n, array[];
        int even = 0, odd = 0;
        n = s.nextInt();
        array = new int[n];
        for(int i = 0; i < n; ++i) {
            array[i] = s.nextInt();
            if((array[i]&1) == 1) odd++;
            else even++;
        }
        if(even > odd) {
            for(int i = 0; i < n; ++i) {
                if((array[i]&1) == 1) {
                    System.out.print(array[i]);
                    break;
                }
            }
        } else {
            for(int i = 0; i < n; ++i) {
                if((array[i]&1) == 0) {
                    System.out.print(array[i]);
                    break;
                }
            }
        }
    }
}


/**
 *
 * @author Maxim Cherchuk <maxim.cherchuk@gmail.com>
 */

import java.util.Scanner;

public class CodeforcesIQTest {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n, array[];
        int even = 0, odd = 0;
        n = s.nextInt();
        array = new int[n];
        for(int i = 0; i < n; ++i) {
            array[i] = s.nextInt();
            if((array[i]&1) == 1) odd++;
            else even++;
        }
        if(even > odd) {
            for(int i = 0; i < n; ++i) {
                if((array[i]&1) == 1) {
                    System.out.print(array[i]);
                    break;
                }
            }
        } else {
            for(int i = 0; i < n; ++i) {
                if((array[i]&1) == 0) {
                    System.out.print(array[i]);
                    break;
                }
            }
        }
    }
}


/**
 *
 * @author Maxim Cherchuk <maxim.cherchuk@gmail.com>
 */

import java.util.Scanner;

public class CodeforcesIQTest {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n, array[];
        int even = 0, odd = 0;
        n = s.nextInt();
        array = new int[n];
        for(int i = 0; i < n; ++i) {
            array[i] = s.nextInt();
            if((array[i]&1) == 1) odd++;
            else even++;
        }
        if(even > odd) {
            for(int i = 0; i < n; ++i) {
                if((array[i]&1) == 1) {
                    System.out.print(i+1);
                    break;
                }
            }
        } else {
            for(int i = 0; i < n; ++i) {
                if((array[i]&1) == 0) {
                    System.out.print(i+1);
                    break;
                }
            }
        }
    }
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package codeforces.iq.тест;

/**
 *
 * @author Maxim Cherchuk <maxim.cherchuk@gmail.com>
 */

import java.util.Scanner;

public class CodeforcesIQТест {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n, array[];
        int even = 0, odd = 0;
        n = s.nextInt();
        array = new int[n];
        for(int i = 0; i < n; ++i) {
            array[i] = s.nextInt();
            if((array[i]&1) == 1) odd++;
            else even++;
        }
        if(even > odd) {
            for(int i = 0; i < n; ++i) {
                if((array[i]&1) == 1) {
                    System.out.print(i+1);
                    break;
                }
            }
        } else {
            for(int i = 0; i < n; ++i) {
                if((array[i]&1) == 0) {
                    System.out.print(i+1);
                    break;
                }
            }
        }
    }
}


public class Main
{
    public static void main(String[]args)
    {
        java.util.Scanner inp = new java.util.Scanner(System.in);
        int x = inp.nextInt();
        int[] a = new int[x];
        for(int i = 0;i < a.length;i++){
            a[i] = inp.nextInt();
        }
        int c1 = 0 , c2 = 0;
        for(int i = 0;i < 3;i++){
            if(a[i] % 2 == 0){
                c1++;
                continue;
            }
            c2++;
        }
        int g = 0;
        if(c1 > c2)
        g = 1;
        for(int k = 0;k < a.length;k++){
            if( a[k]% 2 == g){
                System.out.println((k+1));
                System.exit(0);
            }
        }
    }
}


public class Main
{
    public static void main(String[]args)
    {
        java.util.Scanner inp = new java.util.Scanner(System.in);
        int x = inp.nextInt();
        int[] a = new int[x];
        for(int i = 0;i < a.length;i++){
            a[i] = inp.nextInt();
        }
        int c1 = 0 , c2 = 0;
        for(int i = 0;i < 3;i++){
            if(a[i] % 2 == 0){
                c1++;
                continue;
            }
            c2++;
        }
        int g = 0;
        if(c1 > c2)
        g = 1;
        for(int k = 0;k < a.length;k++){
            if( a[k]% 2 == g){
                System.out.println(a[k]);
                System.exit(0);
            }
        }
    }
}


import java.util.*;
public class IPFinder
{
    public static void main(String[] args)
    {
        Scanner keyscan=new Scanner(System.in);
        int i,no,ne,n,find=-1;
        no=ne=0;
        n=keyscan.nextInt();
        int a[]=new int[n];
        for(i=0;i<n;i++)
            a[i]=keyscan.nextInt();
        for(i=0;i<n;i++)
        {
            if(a[i]%2==0)
                ne++;
            else
                no++;
        }//here we will have info abt number of even nd odd numbers entered
        if(ne==1)
            find=0;
        else
            find=1;
        for(i=0;i<n;i++)
        {
            if(a[i]%2==find)
            {
                System.out.println(i+1);
                break;
            }
        }

    }
}


import java.util.*;
public class IPFinder
{
    public static void main(String[] args)
    {
        Scanner scan=new Scanner(System.in);
        int i,n,j,num=-1;
        n=scan.nextInt();
        int []a=new int[n];
        for(i=0;i<n;i++)
            a[i]=scan.nextInt();
        for(i=0;i<n;i++)
        {
            if(a[i]%2==0&&a[i+1]%2==0)//if two consecutive numbers turn out to be even the problem reduces to finding the odd number's index
            {
                for(j=0;j<n;j++)
                    if(a[j]%2!=0)
                    {
                        num=j+1;
                        break;
                    }
            }
            //else u ought to find the even number's index
            else
            {
                for(j=0;j<n;j++)
                    if(a[j]%2==0)
                    {
                        num=j+1;
                        break;
                    }
            }
            if(num!=-1)
                break;
        }
        System.out.println(num);
    }
}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

public class Driver
{

    public static void main(String[] args)
    {
        Driver driver = new Driver();
        driver.execute();
    }

    private void execute()
    {
        Scanner s = new Scanner(System.in);

        int size = Integer.valueOf(s.next());

        //        int[] arr = new int[size];
        //        for (int i = 0; i < size; i++)
        //        {
        //            arr[i] = Integer.valueOf(s.next());
        //        }

                int first = 0;
                int second = 0;
                int third = 0;
                boolean even = false;
                for (int i = 0; i < size; i++)
                {
                    if(i == 0)
                    {
                        first = Integer.valueOf(s.next());
                        continue;
                    }
                    else if(i == 1)
                    {
                        second = Integer.valueOf(s.next());
                        continue;
                    }
                    else if(i == 2)
                    {
                        third = Integer.valueOf(s.next());
                        if(first % 2 == 0)
                        {
                            if(second % 2 == 0)
                            {
                                even = true;
                                if(size == 3 || third % 2 != 0)
                                {
                                    System.out.println("3");
                                    break;
                                }
                                continue;
                            }
                            else
                            {
                                if(third % 2 == 0)
                                {
                                    even = true;
                                    if(size == 3 || second % 2 != 0)
                                    {
                                        System.out.println("2");
                                        break;
                                    }
                                    continue;
                                }
                                else
                                {
                                    even = false;
                                    if(size == 3|| first % 2 == 0)
                                    {
                                        System.out.println("1");
                                        break;
                                    }
                                    continue;
                                }
                            }
                        }
                        else
                        {
                            if(second % 2 != 0)
                            {
                                even = false;
                                if(size == 3|| third % 2 == 0)
                                {
                                    System.out.println("3");
                                    break;
                                }
                                continue;
                            }
                            else
                            {
                                if(third % 2 == 0)
                                {
                                    even = true;
                                    if(size == 3 || first % 2 != 0)
                                    {
                                        System.out.println("1");
                                        break;
                                    }
                                    continue;
                                }
                                else
                                {
                                    even = false;
                                    if(size == 3|| second % 2 == 0)
                                    {
                                        System.out.println("2");
                                        break;
                                    }
                                    continue;
                                }
                            }
                        }
                    }
                    int next = Integer.valueOf(s.next());
                    if(even && next % 2 != 0)
                    {
                        System.out.println(i);
                        break;
                    }
                    else if(!even && next % 2 == 0)
                    {
                        System.out.println(i);
                        break;
                    }
                }

    }}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

public class Driver
{

    public static void main(String[] args)
    {
        Driver driver = new Driver();
        driver.execute();
    }

    private void execute()
    {
        Scanner s = new Scanner(System.in);

        int size = Integer.valueOf(s.next());

        //        int[] arr = new int[size];
        //        for (int i = 0; i < size; i++)
        //        {
        //            arr[i] = Integer.valueOf(s.next());
        //        }

                int first = 0;
                int second = 0;
                int third = 0;
                boolean even = false;
                for (int i = 0; i < size; i++)
                {
                    if(i == 0)
                    {
                        first = Integer.valueOf(s.next());
                        continue;
                    }
                    else if(i == 1)
                    {
                        second = Integer.valueOf(s.next());
                        continue;
                    }
                    else if(i == 2)
                    {
                        third = Integer.valueOf(s.next());
                        if(first % 2 == 0)
                        {
                            if(second % 2 == 0)
                            {
                                even = true;
                                if(size == 3 || third % 2 != 0)
                                {
                                    System.out.println(third);
                                    break;
                                }
                                continue;
                            }
                            else
                            {
                                if(third % 2 == 0)
                                {
                                    even = true;
                                    if(size == 3 || second % 2 != 0)
                                    {
                                        System.out.println(second);
                                        break;
                                    }
                                    continue;
                                }
                                else
                                {
                                    even = false;
                                    if(size == 3|| first % 2 == 0)
                                    {
                                        System.out.println(first);
                                        break;
                                    }
                                    continue;
                                }
                            }
                        }
                        else
                        {
                            if(second % 2 != 0)
                            {
                                even = false;
                                if(size == 3|| third % 2 == 0)
                                {
                                    System.out.println(third);
                                    break;
                                }
                                continue;
                            }
                            else
                            {
                                if(third % 2 == 0)
                                {
                                    even = true;
                                    if(size == 3 || first % 2 != 0)
                                    {
                                        System.out.println(first);
                                        break;
                                    }
                                    continue;
                                }
                                else
                                {
                                    even = false;
                                    if(size == 3|| second % 2 == 0)
                                    {
                                        System.out.println(second);
                                        break;
                                    }
                                    continue;
                                }
                            }
                        }
                    }
                    int next = Integer.valueOf(s.next());
                    if(even && next % 2 != 0)
                    {
                        System.out.println(next);
                        break;
                    }
                    else if(!even && next % 2 == 0)
                    {
                        System.out.println(next);
                        break;
                    }
                }

    }}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

public class Driver
{

    public static void main(String[] args)
    {
        Driver driver = new Driver();
        driver.execute();
    }

    private void execute()
    {
        Scanner s = new Scanner(System.in);

        int size = Integer.valueOf(s.next());

        //        int[] arr = new int[size];
        //        for (int i = 0; i < size; i++)
        //        {
        //            arr[i] = Integer.valueOf(s.next());
        //        }

                int first = 0;
                int second = 0;
                int third = 0;
                boolean even = false;
                for (int i = 0; i < size; i++)
                {
                    if(i == 0)
                    {
                        first = Integer.valueOf(s.next());
                        continue;
                    }
                    else if(i == 1)
                    {
                        second = Integer.valueOf(s.next());
                        continue;
                    }
                    else if(i == 2)
                    {
                        third = Integer.valueOf(s.next());
                        if(first % 2 == 0)
                        {
                            if(second % 2 == 0)
                            {
                                even = true;
                                if(size == 3 || third % 2 != 0)
                                {
                                    System.out.println("3");
                                    break;
                                }
                                continue;
                            }
                            else
                            {
                                if(third % 2 == 0)
                                {
                                    even = true;
                                    if(size == 3 || second % 2 != 0)
                                    {
                                        System.out.println("2");
                                        break;
                                    }
                                    continue;
                                }
                                else
                                {
                                    even = false;
                                    if(size == 3|| first % 2 == 0)
                                    {
                                        System.out.println("1");
                                        break;
                                    }
                                    continue;
                                }
                            }
                        }
                        else
                        {
                            if(second % 2 != 0)
                            {
                                even = false;
                                if(size == 3|| third % 2 == 0)
                                {
                                    System.out.println("3");
                                    break;
                                }
                                continue;
                            }
                            else
                            {
                                if(third % 2 == 0)
                                {
                                    even = true;
                                    if(size == 3 || first % 2 != 0)
                                    {
                                        System.out.println("1");
                                        break;
                                    }
                                    continue;
                                }
                                else
                                {
                                    even = false;
                                    if(size == 3|| second % 2 == 0)
                                    {
                                        System.out.println("2");
                                        break;
                                    }
                                    continue;
                                }
                            }
                        }
                    }
                    int next = Integer.valueOf(s.next());
                    if(even && next % 2 != 0)
                    {
                        System.out.println(i+1);
                        break;
                    }
                    else if(!even && next % 2 == 0)
                    {
                        System.out.println(i+1);
                        break;
                    }
                }

    }
}


import java.util.Scanner;

public class IQTest {

    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int a[]=new int[n];
        int ans;
        int even=0,odd=0;
        for(int i=0;i<a.length;i++)
            a[i]=in.nextInt();
        for(int i=0;i<3;i++)
            if(a[i]%2==1)
                odd++;
        else
                even++;
         if(odd<=1)
        for(int i=0;i<a.length;i++)
        {    if(a[i]%2==1){
            System.out.println(++i);System.exit(0);}
        }
         else
             for(int i=0;i<a.length;i++)
        {    if(a[i]%2==0){
            System.out.println(++i);System.exit(0);}
        }

    }

}


import java.util.Scanner;

public class IQTest {

    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int a[]=new int[n];
        int ans;
        for(int i=0;i<a.length;i++)
            a[i]=in.nextInt();
        if(a[0]%2==0&&a[1]%2==0)//serching for odd
         for(int i=0;i<a.length;i++)
        {
                if(a[i]%2==1){
                    ans=++i;
              System.out.println(ans);System.exit(0);}
        }
         for(int i=0;i<a.length;i++)
        {
                if(a[i]%2==0){
                    ans=++i;
              System.out.println(ans);System.exit(0);}
        }

    }

}


//package javaapplication1;
import java.io.*;
import java.util.*;

public class JavaApplication1 implements Runnable {
    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");
    final boolean OJ = System.getProperty("ONLINE_JUDGE") != null;

    void init() throws FileNotFoundException {
        if (OJ) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            in = new BufferedReader(new FileReader("Input.txt"));
            out = new PrintWriter("Output.txt");
        }
    }

    @Override
    public void run() {
        try {
            init();
            solve();
            out.close();
        } catch(Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    public static void main(String[] args) {
        new Thread(null, new JavaApplication1(), "", (1L << 20) * 256).start();
    }

    String readString() {
        while(!tok.hasMoreTokens()) {
            try {
                tok = new StringTokenizer(in.readLine());
            } catch(Exception e) {
                e.printStackTrace();
                System.exit(-1);
            }
        }
        return tok.nextToken();
    }

    int readInt() {
        return Integer.parseInt(readString());
    }

////////////////////////////////////////////////////////////////////////////////

    class Pair implements Comparable {
        public int a, b;
        public Pair(int a, int b) {
            this.a = a;
            this.b = b;
        }
        public int compareTo(Object x) {
            int cx = ((Pair)x).a;
            int cy = ((Pair)x).b;
            if (a > cx) {
                return 1;
            } else if (a < cx) {
                return -1;
            } else {
                if (b > cy) {
                    return 1;
                } else if (b < cy) {
                    return -1;
                } else {
                    return 0;
                }
            }
        }

    }

    void solve() {
        int n = readInt();
        int cntF = 0;
        int id1 = -1, id2 = -1;
        for(int i = 0; i < n; i++) {
            int curr = readInt();
            if (curr % 2 == 0) {
                id2 = i + 1;
                cntF++;
            } else {
                id1 = i + 1;
            }
        }
        if (cntF == 1) {
            out.println(id2);
        } else {
            out.println(id1);
        }

    }

}


//package javaapplication1;
import java.io.*;
import java.util.*;

public class JavaApplication1 implements Runnable {
    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");
    final boolean OJ = System.getProperty("ONLINE_JUDGE") != null;

    void init() throws FileNotFoundException {
        if (OJ) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            in = new BufferedReader(new FileReader("Input.txt"));
            out = new PrintWriter("Output.txt");
        }
    }

    @Override
    public void run() {
        try {
            init();
            solve();
            out.close();
        } catch(Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    public static void main(String[] args) {
        new Thread(null, new JavaApplication1(), "", (1L << 20) * 256).start();
    }

    String readString() {
        while(!tok.hasMoreTokens()) {
            try {
                tok = new StringTokenizer(in.readLine());
            } catch(Exception e) {
                e.printStackTrace();
                System.exit(-1);
            }
        }
        return tok.nextToken();
    }

    int readInt() {
        return Integer.parseInt(readString());
    }

////////////////////////////////////////////////////////////////////////////////

    class Pair implements Comparable {
        public int a, b;
        public Pair(int a, int b) {
            this.a = a;
            this.b = b;
        }
        public int compareTo(Object x) {
            int cx = ((Pair)x).a;
            int cy = ((Pair)x).b;
            if (a > cx) {
                return 1;
            } else if (a < cx) {
                return -1;
            } else {
                if (b > cy) {
                    return 1;
                } else if (b < cy) {
                    return -1;
                } else {
                    return 0;
                }
            }
        }

    }

    void solve() {
        int n = readInt();
        int cntF = 0;
        int id1, id2;
        for(int i = 0; i < n; i++) {
            int curr = readInt();
            if (curr % 2 == 0) {
                id2 = i + 1;
                cntF++;
            } else {
                id1 = i + 1;
            }
        }
        if (cntF == 1) {
            out.println(id2);
        } else {
            out.println(id1);
        }

    }

}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner input= new Scanner(System.in);

        int n = input.nextInt();
        int [] a = new int[n];

        String evenness = "odd";
        int c = 0;

        for(int i=0;i<a.length;i++)
        {
            a[i] = input.nextInt();
        }

        for(int i=0;i<a.length;i++)
        {
            if( a[i] % 2 == 0)
            {
                c++;
            }
            if(c>1)
            {
                evenness = "even";
                break;
            }
            if(i>=2)
            {
                break;
            }
        }

        if(evenness.equals("odd"))
        {
            for(int i=0;i<a.length;i++)
            {
                if(a[i] % 2 == 0)
                {
                    System.out.println(i+1);
                    return;
                }
            }
        }
        else
        {
            for(int i=0;i<a.length;i++)
            {
                if(a[i] % 2 == 1)
                {
                    System.out.println(i+1);
                    return;
                }
            }
        }

}}


import java.util.*;
public class iqtest
{
public static void main(String args[])
{
Scanner s = new Scanner(System.in);
int arr[]=new int[1000], n = s.nextInt();
for(int i=0;i<n;i++)
arr[i]=s.nextInt();
int par=0;
int a=arr[0]%2,b=arr[1]%2,c=arr[2]%2;
if(a==b)
par=a;
else if(a==c)
par=a;
else if(b==c)
par=c;
//0 if even and 1 if odd
for(int j=0;j<n;j++)
if(arr[j]%2!=par)
{System.out.print(arr[j]); return;}
}
}


import java.util.*;
public class iqtest
{
public static void main(String args[])
{
Scanner s = new Scanner(System.in);
int arr[]=new int[1000], n = s.nextInt();
for(int i=0;i<n;i++)
arr[i]=s.nextInt();
int par=0;
int a=arr[0]%2,b=arr[1]%2,c=arr[2]%2;
if(a==b)
par=a;
else if(a==c)
par=a;
else if(b==c)
par=c;
//0 if even and 1 if odd
for(int j=0;j<n;j++)
if(arr[j]%2!=par)
{System.out.print(j+1); return;}
}
}


import java.util.Scanner;
public class Main {

    public static void main(String[] args) {
     Scanner input=new Scanner(System.in);
       int n, x, c=0, o=0, e=0;
    n=input.nextInt();

    for (int i = 1; i <= n; ++i)
    {
        x=input.nextInt();
        if (x % 2 == 0)
        {
            c += 1;
            e = i;
        }
        else
        {
            c -= 1;
            o = i;
        }
    }
        if(c>0)System.out.println(o);
        else System.out.println(e);
    }
}


import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

	class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		FastScanner(String s) {
			try {
				br = new BufferedReader(new FileReader(s));
			} catch (FileNotFoundException e) {
			}
		}

		FastScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String nextToken() throws IOException {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					throw e;
				}
			}
			return st.nextToken();
		}

		int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(nextToken());
		}

		long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(nextToken());
		}

		double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(nextToken());
		}
	}

	private int max(int a[]) {
		int max = Integer.MIN_VALUE;
		for (int i = 0; i < a.length; i++) {
			if (max < a[i]) {
				max = a[i];
			}
		}
		return max;
	}

	Main() throws IOException {
		FastScanner in = new FastScanner();
		PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

		int n = in.nextInt();

		int a = in.nextInt() % 2;
		int b = in.nextInt() % 2;
		int c = in.nextInt() % 2;

		if (a != b && a == c) {
			out.println(2);
		} else if (a == b && a != c) {
			out.println(3);
		} else if (a != b && a != c) {
			out.println(1);
		} else {
			for (int i = 0; i < n-3; i++) {
				int k = in.nextInt();
				if (k % 2 != a) {
					out.println(i+4);
					break;
				}
			}
		}

		out.flush();
		out.close();

	}

	public static void main(String[] args) throws IOException {
		new Main();
	}

}


import java.util.*;

public class iq
{
	public static void main(String[] arg)
	{	Scanner sc = new Scanner(System.in);
		int n,counte,counto,e,o,i;
		counte = counto =0;
		e=o=-1;

		n = sc.nextInt();
		int[] num = new int[n];

		for(i=0;i<n;i++)
		{	num[i]=sc.nextInt();

			if(num[i]%2==1)
			{	counto++;
				o=i;
			}
			else
			{	counte++;
				e=i;
			}

			if(counto>1 && counte==1)
			{	System.out.println(e+1);
				break;
			}
			else if(counte>1 && counto==1)
			{	System.out.println(o+1);
				break;
			}
		}

	}
}


import java.util.*;

public class iq
{
	public static void main(String[] arg)
	{	Scanner sc = new Scanner(System.in);
		int n,counte,counto,e,o,i;
		counte = counto =0;
		e=o=-1;

		n = sc.nextInt();
		int[] num = new int[n];

		for(i=0;i<n;i++)
		{	num[i]=sc.nextInt();

			if(num[i]%2==1)
			{	counto++;
				o=i;
			}
			else
			{	counte++;
				e=i;
			}

			if(counto>1 && counte==1)
			{	System.out.println(e);
				break;
			}
			else if(counte>1 && counto==1)
			{	System.out.println(o);
				break;
			}
		}

	}
}


import java.util.*;

public class iq
{
	public static void main(String[] arg)
	{	Scanner sc = new Scanner(System.in);
		int n,counte,counto,e,o,i;
		counte = counto =0;
		e=o=-1;

		n = sc.nextInt();
		int[] num = new int[n];

		for(i=0;i<n;i++)
		{	num[i]=sc.nextInt();

			if(num[i]%2==1)
			{	counto++;
				o=i;
			}
			else
			{	counte++;
				e=i;
			}

			if(counto>1 && counte==1)
			{	System.out.println(num[e]);
				break;
			}
			else if(counte>1 && counto==1)
			{	System.out.println(num[o]);
				break;
			}
		}

	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class IQ {
	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
		int length=Integer.parseInt(bf.readLine());
		StringTokenizer st=new StringTokenizer(bf.readLine());
		int even=0;int odd=0;int even_pos=0;int odd_pos=0;
		for (int i = 0; i < length; i++) {
			if(Integer.parseInt(st.nextToken())%2==0){
				++even;even_pos=i+1;
			}
			else{
				++odd;odd_pos=i+1;

			}
		}
		if(even<odd)
			System.out.println(even_pos);
		else
			System.out.println(odd_pos);
	}

}


import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Task25A {

	public static void main(String... args) throws NumberFormatException,
			IOException {
		Solution.main(System.in, System.out);
	}

	static class Solution {
		public static void main(InputStream is, OutputStream os)
				throws NumberFormatException, IOException {
			PrintWriter pw = new PrintWriter(os);
			Scanner s = new Scanner(is);

			int n = s.nextInt();

			int iloscParzystych = 0;
			int iloscNieparzystych = 0;

			Integer parzysta = null;
			Integer nieparzysta = null;

			for(int i = 0 ; i < n ; i++){
				int tmp = s.nextInt();
				if(tmp % 2 == 0){
					iloscParzystych++;
					parzysta = tmp;
				} else {
					iloscNieparzystych++;
					nieparzysta = tmp;
				}
			}
			if(iloscParzystych == 1){
				pw.write(parzysta.toString());
			}
			if(iloscNieparzystych == 1){
				pw.write(nieparzysta.toString());
			}
			pw.flush();
			s.close();
		}
	}

}


import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Task25A {

	public static void main(String... args) throws NumberFormatException,
			IOException {
		Solution.main(System.in, System.out);
	}

	static class Solution {
		public static void main(InputStream is, OutputStream os)
				throws NumberFormatException, IOException {
			PrintWriter pw = new PrintWriter(os);
			Scanner s = new Scanner(is);

			int n = s.nextInt();

			int iloscParzystych = 0;
			int iloscNieparzystych = 0;

			Integer parzysta = null;
			Integer nieparzysta = null;

			for(int i = 0 ; i < n ; i++){
				int tmp = s.nextInt();
				if(tmp % 2 == 0){
					iloscParzystych++;
					parzysta = i+1;
				} else {
					iloscNieparzystych++;
					nieparzysta = i+1;
				}
			}
			if(iloscParzystych == 1){
				pw.write(parzysta.toString());
			}
			if(iloscNieparzystych == 1){
				pw.write(nieparzysta.toString());
			}
			pw.flush();
			s.close();
		}
	}

}


import java.util.ArrayList;
import java.util.Scanner;
import java.lang.String;

public class CodeForce   {

    public static void main(String[] args) {
        Scanner get=new Scanner (System.in);
        int n,even=0,result = 0;
        n=get.nextInt();
        int []x=new int [n];
        for(int i=0;i<n;i++)
        {
            x[i]=get.nextInt();
        }
        for(int i=0;i<n;i++)
        {
            if(x[i]%2==0)
            {
                even++;
            }
        }
        if(even>n/2)
        {
            for(int i=0;i<n;i++)
            {
                if(x[i]%2==1)
                {
                    result=i;
                }
            }
        }
        else
        {
            for(int i=0;i<n;i++)
            {
                if(x[i]%2==0)
                {
                    result=i;
                }
            }
        }
        System.out.println(result+1);

    }
}


import java.util.*;

public class Main
{
    public static void main(String[] args)
    {

        Scanner s = new Scanner(System.in);
        int n = s.nextInt();

        for (int i =1;i <= n;i++)
            if (s.nextInt() % 2 != 0)
            {
                System.out.println(i);
                break;
            }

    }//main

}//class


import java.util.*;

public class Main
{
    public static void main(String[] args)
    {

        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int freq[] = new int[2];
        int v,mod,codds=0,ceven=0;
        int []odd,even;
        odd = new int[n];
        even = new int[n];

        for (int i =1;i <= n;i++)
        {
            v = s.nextInt();
            mod = v % 2;
            freq[mod]++;

            if(mod==0)
            {
                even[ceven] = i;
                ceven++;
            }
            else
            {
                odd[codds] = i;
                codds++;
            }

        }

        if(freq[0]==1)
            System.out.println(even[0]);
        else
            System.out.println(odd[0]);

    }//main

}//class


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// IQ Test

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int[] numbers = new int[n];
		for (int i = 0; i < n; i++) {
			numbers[i] = scan.nextInt();
		}

		System.out.println(evennes(numbers));

	}

	private static int evennes(int[] numbers) {
		int evenIndex = 0;
		int oddIndex = 0;
		int evenCount = 0;
		int oddCount = 0;

		for (int i = 0; i < numbers.length; i++) {
			if(numbers[i] % 2 == 0) {
				evenCount++;
				evenIndex = i;
			}
			else{
				oddCount++;
				oddIndex = i;
			}
		}
		if(oddCount == 1) {
			return oddIndex+1;
		}
		return evenIndex+1;
	}

}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// IQ Test

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int[] numbers = new int[n];
		for (int i = 0; i < n; i++) {
			numbers[i] = scan.nextInt();
		}

		System.out.println(evennes(numbers));

	}

	private static int evennes(int[] numbers) {
		int evenIndex = 0;
		int oddIndex = 0;
		int evenCount = 0;
		int oddCount = 0;

		for (int i = 0; i < numbers.length; i++) {
			if(numbers[i] % 2 == 0) {
				evenCount++;
				evenIndex = i;
			}
			else{
				oddCount++;
				oddIndex = i;
			}
		}
		if(oddCount == 1) {
			return oddIndex+1;
		} else {
			return evenCount+1;
		}
	}

}


import java.util.Scanner;

public class IQtest {
	public static void main(String args[]){
		Scanner sc =new Scanner(System.in);
		int a = sc.nextInt();

		int b[] = new int[a];
		int summa1=0;
		int summa2=0;
		for(int i=0;i<a;i++){
			b[i]=sc.nextInt();
			if(b[i]%2==0){
				summa2++;

			}
			else{
				summa1++;

			}}
		if(summa2>1){

			for(int i1=0;i1<a;i1++){
				if(b[i1]%2!=0){
					System.out.println(i1+1);
					break;
				}
		}	}
		if(1<summa1){

			for(int i1=0;i1<a;i1++){
				if(b[i1]%2==0){System.out.println(i1+1);
				break;
				}

		}	}

		}}
//Duris emes KOROCH


import java.util.Scanner;

public class IQtest {
	public static void main(String args[]){
		Scanner sc =new Scanner(System.in);
		int a = sc.nextInt();

		int b[] = new int[a];
		int summa1=0;
		int summa2=0;
		for(int i=0;i<a;i++){
			b[i]=sc.nextInt();
			if(b[i]%2==0){
				summa2=summa2+i;

			}
			else{
				summa1=i+summa1;

			}}
		if(summa2>summa1){

			for(int i1=0;i1<a;i1++){
				if(b[i1]%2==1)System.out.println(i1+1);

		}	}
		if(summa2<summa1){

			for(int i1=0;i1<a;i1++){
				if(b[i1]%2==0)System.out.println(i1+1);

		}	}

		}}
//Duris emes KOROCH


import java.util.Scanner;

public class IQtest {
  public static void main(String[]args) {
	  Scanner sc= new Scanner(System.in);
	  int n= sc.nextInt();
	  int [] check= new int[n];
	   for(int i=1;i<n;i++){
		     check[i]=sc.nextInt();
	  }
	   if(check[0]%2==check[1]%2){
		   boolean istheSame=true;
		   for(int i=1;i<=check.length-1&&istheSame;i++){
			   if(check[i]%2!=check[i+1]){
				   istheSame=false;

				   System.out.println(i+2);
				   break;
			   }
		   }
	   }
	   else if(check[0]%2==check[1]%2)
		   System.out.println(3);
	   else
		   System.out.println(1);
  }
}


import java.util.Scanner;

public class IQtest {
  public static void main(String[]args) {
	  Scanner sc= new Scanner(System.in);
	  int n= sc.nextInt();
	  int [] check= new int[n];
	   for(int i=1;i<n;i++){
		     check[i]=sc.nextInt();
	  }
	   if(check[0]%2==check[1]%2){
		   boolean istheSame=true;
		   for(int i=1;i<=check.length-1&&istheSame;i++){
			   if(check[i]%2!=check[i+1]){
				   istheSame=false;
				  i=i+2;
				   System.out.println(i);
				   break;
			   }
		   }
	   }if(n==2)
		   System.out.println(1);
	   else if(check[0]%2!=check[1]%2)
		   if(check[1]%2==check[2]%2)
		   System.out.println(1);
	   else
		   System.out.println(2);
  }
}


import java.util.Scanner;

public class IQtest {
  public static void main(String[]args) {
	  Scanner sc= new Scanner(System.in);
	  int n= sc.nextInt();
	  int [] check= new int[n];
	   for(int i=0;i<n;i++){
		     check[i]=sc.nextInt();
	  }
	   if(check[0]%2==check[1]%2){
		   boolean istheSame=true;
		   for(int i=1;i<=check.length-1&&istheSame;i++){
			   if(check[i]%2!=check[i+1]){
				   istheSame=false;
				  i=i+2;
				   System.out.println(i);
				   return;
			   }
		   }
	   }if(n==2)
		   System.out.println(1);
	   if(check[0]%2!=check[1]%2&&check[0]%2!=check[2]%2)
	    System.out.println(1);

	   else
	   System.out.println(2);

  }
  }


import java.util.Scanner;

public class IQtest {
  public static void main(String[]args) {
	  Scanner sc= new Scanner(System.in);
	  int n= sc.nextInt();
	  int [] check= new int[n];
	   for(int i=0;i<n;i++){
		     check[i]=sc.nextInt();
	  }
	   if(check[0]%2==check[1]%2){
		   boolean istheSame=true;
		   for(int i=1;i<=check.length-1&&istheSame;i++){
			   if(check[i]%2!=check[i+1]%2){
				   istheSame=false;
				  i=i+2;
				   System.out.println(i);
				   return;
			   }
		   }
	   }if(n==2)
		   System.out.println(1);
	   if(check[0]%2!=check[1]%2&&check[0]%2!=check[2]%2)
	    System.out.println(1);

	   else
	   System.out.println(2);

  }
  }


import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
                String entrada ;
		int n ;
		int par=0;
                int posicionImpar = 0,posicionPar = 0;
		int impar=0;
                n = Integer.parseInt(input.nextLine());
                entrada = input.nextLine();

                String [] token ;
                token = entrada.split("\\s+");

		for (int i = 0; i < n; i++) {
			if(Integer.parseInt(token[i])%2 == 0){
				par ++;
                                posicionPar = i+1;

			}else{
				impar ++;
                                posicionImpar = i+1;

			}
		}
                if(par == 1)
		   System.out.println(posicionPar);
                else
                   System.out.println(posicionImpar);
	}

}


import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
                String entrada ;
		int n ;
		int par=0;
                int posicionImpar = 0,posicionPar = 0;
		int impar=0;
                n = Integer.parseInt(input.nextLine());
                entrada = input.nextLine();

                String [] token ;
                token = entrada.split("\\s+");

		for (int i = 0; i < n; i++) {
			if(Integer.parseInt(token[i])%2 == 0){
				par++;
                                posicionPar = i+1;

			}else{
				impar++;
                                posicionImpar = i+1;

			}
		}
                if(par<=impar)
		   System.out.println(posicionPar);
                else
                   System.out.println(posicionImpar);
	}

}


import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
                String entrada ;
		int n ;
		int par=0;
                int posicionImpar = 0,posicionPar = 0;
		int impar=0;
                n = Integer.parseInt(input.nextLine());
                entrada = input.nextLine();

                String [] token ;
                token = entrada.split("\\s+");

		for (int i = 0; i < n; i++) {
			if(Integer.parseInt(token[i])%2 == 0){

                                posicionPar = i+1;

			}else{

                                posicionImpar = i+1;

			}
		}
                if(posicionPar<posicionImpar)
		   System.out.println(posicionPar);
                else
                   System.out.println(posicionImpar);
	}

}


import java.util.*;
public class IQTest {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int even, odd, evenCount, oddCount;
		odd = even = oddCount = evenCount = 0;
		int n = s.nextInt();
		for(int i=0; i<n; i++) {
			if(s.nextInt() % 2 == 0) even = i+1;
			else odd = i+1;
		}
		s.close();
		System.out.println(evenCount>oddCount?odd:even);
	}
}


import java.util.*;
public class IQTest {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int even, odd, evenCount, oddCount;
		odd = even = oddCount = evenCount = 0;
		int n = s.nextInt();
		for(int i=0; i<n; i++) {
			if(s.nextInt() % 2 == 0) even = i+1;
			else odd = i+1;
		}
		s.close();
		System.out.println(evenCount>oddCount?even:odd);
	}
}


import java.util.*;
public class IQTest {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int even, odd;
		odd = even = 0;
		int n = s.nextInt();
		for(int i=0; i<n; i++) {
			if(s.nextInt() % 2 == 0) even = i+1;
			else odd = i+1;
		}
		s.close();
		System.out.println(even>odd?odd:even);
	}
}


import java.util.*;
public class IQTest {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int even, odd, evenCount, oddCount;
		odd = even = oddCount = evenCount = 0;
		int n = s.nextInt();
		for(int i=0; i<n; i++) {
			if(s.nextInt() % 2 == 0) {
				even = i+1;
				evenCount++;
			}
			else {
				odd = i+1;
				oddCount++;
			}
		}
		s.close();
		System.out.println(evenCount>oddCount?odd:even);
	}
}


import java.util.*;
import java.io.*;
public class Main {
    static BufferedReader reader
        = new BufferedReader(new InputStreamReader(System.in));
    static StringBuilder out = new StringBuilder();

    public static void main(String[] args){
        solve();
        return;
    }

    // the followings are methods to take care of inputs.
    static int nextInt(){
        return Integer.parseInt(nextLine());
    }
    static long nextLong(){
        return Long.parseLong(nextLine());
    }
    static int[] nextIntArray(){
        String[] inp = nextLine().split("\\s+");
        int[] ary = new int[inp.length];
        for (int i = 0; i < ary.length; i++){
            ary[i] = Integer.parseInt(inp[i]);
        }
        return ary;
    }
    static int[] nextIntArrayFrom1(){
        String[] inp = nextLine().split("\\s+");
        int[] ary = new int[inp.length + 1];
        for (int i = 0; i < inp.length; i++){
            ary[i+1] = Integer.parseInt(inp[i]);
        }
        return ary;
    }
    static long[] nextLongArray(){
        String[] inp = nextLine().split("\\s+");
        long[] ary = new long[inp.length];
        for (int i = 0; i < inp.length; i++){
            ary[i] = Long.parseLong(inp[i]);
        }
        return ary;
    }
    static long[] nextLongArrayFrom1(){
        String[] inp = nextLine().split("\\s+");
        long[] ary = new long[inp.length + 1];
        for (int i = 0; i < inp.length; i++){
            ary[i+1] = Long.parseLong(inp[i]);
        }
        return ary;
    }
    static String nextLine(){
        try {
            return reader.readLine().trim();
        } catch (Exception e){}
        return null;
    }
    static void solve(){
        int n = nextInt();
        int[] tmp = nextIntArray();
        int[] differ = new int[n-1];
        for(int i=0;i<n-1;i++){
            differ[i] = tmp[i+1] - tmp[i];
            //System.out.println(differ[i]);
        }
        int index=0;
        for(int i=0;i<n-2;i++){
            if(differ[i+1]!=differ[i])
                index=i;
        }
        index++;
        if(n==3)
            index++;
        System.out.println(index);

        return;

    }
}


import java.util.*;
import java.io.*;
public class Main {
    static BufferedReader reader
        = new BufferedReader(new InputStreamReader(System.in));
    static StringBuilder out = new StringBuilder();

    public static void main(String[] args){
        solve();
        return;
    }

    // the followings are methods to take care of inputs.
    static int nextInt(){
        return Integer.parseInt(nextLine());
    }
    static long nextLong(){
        return Long.parseLong(nextLine());
    }
    static int[] nextIntArray(){
        String[] inp = nextLine().split("\\s+");
        int[] ary = new int[inp.length];
        for (int i = 0; i < ary.length; i++){
            ary[i] = Integer.parseInt(inp[i]);
        }
        return ary;
    }
    static int[] nextIntArrayFrom1(){
        String[] inp = nextLine().split("\\s+");
        int[] ary = new int[inp.length + 1];
        for (int i = 0; i < inp.length; i++){
            ary[i+1] = Integer.parseInt(inp[i]);
        }
        return ary;
    }
    static long[] nextLongArray(){
        String[] inp = nextLine().split("\\s+");
        long[] ary = new long[inp.length];
        for (int i = 0; i < inp.length; i++){
            ary[i] = Long.parseLong(inp[i]);
        }
        return ary;
    }
    static long[] nextLongArrayFrom1(){
        String[] inp = nextLine().split("\\s+");
        long[] ary = new long[inp.length + 1];
        for (int i = 0; i < inp.length; i++){
            ary[i+1] = Long.parseLong(inp[i]);
        }
        return ary;
    }
    static String nextLine(){
        try {
            return reader.readLine().trim();
        } catch (Exception e){}
        return null;
    }
    static void solve(){
        int n = nextInt();
        int[] tmp = nextIntArray();
        int[] diff = new int[n-1];
        for(int i=0;i<n-1;i++){
            diff[i] = tmp[i+1] - tmp[i];
            //System.out.println(diff[i]);
        }
        int d = 0;
        if(diff[0]%2==1 && diff[1]%2==0){
            System.out.println(0);
            return;
        }
        if(diff[n-2]%2==1 && diff[n-3]%2==0){
            System.out.println(n-2);
            return;
        }
        for(int i=0;i<n-2;i++){
            if(diff[i]%2==1 && diff[i+1]%2==1){
                d=i;
                break;
            }
        }
        d+=2;
        System.out.println(d);
        return;

    }
}


n = int(input())
a = list(map(int, input().split()))
i = 0
while i < len(a) - 1:
    if a[i] > a[i + 1]:
        i = i + 1
        break
    i += 1
j = i + 1
print(j)


n = int(input())
a = list(map(int, input().split()))
result = []
count  = 1
i = 0
while i < n - 1:
    if a[i] <= a[i + 1]:
        count += 1
        i += 1
    elif a[i] > a[i + 1]:
        count = 0
        i += 1
    result.append(count)
count = max(result)
print(count)


n = int(input())
a = list(map(int, input().split()))
result = []
count  = 1
i = 0
if n != 1:
    while i < n - 1:
        if a[i] <= a[i + 1]:
            count += 1
            i += 1
        elif a[i] > a[i + 1]:
            count = 1
            i += 1
        result.append(count)
    count = max(result)
else:
    count = 1

print(count)


n = int(input())
a = list(map(int, input().split()))

count  = 0
i = 0
while i < n - 1:
    if a[i] >= a[i + 1]:
        i += 1
    else:
        break
a = a[i:]
z = 0
while z < len(a) - 1:
    if a[z] <= a[z + 1]:
        count += 1
        z += 1
    else:
         break
count += 1
print(count)