#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const int maxm = maxn * 4 + 10;
const int inf = 1e9;
const long long mod = 1e9 + 7;
int getint() {
  char c;
  while ((c = getchar()) && !(c >= '0' && c <= '9') && c != '-')
    ;
  int ret = c - '0', sgn = 0;
  if (c == '-') sgn = 1, ret = 0;
  while ((c = getchar()) && c >= '0' && c <= '9') ret = ret * 10 + c - '0';
  if (sgn) ret = -ret;
  return ret;
}
vector<pair<int, int> > p;
int x[maxn], id[maxn];
int main() {
  int n, m;
  while (scanf("%d%d", &n, &m) == 2) {
    int i;
    p.clear();
    for (i = 0; i <= n - 1; i++) {
      int x = getint();
      p.push_back(make_pair(x, i));
    }
    sort(p.begin(), p.end());
    for (i = 0; i <= n - 1; i++) {
      id[p[i].second] = i;
      x[i] = p[i].first;
    }
    while (m--) {
      int cur = getint(), l = getint();
      cur--;
      int dir = 1;
      int k = id[cur];
      int dis = x[k] + l;
      int k1 = upper_bound(x, x + n, dis) - x - 1;
      l -= (x[k1] - x[k]);
      k = k1;
      dir *= -1;
      while (1) {
        dis = x[k] + dir * l;
        if (dir == 1) {
          k1 = upper_bound(x, x + n, dis) - x - 1;
        } else
          k1 = lower_bound(x, x + n, dis) - x;
        if (k == k1) break;
        int temp = abs(x[k1] - x[k]);
        if ((l / temp) % 2) dir *= -1, k = k1;
        l %= temp;
      }
      cout << p[k].second + 1 << endl;
    }
  }
  return 0;
}
