#include <bits/stdc++.h>
using namespace std;
struct node {
  int v, p;
};
node a[200200];
int ys[200200];
int n, m;
int i, j, k, p;
bool cmp(node x, node y) {
  if (x.v < y.v || (x.v == y.v && x.p < y.p)) return true;
  return false;
}
int f(int p, int j, int k) {
  int ans;
  if (k == 0) return j;
  node tmp;
  tmp.p = 0;
  if (p == 0) {
    tmp.v = a[j].v + k + 1;
    ans = lower_bound(a + j, a + n + 1, tmp, cmp) - a;
    return (ans - 1);
  } else {
    tmp.v = a[j].v - k;
    ans = lower_bound(a + 1, a + j + 1, tmp, cmp) - a;
    return ans;
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) scanf("%d", &a[i].v);
  for (i = 1; i <= n; i++) a[i].p = i;
  sort(a + 1, a + n + 1, cmp);
  for (i = 1; i <= n; i++) ys[a[i].p] = i;
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &j, &k);
    p = 0;
    j = ys[j];
    int tmp = f(p, j, k);
    int len = a[tmp].v - a[j].v;
    k -= len;
    p = 1;
    j = tmp;
    tmp = f(p, j, k);
    len = a[j].v - a[tmp].v;
    k -= len;
    j = tmp;
    p = 0;
    int ans = 0;
    while (true) {
      tmp = f(p, j, k);
      if (tmp == j) {
        ans = j;
        break;
      }
      len = (a[tmp].v - a[j].v) * (1 - p * 2);
      int beta = k / len;
      k = k % len;
      if (beta & 1) {
        j = tmp;
        p = 1 - p;
      }
    }
    printf("%d\n", a[ans].p);
  }
  return 0;
}
