#include <bits/stdc++.h>
using namespace std;
const int N = 200100;
int idx[N];
pair<int, int> pos[N];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    pos[i].second = i;
    scanf("%d", &pos[i].first);
  }
  sort(pos + 1, pos + n + 1);
  for (int i = 1; i <= n; i++) idx[pos[i].second] = i;
  pos[n + 1].first = (1 << 31) - 1;
  while (m--) {
    int x, l;
    scanf("%d%d", &x, &l);
    x = idx[x];
    for (;;) {
      int d = l;
      int y = lower_bound(pos + 1, pos + n + 2,
                          pair<int, int>(pos[x].first + l + 1, 0)) -
              pos - 1;
      l = l + pos[x].first - pos[y].first;
      int z = lower_bound(pos + 1, pos + n + 2,
                          pair<int, int>(pos[y].first - l, 0)) -
              pos;
      l = l + pos[z].first - pos[y].first;
      if (x == z) {
        if (x == y) {
          printf("%d\n", pos[x].second);
          break;
        }
        l = l % (d - l);
      }
      x = z;
    }
  }
  return 0;
}
