#include <bits/stdc++.h>
using namespace std;
pair<int, int> p[200005];
int x[200005];
int fmp[200005], mp[200005];
int main() {
  int n, m, l, t, a, b, c, i;
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    scanf("%d", &p[i].first);
    p[i].second = i;
  }
  sort(p + 1, p + 1 + n);
  for (i = 1; i <= n; i++) {
    x[i] = p[i].first, fmp[p[i].second] = i, mp[i] = p[i].second;
  }
  while (m--) {
    scanf("%d%d", &a, &l);
    a = fmp[a];
    b = 0;
    while (a != b) {
      b = upper_bound(x + 1, x + 1 + n, x[a] + l) - x - 1;
      l -= x[b] - x[a];
      c = lower_bound(x + 1, x + 1 + n, x[b] - l) - x;
      l -= x[b] - x[c];
      if (b == c) {
        a = c;
        break;
      }
      if (c == a) {
        t = l / (x[b] - x[a]);
        t = t % 2;
        l = l % (x[b] - x[a]);
        if (t == 1) {
          a = lower_bound(x + 1, x + 1 + n, x[b] - l) - x;
          l -= x[b] - x[a];
        }
      } else
        a = c;
    }
    printf("%d\n", mp[a]);
  }
  return 0;
}
