#include <bits/stdc++.h>
typedef std::pair<long long, long long> PLL;
typedef std::pair<int, int> PII;
const int INF = (int)1e9;
const long long MOD = (long long)1e9 + 7;
const long long LINF = (long long)1e18 + 20;
const long double PI = acos(-1.0);
const double EPS = 1e-9;
using namespace ::std;
const int N = 100000;
vector<int> r(N);
vector<int> t(N);
vector<int> init(N);
void solve() {
  int x, n;
  cin >> x >> n;
  for (int i = 0; i < n; ++i) {
    cin >> r[i];
  }
  int tt;
  cin >> tt;
  for (int i = 0; i < tt; ++i) {
    cin >> t[i] >> init[i];
  }
  int a = 0;
  int val_a = 0;
  int b = x;
  int val_b = x;
  int dir = -1;
  int ptr = 0;
  for (int i = 0; i <= n; ++i) {
    while (ptr < tt && (i == n || t[ptr] <= r[i])) {
      int 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, 0);
      now = min(now, x);
      cout << now << '\n';
      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 = x;
        b = 0;
        val_b = 0;
      } 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;
}
signed main(void) {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  std::cout << std::fixed;
  cout << setprecision(16);
  solve();
}
