#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
pair<int, int> a[maxn];
int x[maxn], w[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, q;
  cin >> n >> q;
  for (int i = 0; i < n; ++i) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a, a + n);
  for (int i = 0; i < n; ++i) {
    x[i] = a[i].first;
  }
  for (int i = 0; i < n; ++i) {
    w[a[i].second] = i;
  }
  while (q--) {
    int aa, l;
    cin >> aa >> l;
    --aa;
    int pos = w[aa], jahat = -1;
    int pos2 = (upper_bound(x, x + n, x[pos] + l) - x) - 1;
    l -= abs(x[pos2] - x[pos]);
    pos = pos2;
    while (true) {
      if (jahat == 1) {
        pos2 = (upper_bound(x, x + n, x[pos] + l) - x) - 1;
      } else {
        pos2 = lower_bound(x, x + n, x[pos] - l) - x;
      }
      if (pos == pos2) {
        break;
      }
      int ame = abs(x[pos] - x[pos2]);
      if ((l / ame) & 1) {
        jahat *= -1;
        pos = pos2;
      }
      l %= ame;
    }
    cout << a[pos].second + 1 << endl;
  }
  return 0;
}
