#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
struct ab {
  int c, s;
} a[N], b[N];
bool cmp(ab x, ab y) { return x.c < y.c; }
int main() {
  int n, m, i, j, k;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i].c);
    a[i].s = i;
  }
  sort(a + 1, a + 1 + n, cmp);
  b[1].c = 0;
  b[1].s = a[1].s;
  int d = 0, op = 0, l = 0;
  for (i = 2; i <= n; i++)
    b[i].c = a[i].c - a[i - 1].c, d = max(d, b[i].c), b[i].s = a[i].s;
  int ans = b[3].c, flag = 0;
  for (i = 2; i <= n - 1; i++) {
    if (b[i].c == ans)
      continue;
    else
      flag = 1;
  }
  if (flag == 0) {
    printf("%d\n", a[n].s);
    return 0;
  }
  flag = 0;
  for (i = 3; i <= n; i++) {
    if (b[i].c == ans)
      continue;
    else
      flag = 1;
  }
  if (flag == 0) {
    printf("%d\n", a[1].s);
    return 0;
  }
  for (i = 2; i <= n; i++)
    if (d != b[i].c) op++, l = i;
  if (op > 2)
    printf("-1\n");
  else {
    if (b[l].c + b[l - 1].c == d)
      printf("%d\n", a[l - 1].s);
    else
      printf("-1\n");
  }
}
