#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, unsigned long long int y) {
  long long int res = 1;
  while (y > 0) {
    if (y & 1) {
      res = res * x;
    }
    y = y >> 1;
    x = x * x;
  }
  return res;
}
long long int powermod(long long int x, unsigned long long int y,
                       long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) {
      res = (res * x) % p;
    }
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  vector<pair<long long int, long long int> > vp;
  for (long long int i = (long long int)(0); i < (long long int)(n); i++) {
    long long int t;
    cin >> t;
    vp.push_back({t, i + 1});
  }
  if (n == 2) {
    cout << 1 << "\n";
    return 0;
  }
  multiset<long long int> ms;
  sort((vp).begin(), (vp).end());
  for (long long int i = (long long int)(1); i < (long long int)(n); i++) {
    ms.insert(vp[i].first - vp[i - 1].first);
  }
  long long int ans = -1;
  for (long long int i = (long long int)(0); i < (long long int)(n); i++) {
    if (i == 0) {
      ms.erase(ms.find(vp[i + 1].first - vp[i].first));
      if (*ms.begin() == *prev(ms.end())) ans = vp[i].second;
      ms.insert(vp[i + 1].first - vp[i].first);
    } else if (i == n - 1) {
      ms.erase(ms.find(vp[i].first - vp[i - 1].first));
      if (*ms.begin() == *prev(ms.end())) ans = vp[i].second;
      ms.insert(vp[i].first - vp[i - 1].first);
    } else {
      long long int d1 = vp[i].first - vp[i - 1].first;
      long long int d2 = vp[i + 1].first - vp[i].first;
      long long int d3 = vp[i + 1].first - vp[i - 1].first;
      ms.erase(ms.find(d1));
      ms.erase(ms.find(d2));
      ms.insert(d3);
      if (*ms.begin() == *prev(ms.end())) ans = vp[i].second;
      ms.erase(ms.find(d3));
      ms.insert(d1);
      ms.insert(d2);
    }
  }
  cout << ans << "\n";
  return 0;
}
