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>
using namespace std;
using namespace std::chrono;
using namespace __gnu_pbds;

// agr set ki tarah krna hai to less vrna agr multiset ki tarah to less_equal
#define ordered_set tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>

const long long int mod97 = 1000000007;
const long long int modg = 998244353;
const long long int inf = 1e17;
const long long int M = 1e8;
double pi = 3.1415926536;

bool rev(long long int a, long long int b) {if (a > b)return true; else return false;}

long long int powerm(long long int a, long long int n, long long int modn)
{
    if (n == 0)return 1; if (n % 2 == 0) {long long int val = powerm(a, n / 2, modn); val = (val * val) % modn; return val;}
    else {long long int val = powerm(a, n / 2, modn); val = ((val * val) % modn * a) % modn; return val;}
}
long long int power(long long int a, long long int n)
{
    if (n == 0)return 1; if (n % 2 == 0) {long long int val = power(a, n / 2); val = (val * val); return val;}
    else {long long int val = power(a, n / 2); val = ((val * val) * a) ; return val;}
}
//https://www.hackerearth.com/problem/algorithm/easy-queries-751f9372/?source=list_view  lower and upper bound auto it=s.lower_bound(x),(*(it--)) mtlb x se just chota number ,it0=s.upper_bound(x);(*it0) mtlb x se just badda number
long long int fac[1000005];
long long int fexp(long long int a, long long int b, long long int m)
{int ans = 1; while (b) {if (b & 1)ans = ans * a % m; b /= 2; a = a * a % m;} return ans;}
long long int inverse(int a, int p) {return fexp(a, p - 2, p);}
long long int ncr(long long int n, long long int r, long long int p)
{if (r == 0) return 1; return (fac[n] * inverse(fac[r], p) % p * inverse(fac[n - r], p) % p) % p;}

const long long int N = 2e3 + 5;

// long long int spf[N];
// long long int prime[N];
// vector<long long int>pr;
void solve()
{
    long long int n,m,ns,ne,v;cin>>n>>m>>ns>>ne>>v;
    vector<long long int>s(ns),e(ne);
    for(long long int i=0;i<ns;i++)
    {
        cin>>s[i];s[i]--;
    }
    for(long long int i=0;i<ne;i++)
    {
        cin>>e[i];e[i]--;
    }
    long long int q;cin>>q;
    while(q--)
    {
        long long int x1,y1,x2,y2;cin>>x1>>y1>>x2>>y2;x1--,y1--,x2--,y2--;
        //main is y1 and y2
        long long int ans=INT_MAX;
        if(y1>y2)swap(y1,y2);
        long long int ht=abs(x1-x2);
        long long int l=0,r=ns-1,hh=-1;
        while(l<=r)
        {
            long long int mid=l+(r-l)/2;
            if(s[mid]>y2)r=mid-1;
            else if(s[mid]<y1)l=mid+1;
            else
            {
                // cout<<mid<<" "<<y1<<" "<<y2<<endl;
                hh=mid;break;
            }
        }
        if(hh!=-1)
        {
            ans=ht+y2-y1;
            // cout<<ans<<endl;
        }
        l=0,r=ne-1,hh=-1;
        while(l<=r)
        {
            long long int mid=l+(r-l)/2;
            if(e[mid]>y2)r=mid-1;
            else if(e[mid]<y1)l=mid+1;
            else
            {
                hh=mid;break;
            }
        }
        if(hh!=-1)
        {
            hh=e[hh];
            long long int looo=y2-y1;looo+=(ht+v-1)/v;
            ans=min(ans,looo);
        }
        l=0,r=ne-1,hh=-1;
        while(l<=r)
        {
            long long int mid=l+(r-l)/2;
            if(e[mid]>y1)r=mid-1;
            else
            {
                l=mid+1;
                hh=mid;
            }
        }
        if(hh!=-1)
        {
            hh=e[hh];
            long long int looo=y2-y1+(ht+v-1)/v+2*(y1-hh);ans=min(ans,looo);
        }
        l=0,r=ne-1,hh=-1;
        while(l<=r)
        {
            long long int mid=l+(r-l)/2;
            if(e[mid]>=y2)r=mid-1,hh=mid;
            else
            {
                l=mid+1;
            }
        }
        if(hh!=-1)
        {
            hh=e[hh];
            long long int looo=y2-y1+(ht+v-1)/v+2*(hh-y2);ans=min(ans,looo);
        }
        l=0,r=ns-1,hh=-1;
        while(l<=r)
        {
            long long int mid=l+(r-l)/2;
            if(s[mid]>=y2)r=mid-1,hh=mid;
            else l=mid+1;
        }
        if(hh!=-1)
        {
            hh=s[hh];
            long long int looo=ht+y2-y1+2*(hh-y2);ans=min(ans,looo);
        }
        l=0,r=ns-1,hh=-1;
        while(l<=r)
        {
            long long int mid=l+(r-l)/2;
            if(s[mid]<=y1)l=mid+1,hh=mid;
            else r=mid-1;
        }
        if(hh!=-1)
        {
            hh=s[hh];
            long long int looo=ht+y2-y1+2*(y1-hh);ans=min(ans,looo);
        }
        cout<<ans<<endl;
        
    }
}


int main()
{
    auto start = high_resolution_clock::now();
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

#ifndef ONLINE_JUDGE
    freopen("input.txt", "r" , stdin);
    freopen("output.txt", "w", stdout);
#endif

    //fac[0] = 1; fac[1] = 1; for (long long int i = 2; i < 1000005; i++)fac[i] = (fac[i - 1] * i) % mod97;

    int tc, count = 0;

    tc = 1;

    //sieve
    // for (long long int i = 0; i < N; i++)prime[i] = 1, spf[i] = i;
    // for (long long int p = 2; p * p < N; p++)if (prime[p] == 1)for (long long int i = p * p; i < N; i += p)prime[i] = 0, spf[i] = p; prime[1] = prime[0] = 0;
    // for (long long int i = 0; i < N; i++)if (prime[i])pr.push_back(i);

    // cin >> tc;

    while (tc--)
    {
        count++;
        solve();
    }
    auto stop = high_resolution_clock::now();
    auto duration = duration_cast<microseconds>(stop - start);
    cerr << "Time taken : " << duration.count() / 1000000.0 << "seconds" << "\n";
}
