#include <bits/stdc++.h>
using namespace std;
vector<long long> r(100000);
vector<long long> t(100000);
vector<long long> init(100000);
void solve() {
  long long x, n;
  cin >> x >> n;
  for (long long i = (long long)0; i < (long long)n; i++) cin >> r[i];
  long long tt;
  cin >> tt;
  for (long long i = (long long)0; i < (long long)tt; i++) {
    cin >> t[i] >> init[i];
  }
  long long a = 0;
  long long val_a = 0;
  long long b = x;
  long long val_b = x;
  long long dir = -1;
  long long ptr = 0;
  for (long long i = (long long)0; i < (long long)n + 1; i++) {
    while (ptr < tt && (i == n || t[ptr] <= r[i])) {
      long long now = -1;
      if (init[ptr] <= a)
        now = val_a;
      else if (b <= init[ptr])
        now = val_b;
      else
        now = val_a + (init[ptr] - a);
      now += (t[ptr] - (i == 0 ? 0 : r[i - 1])) * dir;
      now = max(now, (long long)0);
      now = min(now, x);
      cout << now << endl;
      ptr++;
    }
    if (i < n) {
      int pass = r[i] - (i == 0 ? 0 : r[i - 1]);
      val_a += dir * pass;
      val_b += dir * pass;
      if (val_b < 0) {
        a = 0;
        val_a = 0;
        b = 0;
        val_b = 0;
      } else if (x < val_a) {
        a = 0;
        val_a = a;
        b = 0;
        val_b = x;
      } else {
        if (val_a < 0) {
          a -= val_a;
          val_a = 0;
        }
        if (x < val_b) {
          b -= val_b - x;
          val_b = x;
        }
      }
      dir = -dir;
    }
  }
  cout << flush;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
  return 0;
}
