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,maxint
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):
	pe,pl,dl,de,ql,qe,wl,we = 0,0,0,0,0,0,0,0
	x,y,x1,y1 = map(int,stdin.readline().split())
	# print pose
	t = bisect_left(posl,y)
	k = bisect_left(pose,y)
	# print pose[k],k

	# sec to l or e
	if posl:
		if 0 <= t < len(posl):
			if abs(posl[t]-y) < abs(posl[t-1]-y):	dl,pl = abs(posl[t]-y),posl[t]
			else: dl,pl = posl[t-1]-y,posl[t-1]
		else: 
			dl,pl = abs(posl[t-1]-y),posl[t-1]
	else:
		dl = maxint

	if pose:
		if 0 <= k < len(pose):
			# print abs(pose[k]-y),abs(pose[k-1]-y)
			if abs(pose[k]-y) < abs(pose[k-1]-y):	de,pe = abs(pose[k]-y),pose[k]
			else: de,pe = pose[k-1]-y,pose[k-1]
		else: de,pe = abs(pose[k-1]-y), pose[k-1]
		# print de
	else:
		de = maxint

	# print '*', de
	# y to y1
	ql = abs(x1-x)
	qe = ceil(abs(x1-x)/(v*1.))
	# if v-1: qe = ceil(abs(x1-x)/(v-1.))
	# else: qe = ceil(abs(x1-x)/v*1.)

	# to x1
	wl = abs(pl-y1)
	we = abs(pe-y1)
	# print 'Distance to y:',dl,de
	# print 'Distance between x1 and x',ql,qe
	# print 'Distance between ladder/elevator and y1',wl,we
	# print
	stdout.write('%s\n' %int(min(dl+ql+wl,de+qe+we)))



