#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > G;
int n, m;
int a[200009], pos[200009];
int bin1(int x, int l) {
  int L = x, R = n - 1;
  while (L < R) {
    int M = (L + R + 1) >> 1;
    if (G[x].first + l >= G[M].first)
      L = M;
    else
      R = M - 1;
  }
  return L;
}
int bin2(int x, int l) {
  int L = 0, R = x;
  while (L < R) {
    int M = (L + R) >> 1;
    if (G[x].first - l <= G[M].first)
      R = M;
    else
      L = M + 1;
  }
  return R;
}
void Rotate_L(int &L, int &R, int &x) {
  int LL = bin2(R, x);
  x -= G[R].first - G[LL].first;
  L = LL;
}
void Rotate_R(int &L, int &R, int &x) {
  int RR = bin1(L, x);
  x -= G[RR].first - G[L].first;
  R = RR;
  Rotate_L(L, R, x);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    G.push_back(make_pair(a[i], i));
  }
  sort(G.begin(), G.end());
  for (int i = 0; i < n; i++) {
    pos[G[i].second] = i;
  }
  int x, l, L, R;
  while (m--) {
    scanf("%d%d", &x, &l);
    x--;
    x = pos[x];
    R = bin1(x, l);
    l -= G[R].first - G[x].first;
    L = bin2(R, l);
    l -= G[R].first - G[L].first;
    while (L < R) {
      l %= 2 * (G[R].first - G[L].first);
      Rotate_R(L, R, l);
    }
    printf("%d\n", G[R].second + 1);
  }
  return 0;
}
