#include <cstdio>
#include <iterator>
#include <iostream>
#include <sstream>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <climits>
#include <string>
#include <set>
#include <numeric>
#include <bitset>
#include <cmath>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <stack>
#include <numeric>
#include <vector>
#include <cassert>
#include <ctime>

using namespace std;
 
#define dump(...) do{print_vars(cout<<"# "<<#__VA_ARGS__<<'=',__VA_ARGS__);cout<<endl;}while(0)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define peri(i,a,b) for(int i=int(b);i-->int(a);)
#define rep(i,n) repi(i,0,n)
#define per(i,n) peri(i,0,n)
#define all(c) begin(c),end(c)
#define mp make_pair
#define mt make_tuple
 
using uint=unsigned;
using ll=long long;
using ull=unsigned long long;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using vd=vector<double>;
using vvd=vector<vd>;
using vs=vector<string>;
template<typename Ch,typename Tr,typename C>
basic_ostream<Ch,Tr>& operator<<(basic_ostream<Ch,Tr>& os,const C& c){
	os<<'[';
	copy(all(c), ostream_iterator<typename C::value_type>(os, " "));
	return os<<']';
}
 
void print_vars(ostream&){}
template<typename Car,typename... Cdr>
void print_vars(ostream& os,const Car& car,const Cdr&... cdr){
	print_vars(os<<car<<(sizeof...(cdr)?",":""),cdr...);
}
 
template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& p){
	return os<<'('<<p.first<<','<<p.second<<')';
}
 
template<int I,typename Tuple>
void print_tuple(ostream&,const Tuple&){}
template<int I,typename Car,typename... Cdr,typename Tuple>
void print_tuple(ostream& os,const Tuple& t){
	os<<get<I>(t)<<(sizeof...(Cdr)?",":"");
	print_tuple<I+1,Cdr...>(os,t);
}
template<typename... Args>
ostream& operator<<(ostream& os,const tuple<Args...>& t){
	print_tuple<0,Args...>(os<<'(',t);
	return os<<')';
}
 
 
constexpr int INF=1e9;
constexpr int MOD=1e9+7;
constexpr double EPS=1e-9;

ll x, k, q;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	while(cin>>x) {
		cin>>k;
vl ri(k+1, 0ll), xi(k+1,0ll), yi(k+1,0ll), ai(k+1,0ll), bi(k+1,0ll);
		rep(i, k) cin>>ri[i+1];
		yi[0] = bi[0] = x;

		rep(i, k) {
			ll e = ri[i+1]-ri[i];
			if(i&1) {
				xi[i+1] = min(xi[i]+e, x);
				yi[i+1] = min(yi[i]+e, x);
				if(yi[i]+e <= x) 
					bi[i+1] = bi[i];
				else 
					bi[i+1] = max(ai[i], bi[i] - (e+yi[i] - x));
				ai[i+1] = ai[i];
			} else {
				xi[i+1] = max(xi[i] - e, 0ll);
				yi[i+1] = max(yi[i] - e, 0ll);
				if(xi[i] - e >= 0) 
					ai[i+1] = ai[i];
				else 
					ai[i+1] = min(ai[i] + e - xi[i], bi[i]);
				bi[i+1] = bi[i];
			}
		}
		//dump(ri, ai, bi, xi, yi);

		cin>> q;
		ll ret;
		rep(_, q) {
			ll t, a;
			cin>>t>>a;
			int ind = upper_bound(all(ri), t) -begin(ri) - 1;
			int e = t - ri[ind];
			if(ind &1) {
				if(a <= ai[ind])
					ret = min(xi[ind] + e, x);
				else if(a <= bi[ind])
					ret = min(xi[ind]+ (a-ai[ind]) +e, x);
				else 
					ret = min(yi[ind] + e, x);
			} else {
				if(a <= ai[ind]) 
					ret = max(xi[ind] - e, 0ll);
				else if ( a <= bi[ind])
					ret = max(xi[ind] + (a - ai[ind]) -e, 0ll);
				else 
					ret = max(yi[ind] - e, 0ll);
			}
			cout << ret << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 5120