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

/*
ID: toooooEasy or RafaelSaddatimov
PROG:
*/
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define MAX 100009
#define SQMAX 4048
#define SZ (MAX / SQMAX + 1)
#define MOD 163577857
#define INF 200000009
#define EPS 1e-8
#define ll long long
#define F first
#define S second
#define all(a) a.begin(), a.end()
#define pb push_back
#define io ios_base::sync_with_stdio(false); cin.tie(0)
using namespace std;
ll n, m, cl, ce, v, q, x1, y1, x2, y2;
ll l[MAX], e[MAX];

ll f(ll id, ll ver) {
    if(ver == 0)
        return l[id];
    return e[id];
}
ll bs(ll x, ll ver) {
    ll l = 1;
    ll r = ver ? ce : cl;
    ll rg = r;
    while(r - l >= 0) {
        ll mid = (l + r) >> 1;
        if(f(mid, ver) < x)
            l = mid + 1;
        else
            r = mid - 1;
    }
    if(l == rg + 1)
        --l;
    return l;
}
int main() {
    scanf("%lld%lld%lld%lld%lld", &n, &m, &cl, &ce, &v);
    for(ll i=1; i<=cl; ++i)
        scanf("%lld", &l[i]);
    for(ll i=1; i<=ce; ++i)
        scanf("%lld", &e[i]);
    scanf("%lld", &q);
    while(q--) {
        scanf("%lld%lld%lld%lld", &x1, &y1, &x2, &y2);
        if(x1 == x2) {
            printf("%lld\n", abs(y1 - y2));
            continue;
        }
        /*if(x1 > x2) {
            swap(x1, x2);
            swap(y1, y2);
        }else if(x1 == x2 && y1 > y2)
            swap(y1, y2);*/
        ll res = INF;
        ll id = bs(y1, 0);
        if(id != 1) {
            res = min(res, abs(y1 - l[id]) + abs(x1 - x2) + abs(l[id] - y2));
            res = min(res, abs(y1 - l[id - 1]) + abs(x1 - x2) + abs(l[id - 1] - y2));
        }
        else
            res = min(res, abs(y1 - l[id]) + abs(x1 - x2) + abs(l[id] - y2));
        if(!cl)
            res = INF;
        id = bs(y1, 1);
        if(ce) {
        if(id != 1) {
            res = min(res, abs(y1 - e[id]) + (abs(x1 - x2) / v) + min(abs(x1 - x2) % v, 1LL) + abs(l[id] - y2));
            res = min(res, abs(y1 - e[id - 1]) + (abs(x1 - x2) / v) + min(abs(x1 - x2) % v, 1LL) + abs(e[id - 1] - y2));
        }
        else
            res = min(res, abs(y1 - e[id]) + (abs(x1 - x2) / v) + min(abs(x1 - x2) % v, 1LL) + abs(e[id] - y2));}
        printf("%lld\n", res);
    }
}
