#include <bits/stdc++.h>
using namespace std;
int n, m;
struct Num {
  int ind, val;
} x[200000];
int ind[200000];
int f, len;
bool comp(Num x, Num y) { return x.val < y.val; }
int higherBound(int pos, int len) {
  int lo = pos;
  int hi = n;
  while (lo + 1 < hi) {
    int mid = (lo + hi) / 2;
    if (len - abs(x[mid].val - x[pos].val) >= 0) {
      lo = mid;
    } else {
      hi = mid;
    }
  }
  return lo;
}
int lowerBound(int pos, int len) {
  int lo = -1;
  int hi = pos;
  while (lo + 1 < hi) {
    int mid = (lo + hi) / 2;
    if (len - abs(x[mid].val - x[pos].val) >= 0) {
      hi = mid;
    } else {
      lo = mid;
    }
  }
  return hi;
}
int get(int pos) {
  int c = 0;
  int newPos = higherBound(pos, len);
  int tmp = newPos;
  if (newPos == pos) c++;
  len = (len - abs(x[newPos].val - x[pos].val));
  newPos = lowerBound(newPos, len);
  if (newPos == pos) c++;
  if (c == 2) f = true;
  if (!f && newPos == pos) {
    bool flag = (len / abs(x[newPos].val - x[tmp].val) % 2 == 0);
    len = len % abs(x[newPos].val - x[tmp].val);
    if (flag) newPos = tmp;
  } else
    len = len - abs(x[newPos].val - x[tmp].val);
  return newPos;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x[i].val);
    x[i].ind = i;
  }
  sort(x, x + n, comp);
  for (int i = 0; i < n; i++) {
    ind[x[i].ind] = i;
  }
  int pos, newPos;
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &pos, &len);
    pos = ind[pos - 1];
    f = 0;
    while (true) {
      int newPos = get(pos);
      if (f) {
        break;
      }
      pos = newPos;
    }
    printf("%d\n", x[pos].ind + 1);
  }
  return 0;
}
