#include <bits/stdc++.h>
using namespace std;
class X {
 public:
  bool operator<(const X& rhs) const { return pos < rhs.pos; }
  int pos, id;
};
X c[200005];
int org[200005];
int id[200005];
long long x[200005];
void solve(int n) {
  int lb = 0, rb = n - 1, get;
  long long start, length;
  int way = 1;
  scanf("%d%I64d", &get, &length);
  start = org[get - 1];
  while (lb != rb) {
    if (way) {
      long long pos = start + length;
      rb = lb;
      int step = n;
      while (step) {
        while (rb + step > n - 1 || pos < x[rb + step]) step >>= 1;
        rb += step;
      }
      if (lb == rb) break;
      length -= x[rb] - start;
      if (length / (x[rb] - x[lb]) % 2 == 0) {
        way = 0;
        start = x[rb];
      } else
        start = x[lb];
    } else {
      long long pos = start - length;
      lb = rb;
      int step = n;
      while (step) {
        while (lb - step < 0 || pos > x[lb - step]) step >>= 1;
        lb -= step;
      }
      if (lb == rb) break;
      length -= start - x[lb];
      if (length / (x[rb] - x[lb]) % 2 == 0) {
        way = 1;
        start = x[lb];
      } else
        start = x[rb];
    }
    length %= (x[rb] - x[lb]);
  }
  printf("%d\n", id[rb]);
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &org[i]);
    c[i].id = i + 1;
    c[i].pos = org[i];
  }
  sort(c, c + n);
  for (int i = 0; i < n; i++) {
    x[i] = c[i].pos;
    id[i] = c[i].id;
  }
  while (m--) solve(n);
  return 0;
}
