#include <bits/stdc++.h>
using namespace std;
void desperate_optimization(int precision) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.setf(ios::fixed);
  cout.setf(ios::showpoint);
  cout.precision(precision);
}
const int N = 2e5;
pair<int, int> arr[N + 5];
int position[N + 5];
void hora(int tc) {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i].first;
    arr[i].second = i;
  }
  sort(arr + 1, arr + n + 1);
  for (int i = 1; i <= n; i++) position[arr[i].second] = i;
  while (m--) {
    int x, y;
    cin >> x >> y;
    int id = position[x];
    int lhs = id;
    int rhs = n;
    int pr = id, pl = id;
    int res = id;
    while (lhs <= rhs) {
      int mid = (lhs + rhs) / 2;
      if (arr[id].first + y >= arr[mid].first) {
        pr = mid;
        lhs = mid + 1;
      } else
        rhs = mid - 1;
    }
    if (pr != id) y -= arr[pr].first - arr[id].first;
    res = arr[pr].second;
    int dir = 0;
    while (y) {
      if (dir == 0) {
        int lhs = 1;
        int rhs = n;
        int nl = pr;
        while (lhs <= rhs) {
          int mid = (lhs + rhs) / 2;
          if (arr[pr].first - y <= arr[mid].first) {
            nl = mid;
            rhs = mid - 1;
          } else
            lhs = mid + 1;
        }
        int diff = arr[pr].first - arr[nl].first;
        if (diff == 0) {
          y = 0;
          break;
        }
        if (y / diff % 2) res = arr[nl].second;
        dir = (dir + (y / diff) % 2) % 2;
        y %= diff;
        pl = nl;
      } else {
        int lhs = 1;
        int rhs = n;
        int nr = pl;
        while (lhs <= rhs) {
          int mid = (lhs + rhs) / 2;
          if (arr[pl].first + y >= arr[mid].first) {
            nr = mid;
            lhs = mid + 1;
          } else
            rhs = mid - 1;
        }
        int diff = arr[nr].first - arr[pl].first;
        if (diff == 0) {
          y = 0;
          break;
        }
        if (y / diff % 2) res = arr[nr].second;
        dir = (dir + (y / diff) % 2) % 2;
        y %= diff;
        pr = nr;
      }
    }
    cout << res << '\n';
  }
}
int main() {
  desperate_optimization(10);
  int ntc = 1;
  for (int tc = 1; tc <= ntc; tc++) hora(tc);
  return 0;
}
