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 <stdio.h>
#include <iostream>
#include <math.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <bitset>
#include <algorithm>
#include <queue>
#include <time.h>
#include <unistd.h>
#include <iomanip>
#include <unordered_map>
using namespace std;

#define task "tmp"
#define ini freopen(task".inp", "r", stdin); freopen(task".out", "w", stdout)
#define long long long
#define fo(i,a,b) for ( long i = (long) a; i <= (long) b; i++)
#define fu(i,a,b) for ( long i = (long) a; i >= (long) b; i--)
#define fe(ia,a) for(__typeof((a).begin())ia=(a).begin();ia!=(a).end();ia++)
#define PLL pair<long,long>
#define x first
#define y second
#define wx begin()
#define wy end()
#define endl "\n"
#define db(a) cout << a << " "
#define de(a) cout << a << endl
#define dv(a) fe(ia,a) db(*ia); de("");
#define vi vector<long>
#define aw(a) (a).begin(), (a).end()

const long N = 5e5;
long n, m, ca, cb, v, x1, x2, y1, y2, l, r, da, db, a[N], b[N], o;
main()
{
	cin >> n >> m >> ca >> cb >> v;
	fo(i,1,ca) cin >> a[i];
	fo(i,1,cb) cin >> b[i];

	sort(a + 1, a + 1 + ca);
	sort(b + 1, b + 1 + cb);
	a[0] = b[0] = -1e12;
	a[++ca] = b[++cb] = 1e12;

	cin >> o;
	while (o--)
	{
		cin >> y1 >> x1 >> y2 >> x2;
		l = *(prev(lower_bound(a + 1, a + 1 + ca, x1)));
		r = *lower_bound(a + 1, a + 1 + ca, x1);

		da = min(abs(l - x1) + abs(l - x2), abs(r - x1) + abs(r - x2))
			+ abs(y1 - y2);

		l = *(prev(lower_bound(b + 1, b + 1 + cb, x1)));
		r = *lower_bound(b + 1, b + 1 + cb, x1);
		db = min(abs(l - x1) + abs(l - x2), abs(r - x1) + abs(r - x2))
			+ ceil((double)abs(y1 - y2) / v);
		de(min(da, db));
	}
}
