#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int X[N], inv[N];
pair<int, int> B[N];
int n, m, a, l;
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", X + i);
    B[i] = {X[i], i};
  }
  sort(B + 1, B + n + 1);
  for (int i = 1; i <= n; ++i) inv[B[i].second] = i;
  while (m--) {
    scanf("%d %d", &a, &l);
    a = inv[a];
    int prev = -1;
    bool ok = 1;
    int lo, hi;
    while (l) {
      if (ok) {
        lo = a;
        hi = n;
        while (lo < hi) {
          int mid = lo + (hi - lo + 1) / 2;
          if (B[mid].first - B[a].first <= l)
            lo = mid;
          else
            hi = mid - 1;
        }
      } else {
        lo = 1;
        hi = a;
        while (lo < hi) {
          int mid = lo + (hi - lo) / 2;
          if (B[a].first - B[mid].first > l)
            lo = mid + 1;
          else
            hi = mid;
        }
      }
      if (lo == prev) {
        if (lo == a) break;
        l %= 2 * abs(B[a].first - B[lo].first);
        if (l == 0) break;
      }
      if (l >= abs(B[a].first - B[lo].first)) {
        l -= abs(B[a].first - B[lo].first);
        prev = a;
        a = lo;
        ok ^= 1;
      }
    }
    cout << B[a].second << endl;
  }
  return 0;
}
