#include <bits/stdc++.h>
using namespace std;
pair<int, int> pega[200005];
int peg[200005], id[200005], rev[200005];
int main() {
  ios::sync_with_stdio(false);
  int n, q, p;
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    cin >> pega[i].first;
    pega[i].second = i;
  }
  sort(pega + 1, pega + n + 1);
  for (int i = 1; i <= n; i++) {
    peg[i] = pega[i].first;
    id[i] = pega[i].second;
    rev[id[i]] = i;
  }
  for (int i = 0; i < q; i++) {
    int remain;
    cin >> p >> remain;
    p = rev[p];
    int lastleft = 0, lastright = 0, dir = 0;
    int fail = 0;
    while (true) {
      if (dir == 0) {
        int rightmost =
            upper_bound(peg + p, peg + n + 1, peg[p] + remain) - peg;
        rightmost--;
        if (rightmost == p) {
          if (fail) {
            cout << id[p] << endl;
            break;
          } else {
            fail = 1;
            dir = 1;
            continue;
          }
        }
        remain -= peg[rightmost] - peg[p];
        if (rightmost != lastright) {
          lastleft = 0;
        }
        lastright = p = rightmost;
        dir = 1;
      } else {
        int leftmost = lower_bound(peg + 1, peg + p, peg[p] - remain) - peg;
        if (leftmost == p) {
          if (fail) {
            cout << id[p] << endl;
            break;
          } else {
            fail = 1;
            dir = 0;
            continue;
          }
        }
        if (lastright > 0 && leftmost == lastleft) {
          remain %= (peg[lastright] - peg[lastleft]) * 2;
          lastleft = lastright = 0;
        } else {
          remain -= peg[p] - peg[leftmost];
          lastleft = p = leftmost;
          dir = 0;
        }
      }
    }
  }
  return 0;
}
