#include <bits/stdc++.h>
const char en = '\n';
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  set<long long> S;
  map<long long, long long> R;
  vector<long long> V(n + 47, 0);
  for (int i = 0; i < n; i++) {
    long long t;
    cin >> t;
    V[i + 1] = t;
    S.insert(t);
    R[t] = i + 1;
  }
  S.insert(-1000000000000000047);
  S.insert(1000000000000000047);
  for (int i = 0; i < m; i++) {
    long long a, l;
    cin >> a >> l;
    a = V[a];
    int str = 1;
    long long pp[3] = {-1000000000000000047, -1000000000000000047,
                       -1000000000000000047};
    long long x = a;
    while (l > 0) {
      auto it = S.upper_bound(a + l);
      it--;
      if (!str) it = S.lower_bound(a - l);
      x = *it;
      if (x == pp[0] || x == pp[1] || x == pp[2]) {
        if (x == a) break;
        l %= 2 * abs(x - a);
      }
      if (l >= abs(x - a)) {
        l -= abs(x - a);
        a = x;
        pp[0] = pp[1];
        pp[1] = pp[2];
        pp[2] = x;
        str ^= 1;
      }
    }
    cout << R[a] << en;
  }
}
