#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimization("unroll-loops")
using namespace std;
const long double Pi = 3.141592653;
const long long mod = 1e9 + 7;
long long INF = 1000000000000000000;
struct mycmp {
  bool operator()(pair<int, int> a, pair<int, int> b) const {
    return (a.first < b.first) || (a.first == b.first && a.second > b.second);
  }
};
priority_queue<int> q;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    int n;
    cin >> n;
    long long a[n], b[n];
    map<int, int> m;
    for (int i = 0; i < n; i++) cin >> a[i], m[a[i]] = i + 1;
    sort(a, a + n);
    multiset<int> s;
    for (int i = 1; i < n; i++) s.insert(a[i] - a[i - 1]);
    bool ok = false;
    if (n == 2)
      cout << 1;
    else {
      for (int i = 0; i < n; i++) {
        if (i == 0) {
          int y = a[i + 1] - a[i];
          auto j = s.lower_bound(y);
          s.erase(j);
          if (*s.begin() == *s.rbegin()) {
            ok = true;
            cout << m[a[0]];
            break;
          }
          s.insert(y);
        } else if (i == n - 1) {
          int y = a[i] - a[i - 1];
          auto j = s.lower_bound(y);
          s.erase(j);
          if (*s.begin() == *s.rbegin()) {
            ok = true;
            cout << m[a[i]];
            break;
          }
          s.insert(y);
        } else {
          int y = a[i] - a[i - 1];
          int y1 = a[i + 1] - a[i];
          auto j = s.lower_bound(y);
          s.erase(j);
          j = s.lower_bound(y1);
          s.erase(j);
          int z = a[i + 1] - a[i - 1];
          s.insert(z);
          if (*s.begin() == *s.rbegin()) {
            ok = true;
            cout << m[a[i]];
            break;
          }
          s.insert(y);
          s.insert(y1);
          j = s.lower_bound(z);
          s.erase(j);
        }
      }
      if (!ok) cout << -1;
    }
  }
}
