#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int neven = 0, nodd = 0;
  int laste = -1, lasto = -1;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    if (a & 1) {
      nodd++;
      lasto = i;
    } else {
      neven++;
      laste = i;
    }
  }
  cout << (nodd > neven ? laste : lasto) + 1;
  cout << endl;
}
