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/hash_map>
#include <ext/hash_set>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/priority_queue.hpp>
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
#define XINF INT_MAX
#define INF 0x3F3F3F3F
#define MP(X,Y) make_pair(X,Y)
#define PB(X) push_back(X)
#define REP(X,N) for(int X=0;X<N;X++)
#define REP2(X,L,R) for(int X=L;X<=R;X++)
#define DEP(X,R,L) for(int X=R;X>=L;X--)
#define CLR(A,X) memset(A,X,sizeof(A))
#define IT iterator
#define RIT reverse_iterator
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef vector<PII> VII;
typedef vector<int> VI;
typedef tree<PII, null_type, greater<PII>, rb_tree_tag, tree_order_statistics_node_update > rb_tree_set;
typedef tree<PII, PII, greater<PII>, rb_tree_tag, tree_order_statistics_node_update > rb_tree;
#define PQ std::priority_queue
#define HEAP __gnu_pbds::priority_queue
#define X first
#define Y second
#define lson(X) ((X)<<1)
#define rson(X) ((X)<<1|1)
#define EPS 10e-6
#define pi acos(-1)
#define N 100010
ll cL[N], ce[N];
ll n, m, v;

int main()
{
//    REP2(i, 1, 5)
//        scanf("%d", &cL[i]);
    //cout << lower_bound(cL+1, cL+1, 6) - cL << endl;

    int num1 = 0, num2 = 0;
    scanf("%lld%lld%d%d%lld", &n, &m, &num1, &num2, &v);
    for(int i = 1; i <= num1; ++i)
        scanf("%d", &cL[i]);
    for(int i = 1; i <= num2; ++i) {
        scanf("%d", &ce[i]);
    }
    int Q;
    scanf("%d", &Q);
    while(Q--) {
        ll x1, x2, y1, y2;
        scanf("%lld%lld%lld%lld", &x1, &y1, &x2, &y2);
        if(x1 > x2)
            swap(x1, x2);
        if(y1 > y2)
            swap(y1, y2);
        ll pos1 = lower_bound(cL+1, cL+num1+1, x1) - cL;
        ll pos2 = pos1 - 1;
        ll pos3 = lower_bound(ce+1, ce+num2+1, x1) - ce;
        ll pos4 =pos3 - 1;
        ll ans = INF;
        if(pos1 <= num1) {
            ll sum = 0;
            ll t = cL[pos1];
            if(t > y2)
                sum += t - y2;
            else
                sum += y2 - t;
            sum = sum + t - y1 + x2 - x1;
            ans = min(ans ,sum);
        }
        if(pos2 >= 1) {
            ll sum = y1 - cL[pos2] + y2 - cL[pos2] + x2 - x1;
            ans = min(ans , sum);
        }
        if(pos3 <= num2) {
            ll sum = 0;
            ll t = ce[pos3];
            if(t > y2)
                sum += t - y2;
            else
                sum += y2 - t;
            sum = sum + t - y1 + ceil(1.0*(x2-x1)/v);
            ans = min(ans, sum);
        }
        if(pos4 >= 1) {
            ll sum = 0;
            ll t = ce[pos4];
            sum = y1-t+y2-t + ceil(1.0*(x2-x1)/v);
            ans = min(ans, sum);
        }
        printf("%lld\n", ans);
    }
    return 0;
}
