#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
long long x[N], ps[N], pr[N], n, m, y[N];
map<int, int> mp, mp2;
int next(int l, int ptr, bool d) {
  if (d)
    return upper_bound(x, x + n, x[ptr] + l) - x - 1;
  else {
    ptr = n - 1 - ptr;
    int ind = upper_bound(pr, pr + n, pr[ptr] + l) - pr - 1;
    ind = n - 1 - ind;
    return ind;
  }
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    mp[x[i]] = i;
    y[i] = x[i];
  }
  sort(x, x + n);
  for (int i = n - 1; i >= 0; i--) pr[i] = x[n - 1] - x[i];
  sort(pr, pr + n);
  for (int i = 0; i < m; i++) {
    int ptr, l;
    cin >> ptr >> l;
    ptr--;
    ptr = lower_bound(x, x + n, y[ptr]) - x;
    bool d = l > 0 ? 1 : 0;
    l = abs(l);
    while (true) {
      int ind1 = next(l, ptr, d);
      d = 1 - d;
      l -= abs(x[ptr] - x[ind1]);
      int ind2 = next(l, ind1, d);
      if (ind1 == ind2) {
        if (ind2 == ind1) ptr = ind1;
        cout << mp[x[ptr]] + 1 << "\n";
        break;
      }
      int dis = abs(x[ind1] - x[ind2]);
      long long d = (l / dis) % 2 ? 1 - d : d;
      ptr = (l / dis) % 2 ? ind2 : ind1;
      l %= dis;
    }
  }
  return 0;
}
