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>
#define int long long
#define pet pair<int,int>
#define one first
#define two second

using namespace std;

void solve()
{
	int n,m,cl,ce,v;
	cin >> n >> m >> cl >> ce >> v;
	
	int stairs[cl];
	int elev[ce];
	for(int i=0;i<cl;i++)
	cin >> stairs[i];
	
	for(int i=0;i<ce;i++)
	cin >> elev[i];
	
	int x1,y1,x2,y2,q;
	cin >> q;
	
	int ansl=INT_MAX;
	int anse=INT_MAX;
	int ansl1=INT_MAX;
	int* s1,*s2,*e1,*e2;
	int elevx,staix;
	while(q--)
	{
		ansl=INT_MAX;
		anse=INT_MAX;
		ansl1=INT_MAX;
		cin >> x1 >> y1 >> x2 >> y2;
		if(x1==x2)
		{
			cout << abs(y2-y1) << endl;
			continue;
		}
		
		s1=upper_bound(stairs,stairs+cl,y1);
		s2=s1--;
		
		e1=upper_bound(elev,elev+ce,y1);
		e2=e1--;
		
		if(s2<stairs+cl)
		{
			staix=*s2;
			ansl=*s2-y1;
		}
		
		if(s1>=stairs)
		{
			if(y1-*s1<ansl)
			{
				staix=*s1;
				ansl=y1-*s1;
			}
			//ansl=min(ansl,x1-*s1);
		}
		
		if(e2<elev+ce)
		{
			anse=*e2-y1;
			elevx=*e2;
		}
		
		if(e1>=elev)
		{
			if(y1-*e1<anse)
			{
				anse=y1-*e1;
				elevx=*e1;
			}
		}

		ansl+=abs(x2-x1);
		anse+=(abs(x2-x1)-1)/v+1;
		
		// if((x2-x1)%v!=0)
		// {
		// 	s1=upper_bound(stairs,stairs+cl,elevx);
		// 	s2=s1--;
			
		// 	if(s2<stairs+cl)
		// 	{
		// 		ansl1=*s2-elevx;
		// 	}
			
		// 	if(s1>=stairs)
		// 	{
		// 		ansl1=min(ansl,elevx-*s1);
		// 	}
			
		// 	anse+=ansl1;
		// }
		
		ansl+=abs(staix-y2);
		anse+=abs(elevx-y2);
		
		cout /*<<ansl << ' ' << anse*/ << min(ansl,anse) << endl;
	}
}

main()
{
	int t=1;
	//cin >> t;
	
	while(t--)
	{
		solve();
	}
}