#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const long long INF = (long long)10 * MOD;
long double dp[110][110][110];
int main() {
  std::ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > x(n);
  for (int i = 0; i < n; ++i) {
    cin >> x[i].first;
    x[i].second = i + 1;
  }
  sort(x.begin(), x.end());
  vector<int> a(n), toInit(n), fromInit(n + 1);
  for (int i = 0; i < n; ++i) {
    toInit[i] = x[i].second;
    fromInit[x[i].second] = i;
    a[i] = x[i].first;
  }
  while (m--) {
    int current, l;
    cin >> current >> l;
    current = fromInit[current];
    auto it = upper_bound(a.begin() + current, a.end(), a[current] + l);
    int pos = (--it) - a.begin();
    l -= a[pos] - a[current];
    current = pos;
    bool isRightStep = false;
    bool wasPrev = true;
    while (true) {
      int pos;
      if (isRightStep) {
        auto it = upper_bound(a.begin(), a.end(), a[current] + l);
        pos = (--it) - a.begin();
      } else {
        pos = lower_bound(a.begin(), a.end(), a[current] - l) - a.begin();
      }
      int d = abs(a[pos] - a[current]);
      int cnt = 0;
      if (d > 0) {
        cnt = l / d;
        if (cnt & 1) {
          isRightStep ^= true;
          current = pos;
        }
        l %= d;
      } else {
        isRightStep ^= true;
      }
      if (cnt > 0) {
        wasPrev = true;
      } else {
        if (!wasPrev) {
          break;
        }
        wasPrev = false;
      }
    }
    cout << toInit[current] << endl;
  }
  return 0;
}
