#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = std::tuple<int, int>;
const int dx[8] = {-1, 1, 0, 0, -1, -1, 1, 1},
          dy[8] = {0, 0, -1, 1, -1, 1, -1, 1};
vector<tuple<int, int, int> > v;
int X, K, Q;
int rs[100100];
int main() {
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);
  std::cin >> X;
  std::cin >> K;
  for (int i = 1; i <= K; ++i) {
    std::cin >> rs[i];
    v.emplace_back(rs[i], 2, -1);
  }
  std::cin >> Q;
  for (int i = 0; i < Q; ++i) {
    int t, a;
    std::cin >> t >> a;
    v.emplace_back(t, 1, a);
  }
  sort(v.begin(), v.end());
  int l = 0, u = X, plus = 0;
  int lastTime = 0;
  bool position = 0;
  for (int i = 0; i < v.size(); ++i) {
    int t, qt, some;
    tie(t, qt, some) = v[i];
    if (qt == 1) {
      int x;
      {
        if (some >= u) {
          x = u + plus;
        } else if (some <= l) {
          x = l + plus;
        } else {
          x = some + plus;
        }
      }
      if (position == 0) {
        x -= t - lastTime;
      } else {
        x += t - lastTime;
      }
      if (x < 0) {
        x = 0;
      }
      if (x > X) {
        x = X;
      }
      std::cout << x << std::endl;
    } else {
      int passedTime = min(t - lastTime, X);
      int _l, _u, _plus;
      if (position == 0) {
        _l = passedTime;
        _u = X;
        _plus = -passedTime;
      } else {
        _l = 0;
        _u = X - passedTime;
        _plus = passedTime;
      }
      if (l <= _l - plus) {
        l = min(_l - plus, X);
      }
      if (u >= _u - plus) {
        u = max(_u - plus, 0);
      }
      plus += _plus;
      lastTime = t;
      position = !position;
    }
  }
}
