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 __gnu_pbds;
 
#define ll long long 
#define FI first 
#define SE second
#define pb push_back 
#define eb emplace_back
#define mod 1000000007
#define all(c) (c).begin(),(c).end()
#define LB  lower_bound
#define UB  upper_bound
#define max3(a,b,c) max(c,max(a,b))
#define min3(a,b,c) min(c,min(a,b))
#define mems(s, n) memset(s, n, sizeof(s))
#define NINF INT_MIN 
#define INF INT_MAX 
#define MP make_pair
#define int ll int
 
typedef pair<int,int> PII;
typedef pair<pair<int,int>,int> PPII;
typedef map<int,int>MII;
typedef vector<int> VI;
const int MAX = 1e4 + 5;
template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
/*int power(int a, int b)
{int x=1,y=a;while(b>0){if(b%2){x =(x*y)%mod;}y =(y*y)%mod;b/=2;}return x%mod;}
*/
//int modInverse(int a, int m) {return power(a, m-2);} //gcd(a,m)=1 
//int root(int x){return x==f[x]?x:f[x]=root(f[x]);}
 
 
signed main()
{
ios::sync_with_stdio(false); cin.tie(0);
int T=1,T1=0;//cin>>T;
while(T1++<T)
{
    int n,m,cs,ce,v;
    cin>>n>>m>>cs>>ce>>v;
    ordered_set<int>el,s;
    for(int i=0;i<cs;i++){int x;cin>>x;s.insert(x);}
    for(int i=0;i<ce;i++)
    {int x;cin>>x;el.insert(x);}
    int q;cin>>q;
    while(q--)
    {
        int x1,y1,x2,y2;
        cin>>y1>>x1>>y2>>x2;int ans=INF;
        if(x1>x2)swap(x1,x2),swap(y1,y2);
        //cout<<*el.find_by_order(el.order_of_key(x2+1));
        if(el.size()>0&&el.order_of_key(x2+1)>0&&*(--el.find_by_order(el.order_of_key(x2+1)))>=x1)
        {
            ans=(x2-x1)+(abs(y2-y1)-1)/v+1;
        }
        else
        {     if(el.size()>0){
            if(el.order_of_key(x2+1)>0)
            {
            ans=min(ans,2*(x1-*(--el.find_by_order(el.order_of_key(x2+1))))+(abs(y2-y1)-1)/v+1+x2-x1);
            }
            if(el.order_of_key(x2+1)!=el.size())
            {
                ans=min(ans,2*(*(el.find_by_order(el.order_of_key(x2+1)))-x2)+(abs(y2-y1)-1)/v+1+x2-x1);
            }
        }
        if(s.size()>0){
              if(s.order_of_key(x2+1)>0&&*(--s.find_by_order(s.order_of_key(x2+1)))>=x1)
        {   
            ans=min(ans,(x2-x1)+(abs(y2-y1)-1)+1);
        } else{
            if(s.order_of_key(x2+1)>0)
            {
            ans=min(ans,2*(x1-*(--s.find_by_order(s.order_of_key(x2+1))))+abs(y2-y1)+x2-x1);
            }
            if(s.order_of_key(x2+1)!=s.size())
            {
                ans=min(ans,2*(*(s.find_by_order(s.order_of_key(x2+1)))-x2)+abs(y2-y1)+x2-x1);
            }
        }
            
        }
            
        }
        cout<<ans<<endl;
    }
}
 
 
return 0;
}
 
 