#include <bits/stdc++.h>
using namespace std;
struct edge {
  int to, cost;
  edge(int t, int c) : to(t), cost(c) {}
};
int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1};
int X, A[100000], R[100000], T[100000];
int K, Q;
int dir = -1, l, u, m;
int t, dif, j;
void calc(int tmp) {
  t += abs(tmp), dif += tmp;
  l = max(0, min(X, l + tmp));
  u = max(0, min(X, u + tmp));
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> X >> K;
  for (int i = (0); i < (K); ++i) cin >> R[i];
  cin >> Q;
  for (int i = (0); i < (Q); ++i) cin >> T[i] >> A[i];
  u = X;
  for (int i = (0); i < (Q); ++i) {
    while (j < K && R[j] < T[i]) calc((R[j++] - t) * dir), dir = -dir;
    calc((T[i] - t) * dir);
    cout << max(l, min(u, A[i])) << endl;
  }
  return 0;
}
