#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const long long BIG = 1446803456761533460;
const int Big = 336860180;
stringstream sss;
const int maxn = 200010;
int n, m;
int X[maxn];
int lst[maxn];
int id1[maxn], id2[maxn];
bool x_cmp(int a, int b) { return X[a] < X[b]; }
void MAIN() {
  cin >> n >> m;
  for (int i = (0); i < (n); ++i) cin >> X[i];
  iota(id1, id1 + n, 0);
  sort(id1, id1 + n, x_cmp);
  sort(X, X + n);
  for (int i = (0); i < (n); ++i) id2[id1[i]] = i;
  lst[0] = -1;
  for (int q = (0); q < (m); ++q) {
    int p, L;
    cin >> p >> L;
    p = id2[p - 1];
    int j = 1;
    int i = 1;
    lst[i++] = p;
    while (true) {
      int nxt;
      if (j)
        nxt = upper_bound(X, X + n, X[p] + L) - X - 1;
      else
        nxt = lower_bound(X, X + n, X[p] - L) - X;
      if (nxt == lst[i - 1] && nxt == lst[i - 2]) {
        cout << id1[nxt] + 1 << '\n';
        break;
      }
      int ln = abs(X[p] - X[nxt]);
      j ^= 1, L -= ln;
      if (nxt == lst[i - 2]) {
        L %= ln * 2;
      }
      lst[i++] = nxt;
      p = nxt;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(10);
  sss << R"(
2 1
5 7
1 9
4 4
1 5 7 15
1 4
2 15
3 16
1 28
    )";
  MAIN();
  return 0;
}
