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 <iostream>
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define M 998244353
#define fr(i,n) for(int i=0;i<n;i++)
#define M2 1000000007
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb push_back
#define f first
#define s second
#define F(i,a,b) for(i=a;i<b;i++)
#define nl   "\n"
#define sp   " " 
#define all(c) (c).begin(),(c).end()
typedef long double ld;
typedef long long   ll;
typedef vector<ll>  vll;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;
#define rev(i,b,a) for(int i=b;i>=a;i--)
#define iota  cout<<-1<<nl
#define cty  cout<<"YES"<<nl
#define ctn   cout<<"NO"<<nl
#define lmax  LLONG_MAX
#define lmin  LLONG_MIN
#define csp(x) cout<<(x)<<" "
#define c1(x) cout<<(x)<<nl
#define c2(x,y) cout<<(x)<<" "<<(y)<<nl
#define c3(x,y,z) cout<<(x)<<" "<<(y)<<" "<<(z)<<nl
#define c4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<nl
#define c5(a,b,c,d,e) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<nl
#define c6(a,b,c,d,e,f) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<" "<<(f)<<nl
#define sz(v) (v).size()
const double pi=3.14159265358979323846264338327950288419716939937510582097494459230;
#define CASES  ll t;cin>>t;while(t--)
ll x1,y1,x2,y2;
ll calc(ll cor , vector<ll> &vec,ll v)
{
	ll r = lower_bound(all(vec),cor)-vec.begin();
	ll s = upper_bound(all(vec),cor)-vec.begin();
	s--;
	ll o=LLONG_MAX,p=LLONG_MAX;
	if(s!=-1)
	{
		ll j = ceil(abs(x2-x1)/(v*1.0));
		ll k = abs(y1-vec[s])+abs(vec[s]-y2);
		o=j+k;
	}
	if(r!=vec.size())
	{
		ll j = ceil(abs(x2-x1)/(v*1.0));
		ll k = abs(y1-vec[r])+abs(vec[r]-y2);
		p=j+k;
	}
	return min(o,p);
}
int main()
{
	fast;
	#ifndef ONLINE_JUDGE
   		freopen("input.txt","r",stdin);
 		freopen("error.txt","w",stderr);
   		freopen("output.txt","w",stdout);
	#endif
   	ll n,m,cl,ce,v,i;
   	cin>>n>>m>>cl>>ce>>v;
   	std::vector<ll> a(cl),b(ce);
   	F(i,0,cl)
   	cin>>a[i];
   	F(i,0,ce)
   	cin>>b[i];
   	sort(all(a));
   	sort(all(b));
   	ll q;
   	cin>>q;
   	while(q--)
   	{
   		
   		cin>>x1>>y1>>x2>>y2;
   		ll ans = min({calc(y1,a,1),calc(y1,b,v),calc(y2,a,1),calc(y2,b,v)});
   		cout<<ans<<"\n";
   	}
   	return 0;
}

/*Lower Bound : the function returns the index of the next smallest number just 
greater than or equal to that number.

Upper Bound : It returns an iterator pointing to the first element in the range 
[first, last) that is greater than value, or last if no such element is found.*/



