#include <bits/stdc++.h>
using namespace std;
int N;
pair<int, int> inp[2 * 100005];
int id[2 * 100005];
void binsrchright(int start, int L, int& ret) {
  int hi, lo, mid;
  hi = N, lo = start;
  ret = -1;
  while (lo <= hi) {
    mid = (lo + hi) / 2;
    if (inp[mid].first - inp[start].first <= L) {
      ret = mid;
      lo = mid + 1;
    } else
      hi = mid - 1;
  }
}
void binsrchleft(int start, int L, int& ret) {
  int hi, lo, mid;
  ret = -1;
  hi = start, lo = 1;
  while (lo <= hi) {
    mid = (lo + hi) / 2;
    if (inp[start].first - inp[mid].first <= L) {
      ret = mid;
      hi = mid - 1;
    } else
      lo = mid + 1;
  }
}
int Findpeg(int start, int L) {
  bool turn = 0;
  int p, d;
  binsrchright(start, L, p);
  d = abs(inp[p].first - inp[start].first);
  start = p;
  L -= d;
  turn = !turn;
  while (true) {
    if (turn == 0)
      binsrchright(start, L, p);
    else
      binsrchleft(start, L, p);
    if (p == start) return start;
    d = abs(inp[p].first - inp[start].first);
    if (L - d >= d) {
      if ((L / d) % 2 == 0) {
        L = L % d;
        continue;
      } else {
        L = L % d;
        start = p;
        turn = !turn;
        continue;
      }
    } else {
      L = L - d;
      start = p;
      turn = !turn;
    }
  }
}
int main() {
  int i, j, Q, ans;
  int start, L;
  scanf("%d%d", &N, &Q);
  for (i = 1; i <= N; i++) {
    scanf("%d", &inp[i].first);
    inp[i].second = i;
  }
  sort(inp + 1, inp + N + 1);
  for (i = 1; i <= N; i++) {
    id[inp[i].second] = i;
  }
  while (Q--) {
    scanf("%d%d", &start, &L);
    ans = Findpeg(id[start], L);
    printf("%d\n", inp[ans].second);
  }
  return 0;
}
