#include <bits/stdc++.h>
using namespace std;
const int Maxn = 210000;
int a[Maxn];
int id[Maxn], pos[Maxn];
int N, M;
bool Cmp(int A, int B) { return a[A] < a[B]; }
int searchForward(int s, int len) {
  int l = s, r = N - 1;
  for (; l < r;) {
    int mid = (l + r) / 2 + 1;
    if (a[mid] - a[s] <= len)
      l = mid;
    else
      r = mid - 1;
  }
  return l;
}
int searchBackward(int s, int len) {
  int l = 0, r = s;
  for (; l < r;) {
    int mid = (l + r) / 2;
    if (a[s] - a[mid] <= len)
      r = mid;
    else
      l = mid + 1;
  }
  return l;
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 0; i < N; ++i) {
    scanf("%d", &a[i]);
    id[i] = i;
  }
  sort(id, id + N, Cmp);
  sort(a, a + N);
  for (int i = 0; i < N; ++i) pos[id[i] + 1] = i;
  for (int i = 0; i < M; ++i) {
    int x, l;
    scanf("%d%d", &x, &l);
    int mode = 0;
    x = pos[x];
    for (;;) {
      if (mode == 0) {
        int R = searchForward(x, l);
        int L = searchBackward(R, l - (a[R] - a[x]));
        if (a[R] == a[L]) {
          printf("%d\n", id[R] + 1);
          break;
        }
        l -= a[R] - a[x];
        if (L > x) {
          l -= a[R] - a[L];
          mode = 0;
          x = L;
          continue;
        }
        int loop = l / (a[R] - a[L]);
        l %= a[R] - a[L];
        if (!(loop & 1)) {
          mode = 1;
          x = R;
        } else
          x = L;
      } else {
        int L = searchBackward(x, l);
        int R = searchForward(L, a[x] - a[L]);
        if (a[R] == a[L]) {
          printf("%d\n", id[L] + 1);
          break;
        }
        l -= a[x] - a[L];
        if (R < x) {
          l -= a[R] - a[L];
          mode = 1;
          x = R;
          continue;
        }
        int loop = l / (a[R] - a[L]);
        l %= a[R] - a[L];
        if (!(loop & 1)) {
          mode = 0;
          x = L;
        } else
          x = R;
      }
    }
  }
  return 0;
}
