#include <bits/stdc++.h>
int CH, NEG;
template <typename TP>
inline void read(TP& ret) {
  ret = NEG = 0;
  while (CH = getchar(), CH < '!')
    ;
  if (CH == '-') NEG = true, CH = getchar();
  while (ret = ret * 10 + CH - '0', CH = getchar(), CH > '!')
    ;
  if (NEG) ret = -ret;
}
int n, data[200010LL], id[200010LL], rank[200010LL], val[200010LL];
inline bool cmp(const int& a, const int& b) { return data[a] < data[b]; }
int main() {
  int m, i, p, q, l, d, r;
  bool unord;
  read(n), read(m);
  unord = false, data[0] = -2000000001LL;
  for (i = (1); i <= (n); i++)
    if (read(data[i]), id[i] = i, data[i - 1] > data[i]) unord = true;
  if (unord) std::sort(id + 1, id + n + 1, cmp);
  for (i = (1); i <= (n); i++) rank[id[i]] = i, val[i] = data[id[i]];
  val[n + 1] = 2000000001LL;
  while (m-- > 0) {
    read(p), read(l), p = rank[p];
    q = std::upper_bound(val, val + n + 2, val[p] + l) - val - 1;
    l -= val[q] - val[p], p = q, d = -1;
    while (true) {
      if (d == 1)
        q = std::upper_bound(val + 1, val + n + 2, val[p] + l * d) - val - 1;
      else
        q = std::lower_bound(val + 1, val + n + 2, val[p] + l * d) - val;
      if (p == q) break;
      if (r = std::abs(val[p] - val[q]), (l / r) & 1) p = q, d = -d;
      l %= r;
    }
    printf("%d\n", id[p]);
  }
  getchar(), getchar();
  return 0;
}
