#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)2e5 + 100;
struct Node {
  int x, id;
  Node() {}
  Node(int x, int id) : x(x), id(id) {}
  bool operator<(const Node &o) const { return x < o.x; }
} a[maxn];
int b[maxn], c[maxn];
int r[maxn];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i].x);
    a[i].id = i;
    b[i] = c[i] = a[i].x;
  }
  sort(a + 1, a + n + 1);
  sort(b + 1, b + n + 1);
  for (int i = 1; i <= n; i++) {
    r[a[i].id] = i;
  }
  for (int i = 0; i < m; i++) {
    int p, l;
    cin >> p >> l;
    int x = c[p];
    int now = r[p], last = 0;
    int dir = 1;
    int k = upper_bound(b + 1, b + n + 1, x + l) - b;
    {
      l -= b[k - 1] - b[now];
      now = k - 1;
      last = p;
      k = lower_bound(b + 1, b + n + 1, b[now] - l) - b;
      last = now;
      now = k;
      l -= b[last] - b[now];
    }
    while (last != now) {
      int delta = abs(b[now] - b[last]);
      int numRotate = l / delta;
      l %= delta;
      if (numRotate & 1) {
        dir ^= 1;
        swap(now, last);
      }
      if (dir == 1) {
        k = upper_bound(b + 1, b + n + 1, b[now] + l) - b;
        l -= b[k - 1] - b[now];
        last = now;
        now = k - 1;
      } else {
        k = lower_bound(b + 1, b + n + 1, b[now] - l) - b;
        l -= b[now] - b[k];
        last = now;
        now = k;
      }
      dir ^= 1;
    }
    printf("%d\n", a[last].id);
  }
  return 0;
}
