#include <bits/stdc++.h>
using namespace std;
using vec = vector<long long>;
using mat = vector<vec>;
using Pii = pair<long long, long long>;
using PiP = pair<long long, Pii>;
using PPi = pair<Pii, long long>;
using bools = vector<bool>;
template <typename T>
void readv(vector<T> &a) {
  for (long long i = (0); i < (a.size()); i++) cin >> a[i];
}
void readi(vector<long long> &a) {
  for (long long i = (0); i < (a.size()); i++) {
    cin >> a[i];
    a[i]--;
  }
}
template <typename T>
void debug(vector<vector<T>> m) {
  for (long long i = (0); i < (m.size()); i++) {
    for (long long j = (0); j < (m[i].size()); j++) {
      cout << m[i][j] << ",";
    }
    cout << endl;
  }
}
signed main() {
  long long X;
  cin >> X;
  long long K;
  cin >> K;
  vec r(K + 2);
  r[0] = 0;
  for (long long i = (0); i < (K); i++) cin >> r[i + 1];
  r[K + 1] = 1000000000000000000;
  long long Q;
  cin >> Q;
  vec t(Q), a(Q);
  for (long long i = (0); i < (Q); i++) cin >> t[i] >> a[i];
  long long A = 0, B = X, C = 0;
  long long i0 = 0;
  for (long long i = (0); i < (K + 1); i++) {
    while (i0 < Q && t[i0] < r[i + 1]) {
      long long ans;
      if (a[i0] <= A)
        ans = A + C;
      else if (a[i0] >= B)
        ans = B + C;
      else
        ans = a[i0] + C;
      if (i % 2 == 0)
        ans -= t[i0] - r[i];
      else
        ans += t[i0] - r[i];
      ans = max(ans, 0LL);
      ans = min(ans, X);
      cout << ans << endl;
      i0++;
    }
    long long dt = r[i + 1] - r[i];
    if (i % 2 == 0) {
      if (A + C >= dt)
        C -= dt;
      else if (A + B <= dt) {
        A = 0;
        B = 0;
        C = 0;
      } else {
        A = dt - C;
        C -= dt;
      }
    } else {
      if (B + C + dt <= X)
        C += dt;
      else if (A + C + dt >= X) {
        A = 0;
        B = 0;
        C = X;
      } else {
        B = X - dt - C;
        C += dt;
      }
    }
  }
  return 0;
}
