#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int x, k;
  cin >> x >> k;
  vector<int> swp;
  int a1;
  for (int i = 0; i < k; i++) {
    cin >> a1;
    swp.push_back(a1);
  }
  int q;
  cin >> q;
  int t, a;
  for (int i = 0; i < q; i++) {
    cin >> t >> a;
    int lt = 0;
    int j;
    for (j = 0; j < swp.size(); j++) {
      if (swp[j] > t) break;
      int ps = swp[j] - lt;
      if (j % 2) {
        a = min(x, a + ps);
      } else {
        a = max(0, a - ps);
      }
      lt = swp[j];
    }
    int ps = t - lt;
    if (j % 2) {
      a = min(x, a + ps);
    } else {
      a = max(0, a - ps);
    }
    cout << a << endl;
  }
  return 0;
}
