2 10 1 1 1
1
10
1
1 5 1 8
 4 4 1 0 1
1

1
1 2 1 4
 2 5 1 0 1
2

1
1 4 1 5
 10 10 1 8 4
10
2 3 4 5 6 7 8 9
10
1 1 3 1
2 1 7 1
1 1 9 1
7 1 4 1
10 1 7 1
2 1 7 1
3 1 2 1
5 1 2 1
10 1 5 1
6 1 9 1
 2 4 1 1 1
1
4
1
1 2 1 3
 2 2 0 1 1

1
1
1 2 2 2
 1000 1000 1 1 10
1
2
1
1 900 1 1000
 5 5 1 1 1
3
2
1
1 5 1 1
 2 4 1 1 1
1
2
1
2 3 2 4
 4 4 1 0 1
4

5
1 1 2 2
1 3 2 2
3 3 4 3
3 2 2 2
1 2 2 3

3
 2
 1
 3
4
4
3
3
4
3
3
4
3
 1
 3
 100
 4
 1
 6
4
3
5
4

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

using namespace std;
using namespace __gnu_pbds;
 
#define LL          long long int
#define ULL         unsigned long long
#define lc          idx * 2
#define rc          lc | 1 
#define pb          push_back
#define pf          push_front
#define S           second
#define F           first
#define mp          make_pair
#define ios         ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
 
#define dbg(x)          cerr << #x << " : " << x << endl;
#define dbg2(x, y)      cerr << #x << " : " << x << " " << #y << " : " << y << endl;
#define dbg3(x, y, z)   cerr << #x << " : " << x << " " << #y << " : " << y << " " << #z << " : " << z << endl;

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update > ordered_set;

const LL  INF = 1600000000000000000LL;   // 1.6 * 10^18
const int MOD = 1000000007;              // 1e9 + 7
double eps = 0.0000000001;

LL powmod(LL a,LL b,LL mo=MOD){LL res=1;a%=mo; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mo;a=a*a%mo;}return res;}
inline LL inv(LL a) {return powmod(a, MOD-2, MOD);}

//cout << fixed << setprecision(8);

/* 
    int start_s=clock();
    // the code you wish to time goes here
    int stop_s=clock();
    cout << "time: " << (stop_s-start_s)/double(CLOCKS_PER_SEC) << endl;
*/

const int dx8[] = {1, 1, 0, -1, -1, -1, 0,1};
const int dy8[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int dx4[] = {0, 0, 1 , -1};
const int dy4[] = {1, -1, 0, 0};

const int N = 2e6 + 5;

LL n, m, cl, ce, v;
LL l[N];
LL e[N];

int q;

int main()
{
	//freopen("in.txt","r",stdin);
	scanf("%lld%lld%lld%lld%lld", &n, &m, &cl, &ce, &v);
	
	//cout << "hello\n";
	for(int i = 1; i <= cl; i++){cin >> l[i];}
	for(int i = 1; i <= ce; i++){cin >> e[i];}
	sort(l + 1, l + 1 + cl);
	sort(e + 1, e + 1 + ce);
	
	int q;
	scanf("%d", &q);
	
	while(q--)
	{
		LL xa, xb, ya, yb;
		scanf("%lld%lld%lld%lld", &xa, &ya, &xb, &yb);
		
		// only run
		
		LL finAns = INF;
		if(xa == xb)
		{
			LL xxx = abs(ya - yb);
			finAns = min(finAns, xxx);
		}
		
		if(cl > 0 and xa != xb)
		{
			int lo = 1;
			int hi = cl;
			LL ansA = 0, ansB = 0;
			
			// first find left most.
			// then find right most.
			int lBest = -1;
			int rBest = -1;
			
			while(hi - lo > 2)
			{
				int mid = (lo + hi) / 2;
				if(l[mid] > ya)hi = mid;
				else lo = mid;
			}
			
			while(lo <= hi and l[hi] > ya)hi--;
			
			if(hi == 1 and l[hi] > ya)lBest = -1;
			else lBest = l[hi];
			
			lo = 1;
			hi = cl;
			
			while(hi - lo > 2)
			{
				int mid = (lo + hi) / 2;
				if(l[mid] >= ya)hi = mid;
				else lo = mid;
			}
			
			while(lo <= hi and l[lo] < ya)lo++;
			if(lo == cl and l[lo] < ya)rBest = -1;
			else rBest = l[lo];
			
			LL gLeft, gRight;
			if(lBest > -1)
			{
				gLeft = abs(ya - lBest);
				gLeft += abs(xa - xb);
				gLeft += abs(yb - lBest);
			}
			
			if(rBest > -1)
			{
				gRight = abs(ya - rBest);
				gRight += abs(xa - xb);
				gRight += abs(yb - rBest);
			}
			
			
			if(lBest > -1)
			{
				finAns = min(finAns, gLeft);
			}
			if(rBest > -1)
			{
				finAns = min(finAns, gRight);
			}
		}
		
		if(ce > 0 and xa != xb)
		{
			int lo = 1;
			int hi = ce;
			LL ansA = 0, ansB = 0;
			
			// first find left most.
			// then find right most.
			int lBest = -1;
			int rBest = -1;
			
			while(hi - lo > 2)
			{
				int mid = (lo + hi) / 2;
				if(e[mid] > ya)hi = mid;
				else lo = mid;
			}
			
			while(lo <= hi and e[hi] > ya)hi--;
			
			if(hi == 1 and e[hi] > ya)lBest = -1;
			else lBest = e[hi];
			
			lo = 1;
			hi = ce;
			
			while(hi - lo > 2)
			{
				int mid = (lo + hi) / 2;
				if(e[mid] >= ya)hi = mid;
				else lo = mid;
			}
			
			while(lo <= hi and e[lo] < ya)lo++;
			if(lo == cl and e[lo] < ya)rBest = -1;
			else rBest = e[lo];
			
			LL gLeft, gRight;
			if(lBest > -1)
			{
				gLeft = abs(ya - lBest);
				LL xoxo = abs(xa - xb);
				LL upDown = xoxo / v;
				LL chu = xoxo % v;
				if(chu > 0)upDown++;
				gLeft += upDown;
				gLeft += abs(yb - lBest);
			}
			
			if(rBest > -1)
			{
				gRight = abs(ya - rBest);
				LL xoxo = abs(xa - xb);
				LL upDown = xoxo / v;
				LL chu = xoxo % v;
				if(chu > 0)upDown++;
				gRight += upDown;
				gRight += abs(yb - rBest);
			}
			
			
			if(lBest > -1)
			{
				finAns = min(finAns, gLeft);
			}
			if(rBest > -1)
			{
				finAns = min(finAns, gRight);
			}
		}
		
		printf("%lld\n", finAns);
	}
}
