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>
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-O3")
using namespace std;
namespace io {
const int N = 1 << 20;
char buf[N], *t1 = buf, *t2 = buf;
inline int read() {
  static int an;
  an = 0;
  static char ch;
  ch = t1 == t2 && (t2 = (t1 = buf) + fread(buf, 1, N, stdin), t1 == t2)
           ? EOF
           : *t1++;
  while (ch < 48 || ch > 57)
    ch = t1 == t2 && (t2 = (t1 = buf) + fread(buf, 1, N, stdin), t1 == t2)
             ? EOF
             : *t1++;
  while (ch >= 48 && ch <= 57)
    an = (an << 3) + (an << 1) + (ch ^ 48),
    ch = t1 == t2 && (t2 = (t1 = buf) + fread(buf, 1, N, stdin), t1 == t2)
             ? EOF
             : *t1++;
  return an;
}
}  // namespace io
using io::read;
const double PI =
    3.141592653589793238462643383279502884197169399375105820974944;
vector<bool> chkprime(10000000, true);
unsigned primearray[5761459];
const int monthly[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
long long GCD(long long a, long long b) { return ((!b) ? a : GCD(b, a % b)); }
long long LCM(long long a, long long b) { return a / (GCD(a, b)) * b; }
long long nCr(long long n, long long r) {
  if (n < r) return 0;
  if (r == 0) return 1;
  return n * nCr(n - 1, r - 1) / r;
}
long long PowMod(long long bs, long long ex, long long Mod) {
  if (!ex) return 1;
  long long p = PowMod((bs * bs) % Mod, ex >> 1, Mod);
  return (ex & 1) ? (p * bs) % Mod : p;
}
long long ModInverse(long long a) {
  return PowMod(a, 1000000007 - 2, 1000000007);
}
bool PointInRectangle(long long x1, long long y1, long long x2, long long y2,
                      long long x, long long y) {
  return (x >= x1 && x <= x2 && y >= y1 && y <= y2);
}
string Letters = "0123456789ABCDEF";
int toInt(char c) { return Letters.find(c); }
long long FromAnyBaseToDecimal(string inp, int base) {
  long long res = 0;
  for (int i = 0; i < inp.size(); i++) {
    res *= base;
    res += toInt(inp[i]);
  }
  return res;
}
string FromDecimalToAnyBase(long long n, int base) {
  if (n == 0) return "0";
  string ret = "";
  while (n) {
    ret = Letters[n % base] + ret;
    n /= base;
  }
  return ret;
}
double distance(double x1, double y1, double x2, double y2) {
  return hypot(fabs(x1 - x2), fabs(y1 - y2));
}
long long mult(long long a, long long b) { return (1LL * a * b) % 1000000007; }
long long SumOfOdd(long long l, long long r) {
  long long Rsm = (r + 1) / 2;
  Rsm *= Rsm;
  l--;
  long long Lsm = (l + 1) / 2;
  Lsm *= Lsm;
  return Rsm - Lsm;
}
long long NoOfOdd(long long L, long long R) {
  long long n = (R - L) / 2;
  if (R % 2 != 0 || L % 2 != 0) n++;
  return n;
}
long long NoOfEven(long long L, long long R) {
  return ((R - L + 1) - NoOfOdd(L, R));
}
int extgcd(int a, int b, int &x, int &y) {
  int g = a;
  x = 1;
  y = 0;
  if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x;
  return g;
}
bool isPalindrome(string str) {
  long long l = 0;
  long long h = str.size() - 1;
  while (h > l) {
    if (str[l++] != str[h--]) {
      return 0;
    }
  }
  return 1;
}
bool primity(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (auto i = 5; i * i <= n; i += 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
int power_x(int x, unsigned y) {
  if (y == 0) return 1;
  if (!(y & 1)) return power_x(x, y >> 1) * power_x(x, y >> 1);
  return x * power_x(x, y >> 1) * power_x(x, y >> 1);
}
int sod(int n) {
  int sum = 0;
  while (n > 0) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
int order_x(long long x) {
  int n = 0;
  while (x) {
    n++;
    x /= 10;
  }
  return n;
}
bool is_perfect_square(int n) {
  if (n < 0) return false;
  int root(round(sqrt(n)));
  return n == root * root;
}
bool is_perfect_cube(int n) {
  int root(round(cbrt(n)));
  return n == root * root * root;
}
void n_primes() {
  chkprime[0] = chkprime[1] = false;
  for (unsigned i = 2; i * i <= 10000000; i++) {
    if (chkprime[i]) {
      for (unsigned j = i; j * i <= 10000000; j++) chkprime[i * j] = false;
    }
  }
  unsigned id = 1;
  primearray[0] = 2;
  for (int i = 3; i <= 10000000; i += 2) {
    if (chkprime[i]) {
      primearray[id++] = i;
    }
  }
}
bool solve(long long n, long long k) {
  vector<int> primedivisor;
  while (n % 2 == 0) {
    primedivisor.push_back(2);
    n >>= 1;
  }
  for (int i = 3; i * i <= n; i++) {
    while (n % i == 0) {
      n /= i;
      primedivisor.push_back(i);
    }
  }
  if (n > 2) primedivisor.push_back(2);
  if (primedivisor.size() >= k)
    return true;
  else
    return false;
}
string alp = "abcdefghijklmnopqrstuvwxyz";
int main(int argc, char **argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int *arr = new int[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  int ce = 0, co = 0;
  int lste = 0, lsto = 0;
  for (int i = 0; i < n; i++) {
    if (arr[i] & 1) {
      lsto = i;
      co++;
    } else {
      lste = i;
      ce++;
    }
  }
  if (co == 1) {
    cout << lsto + 1;
  } else {
    cout << lste + 1;
  }
  return 0;
}
