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

from sys import stdin,stdout
from bisect import bisect_left
from math import ceil
n,m,nl,ne,v = map(int,stdin.readline().split())
posl = map(int,stdin.readline().split())
pose = map(int,stdin.readline().split())
q = input()
for i in xrange(q):
	fl=fe=pe=pl=dl=dl1=de=de1=ql=qe=wl=we=0
	x,y,x1,y1 = map(int,stdin.readline().split())
	
	if x == x1: 
		stdout.write('%s\n' %abs(y1-y))
		exit()

	if posl:
		t = bisect_left(posl,y)
		if t == 0: fl,pl = posl[0],0
		elif t == len(posl): fl,pl = posl[len(posl)-1],0
		else: fl,pl = posl[t],posl[t-1]

	if pose:
		k = bisect_left(pose,y)
		if k == 0: fe,pe = pose[0],0
		elif k == len(pose): fe,pe = pose[len(pose)-1],0
		else: fe,pe = pose[k],pose[k-1]

	# sec to l or e
	if posl:
		dl = abs(fl-y)
		if pl:
			dl1 = abs(pl-y)
		else:
			dl1 = float('inf')
	else:
		dl = dl1 = float('inf')

	if pose:
		de = abs(fe-y)
		if pe:
			de1 = abs(pe-y)
		else:
			de1 = float('inf')
	else:
		de = de1 = float('inf')

	# y to y1
	ql = abs(x1-x)
	qe = ceil(abs(x1-x)/(v*1.))

	# to x1
	wl = abs(fl-y1)
	wl1 = abs(pl-y1)
	we = abs(fe-y1)
	we1 = abs(pe-y1)

	sl=ql+wl
	se=qe+we 
	sl1=ql+wl1
	se1=qe+we1
	stdout.write('%s\n' %int(min(dl+sl,de+se,dl1+sl1,de1+se1)))



