#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int n, m;
int X[N], id[N], Iid[N];
bool cmp(int x, int y) { return X[x] < X[y]; }
void init() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) scanf("%d", &X[i]);
}
int next(int pos, int l, int type) {
  if (type == 1) return upper_bound(X + 1, X + n + 1, X[pos] + l) - X - 1;
  return lower_bound(X + 1, X + n + 1, X[pos] - l) - X;
}
int solve(int pos, int l) {
  int t1 = next(pos, l, 1);
  int t2 = next(t1, l - abs(X[t1] - X[pos]), 0);
  if (t1 == pos && t2 == pos) return pos;
  if (t2 == pos) return solve(pos, l % (2 * abs(X[t1] - X[t2])));
  return solve(t2, l - abs(X[t1] - X[pos]) - abs(X[t2] - X[t1]));
}
void work() {
  for (int i = 1; i <= n; i++) id[i] = i;
  sort(id + 1, id + n + 1, cmp), sort(X + 1, X + n + 1);
  for (int i = 1; i <= n; i++) Iid[id[i]] = i;
  while (m--) {
    int x0, l;
    scanf("%d%d", &x0, &l), x0 = Iid[x0];
    cout << id[solve(x0, l)] << endl;
  }
}
int main() {
  init(), work();
  return 0;
}
