Bob is preparing to pass IQ test. The most frequent task in this test is to find out which one of the given n numbers differs from the others. Bob observed that one number usually differs from the others in evenness. Help Bob — to check his answers, he needs a program that among the given n numbers finds one that is different in evenness.

Input

The first line contains integer n (3 ≤ n ≤ 100) — amount of numbers in the task. The second line contains n space-separated natural numbers, not exceeding 100. It is guaranteed, that exactly one of these numbers differs from the others in evenness.

Output

Output index of number that differs from the others in evenness. Numbers are numbered from 1 in the input order.

Examples

Input

5
2 4 7 8 10


Output

3


Input

4
1 2 1 1


Output

2
#include <bits/stdc++.h>
using namespace std;
char local = 'O';
template <typename T>
void read(T &p) {
  cin >> p;
}
template <typename T, typename T1>
void read(pair<T, T1> &p) {
  read(p.first);
  read(p.second);
}
template <typename T>
void read(T arr[], long long n) {
  for (long long i = 0; i < n; i++) {
    read(arr[i]);
  }
}
template <typename T>
void read(vector<T> &arr) {
  for (long long i = 0; i < arr.size(); i++) {
    read(arr[i]);
  }
}
template <typename T>
void out(T &n) {
  cout << n;
}
template <typename T, typename T1>
void out(pair<T, T1> &p) {
  cout << "(";
  out(p.first);
  cout << ",";
  out(p.second);
  cout << ")";
}
template <typename T>
void out(T arr[], long long n) {
  for (long long i = 0; i < n; i++) {
    out(arr[i]);
    cout << " ";
  }
}
template <typename T>
void out(vector<T> &arr) {
  cout << "[ ";
  for (long long i = 0; i < arr.size(); i++) {
    out(arr[i]);
    if (i != arr.size() - 1) cout << ", ";
  }
  cout << " ]";
}
template <typename T>
void out(set<T> &arr) {
  for (auto i : arr) {
    out(i);
    cout << " ";
  }
}
template <typename T>
void out(multiset<T> &arr) {
  for (auto i : arr) {
    out(i);
    cout << " ";
  }
}
template <typename T, typename T1>
void out(map<T, T1> &m) {
  for (auto i : m) {
    out(i.first);
    cout << " -> ";
    out(i.second);
    cout << ", ";
  }
}
template <typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
  cout << name << " : ";
  out(arg1);
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args &&...args) {
  const char *comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : ";
  out(arg1);
  cout << " | ";
  __f(comma + 1, args...);
}
void cal() {}
void solve() {
  int n, c1 = 0, c0 = 0;
  cin >> n;
  vector<int> a(n);
  read(a);
  for (auto i : a) {
    if (i % 2)
      c1++;
    else
      c0++;
  }
  if (c1 == 1) {
    for (int i = 0; i < n; i++) {
      if (a[i] % 2) {
        cout << i + 1;
        return;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (!(a[i] % 2)) {
      cout << i + 1;
      return;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t1;
  t1 = 1;
  cal();
  while (t1--) {
    solve();
  }
}
