#include <bits/stdc++.h>
using namespace std;
vector<int> alph(26, 0);
vector<int> comp(26, 0);
int main() {
  int n, t, even = 0, l1, l2;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> t;
    if (t % 2 == 0) {
      even++;
      l1 = i;
    } else {
      even--;
      l2 = i;
    }
  }
  if (even > 0)
    cout << l2 + 1;
  else
    cout << l1 + 1;
  return 0;
}
