#include <bits/stdc++.h>
using namespace std;
int main() {
  int x;
  int n;
  cin >> n;
  int ceven = 0, codd = 0, idx1 = 0, idx2 = 0;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    if (x % 2 == 0) {
      ceven++;
      idx1 = i;
    } else if (x % 2 != 0) {
      codd++;
      idx2 = i;
    }
  }
  if (ceven > codd)
    cout << idx2 << '\n';
  else if (codd > ceven)
    cout << idx1 << '\n';
  return 0;
}
