#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, a = 1, b = 0, 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 <= l) {
        x = a * l + b;
      } else if (u <= some) {
        x = a * u + b;
      } else {
        x = a * some + b;
      }
      int passedTime = t - lastTime;
      if (position == 0) {
        x -= passedTime;
      } else {
        x += passedTime;
      }
      if (x < 0) {
        x = 0;
      }
      if (x > X) {
        x = X;
      }
      std::cout << x << std::endl;
    } else {
      int passedTime = min(t - lastTime, X);
      if (a == 0) {
        if (position == 0) {
          b -= passedTime;
          if (b < 0) {
            b = 0;
          }
        } else {
          b += passedTime;
          if (b > X) {
            b = X;
          }
        }
      } else {
        if (position == 0) {
          if (passedTime <= a * l + b) {
            b -= passedTime;
          } else if (a * u + b <= passedTime) {
            l = 0;
            u = X;
            a = 0;
            b = 0;
          } else {
            l = passedTime - b;
            b -= passedTime;
          }
        } else {
          if (X - passedTime >= a * u + b) {
            b += passedTime;
          } else if (a * l + b >= X - passedTime) {
            l = 0;
            u = X;
            a = 0;
            b = X;
          } else {
            u = passedTime - b;
            b += passedTime;
          }
        }
      }
      lastTime = t;
      position = !position;
    }
  }
}
