#include <bits/stdc++.h>
using namespace std;
int n, m;
pair<int, int> v[1000000];
int ind2pos[1000000];
int ivright(int iv, int l) {
  int inf = iv;
  int sup = n;
  while (inf + 1 < sup) {
    int med = (inf + sup) / 2;
    if (v[med].first <= v[iv].first + l)
      inf = med;
    else
      sup = med;
  }
  return inf;
}
int ivleft(int iv, int l) {
  int inf = -1;
  int sup = iv;
  while (inf + 1 < sup) {
    int med = (inf + sup) / 2;
    if (v[med].first >= v[iv].first - l)
      sup = med;
    else
      inf = med;
  }
  return sup;
}
int simula(int iv, int l, int d) {
  if (d == 1) {
    int ivri = ivright(iv, l);
    if (iv == ivri) {
      int ivle = ivleft(iv, l);
      if (iv == ivle) return v[iv].second;
      simula(iv, l, 0);
    }
    int len = v[ivri].first - v[iv].first;
    if (ivleft(ivri, l - len) < iv) return simula(ivri, l - len, 0);
    if (l / len % 2 == 0)
      return simula(iv, l % len, 1);
    else
      return simula(ivri, l % len, 0);
  }
  int ivle = ivleft(iv, l);
  if (iv == ivle) {
    int ivri = ivright(iv, l);
    if (iv == ivri) return v[iv].second;
    simula(iv, l, 1);
  }
  int len = v[iv].first - v[ivle].first;
  if (ivright(ivle, l - len) > iv) return simula(ivle, l - len, 1);
  if (l / len % 2 == 0) return simula(iv, l % len, 0);
  return simula(ivle, l % len, 1);
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> v[i].first;
    v[i].second = i + 1;
  }
  sort(v, v + n);
  for (int i = 0; i < n; i++) ind2pos[v[i].second] = i;
  for (int i = 0; i < m; i++) {
    int ind, l;
    cin >> ind >> l;
    int iv = ind2pos[ind];
    cout << simula(iv, l, 1) << endl;
  }
}
